Use PVSyst .pan and .ond files with pvlib

408 views
Skip to first unread message

Lucas Viani

unread,
Mar 22, 2019, 2:48:16 AM3/22/19
to pvlib-python
I am trying to convert the files .pan and .ond from PVSyst to a format accepted by pvlib.
Some of the parameters are the same, but some others need to be converted or deduced.

I would like to ask if any of you have tried it before, or if you know any workflow already developed to do the same job?

Thank you guys!

cwh...@sandia.gov

unread,
Mar 22, 2019, 11:42:53 AM3/22/19
to pvlib-python
I haven't done this, and am not aware of any code that has been shared to help.  I'm happy to work with you to accomplish this translation, if you'd like. 

Cliff

Frederic Rivollier

unread,
Mar 24, 2019, 6:02:00 PM3/24/19
to pvlib-python
Lucas, Cliff,

I have some code to read PAN files and to get single diode model parameters for PVLIB
I've uploaded a notebook that traces IV curves and the python PAN parsing module here for you to take a look.
Let me know what you think. The parsing code could be improved and added to the pvlib iotools.

Frederic

Lucas Viani

unread,
Mar 25, 2019, 10:32:10 AM3/25/19
to pvlib-python
Hello Cliff and Frederic,

Thank you for answering!

I think that adding a code that performs this convertions to pvlib would add some extra flexibility to the library.
Frederic, I will take a look at the code and let you know!

Cheers!

cwh...@sandia.gov

unread,
Mar 25, 2019, 11:01:32 AM3/25/19
to pvlib-python
Hi Frederic,

Thanks for sharing your code which would be a great addition to pvlib iotools.  We'll have some work to do to get a pull request merged. Is parsing by indentation needed? Maybe strip the leading spaces and put the entire PAN file content in a flat dict? I haven't looked at a lot of PAN files, though, so I'll defer to your judgment. 

I'm guessing that the test files are only a small part of full PAN files. If possible we should add a full PAN file to the test data.  I don't currently have a pvsyst license so I can't make one.

There are other parameters in the file that are of interest, e.g., VRevDiode and the IAM profile, but their connection to the rest of pvlib is not currently in place, so they can be added to the output later.

In any case, if you are willing to contribute your code, the next step is to open a PR https://github.com/pvlib/pvlib-python so the other maintainers can weigh in.

Thanks again,

Cliff

Mark Mikofski

unread,
Mar 25, 2019, 7:35:45 PM3/25/19
to pvlib-python
Hi Frederic,

You mentioned converting OND files as well as PAN, but I didn't see them in your pvsyt_tools repo. Can you convert, read, parse them into pvlib for inverters? Cliff does PVlib MATLAB already have this capability?

Also, I assume the PAN conversion for pvlib only works on post v6.6 pvsyst files that are all text, or have you also deciphered binary files too?

On a related side note, I've cracked the MET file format, and can read MET files into pandas dataframes.

Thanks,
Mark

Frederic Rivollier

unread,
Mar 25, 2019, 10:35:26 PM3/25/19
to pvlib-python
Hi Mark,

I haven't looked into OND files yet but that code work on SIT, MET, PRJ, and VC files with custom "group keys" for each file type. That module could be expanded to read various PVSYST file types.
I have also decoded the MET file data, which was rather satisfying but haven't been that useful to me yet. 

Regarding file type, this code only works with the plain text version  > 6.40, the binary files ( < 6.40) are painful to read,  they use REAL48 encoding (Delphi unique format)   which I have implemented in python before but never finished that code. 
FYI, https://github.com/CanadianSolar/CASSYS  can read both formats (VBA in Excel) PAN and OND. 

I am going to work on reading the IAM profile, low light data, and other missing parameters with the goal to eventually add to iotools.  I have never contributed to open source nor written proper docs and unit test so you are going to have to bear with me :)

Does anyone know if ModelChain is fully compatible with the pvsyst model parameters? I struggled with the temp_model trying to pass the pvsyst_celltemp function to it unsuccessfully.  

Regards,

Frederic

cwh...@sandia.gov

unread,
Mar 26, 2019, 10:35:18 AM3/26/19
to pvlib-python


On Monday, March 25, 2019 at 8:35:26 PM UTC-6, Frederic Rivollier wrote:

I am going to work on reading the IAM profile, low light data, and other missing parameters with the goal to eventually add to iotools.  I have never contributed to open source nor written proper docs and unit test so you are going to have to bear with me :)

I'm happy to help with the documentation and unit tests.

 
Does anyone know if ModelChain is fully compatible with the pvsyst model parameters? I struggled with the temp_model trying to pass the pvsyst_celltemp function to it unsuccessfully.  

The DC performance model should be available in a ModelChain.  The temperature model is not available currently, I'll take that one.

Cliff
 

Frederic Rivollier

unread,
Mar 27, 2019, 11:30:23 PM3/27/19
to pvlib-python
Cliff, Mark,

Here is an updated notebook with PAN file IAM profile parsing.

Any idea on how to implement the custom IAM profile lookup? I am guessing some SciPy Cubic Interpolation.
Is there any similar code in pvlib? Right now I have the angle and efficiency in a numpy array

array([[10. , 20. , 30. , 40. , 50. , 60. , 70. , 80. , 90. ], [ 1. , 1. , 1. , 0.99, 0.99, 0.97, 0.92, 0.76, 0. ]])


Frederic

Mark Mikofski

unread,
Mar 28, 2019, 10:05:44 AM3/28/19
to Frederic Rivollier, Newmiller, Jeffrey, pvlib-python
At SunPower we considered using cubic spline to interpolate from the table, but opted for linear interpolation because cubic spline is implemented differently EG in MATLAB vs. SciPy

Does anyone know what PVsyst uses for IAM lookup interpolation? Is it linear or cubic or nearest neighbor?

--
You received this message because you are subscribed to a topic in the Google Groups "pvlib-python" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/pvlib-python/PDDic0SS6ao/unsubscribe.
To unsubscribe from this group and all its topics, send an email to pvlib-python...@googlegroups.com.
To post to this group, send email to pvlib-...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pvlib-python/7011e58c-acb9-4d67-a314-842beaf84293%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


--
Being deeply loved by someone gives you strength;
loving someone deeply gives you courage.
Lao Tzu

Hansen, Clifford W

unread,
Mar 28, 2019, 10:54:40 AM3/28/19
to Mark Mikofski, Frederic Rivollier, Newmiller, Jeffrey, pvlib-python

It’s a linear interpolation

 

https://forum.pvsyst.com/viewtopic.php?t=2698

--
You received this message because you are subscribed to the Google Groups "pvlib-python" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pvlib-python...@googlegroups.com.


To post to this group, send email to pvlib-...@googlegroups.com.

cwh...@sandia.gov

unread,
Mar 28, 2019, 10:59:56 AM3/28/19
to pvlib-python
Also, there's no function in pvlib that could use the custom IAM profile.

When we add `iam_custom` or whatever we name it, I'd like to change the name pattern for all the IAM functions from, e.g., ashraeiam to iam_ashrae.  I think Will agrees.  In principle we'll migrate all functions to (modeling step)_(model name) pattern.


On Thursday, March 28, 2019 at 8:54:40 AM UTC-6, Hansen, Clifford W wrote:

William Holmgren

unread,
Mar 28, 2019, 11:50:36 AM3/28/19
to Hansen, Clifford W, pvlib-python
Yes, I generally agree. Function/module naming patterns are in this issue: https://github.com/pvlib/pvlib-python/issues/436

--
You received this message because you are subscribed to the Google Groups "pvlib-python" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pvlib-python...@googlegroups.com.
To post to this group, send email to pvlib-...@googlegroups.com.
Message has been deleted

Luca Thiébaud

unread,
Dec 2, 2019, 4:41:29 PM12/2/19
to pvlib-python
Frederic,

Thank you for sharing this notebook, it's a nice tool!

I have a question concerning the single diode model equation.
This equation describes the relation between I and V at a module level (ie the module current and the module voltage are considered). To obtain the module equation, the single diode equation for a cell is considered, replacing Vcell by (Vmodule / number_of_cells_in_serie) and Icell by Imodule (see the PVPerformance collaborative page). But the module single diode equation obtained this way is slightly different from the one descirbed by PVSyst helpguide in the 'Physical models used' -> 'PVModule' section), and that is used in your package. Indeed in the PVSyst equation, the current I in the diode current term is not multiplied by the number of cells in serie Ns whereas it seems that it should be (see the PVPerformance collaborative page).

I wonder if there is an explanation for this. I would be glad to have your points on the question.

Thank you very much!
Luca

cwh...@sandia.gov

unread,
Dec 2, 2019, 4:48:00 PM12/2/19
to pvlib-python
Hi Luca,

The issue is that the parameters have different values for a cell and a module of Ns cells in series. If Rs is the series resistance for a cell, then the series resistance for a module of Ns series-connected cells is Ns x Rs. The module current Im is equal to the cell current; it's not being multiplied by Ns, the resistance Rs is being multiplied.

Hope that helps,

Cliff

Luca Thiébaud

unread,
Dec 2, 2019, 4:52:42 PM12/2/19
to pvlib-python
Hi Cliff,

Thank you very much for your quick answer! I thought the Serie resistance parameter was for a single cell.

Thanks again,
Luca

Ben Possatto

unread,
Oct 6, 2021, 11:34:19 AM10/6/21
to pvlib-python

Hello everyone! 

Frederic, thanks for the notebook. It has been very helpful to me!

I just have one question: why in this case the global irradiance value was used instead of the effective irradiance in line 15? 

Thanks!

Ben

Frederic Rivollier

unread,
Oct 6, 2021, 3:44:38 PM10/6/21
to pvlib-python, Ben Possatto
good catch this example should probably used effective irradiance rather than global.
--

You received this message because you are subscribed to the Google Groups "pvlib-python" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pvlib-python...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages