- Posts: 2
Pvsamv1: Importing the CEC Module Database
- Deflation0719
- Topic Author
Less
More
04 May 2023 20:47 #12112
by Deflation0719
Pvsamv1: Importing the CEC Module Database was created by Deflation0719
Hi Everyone,
Overview: I am a bit new to PySAM and the SAM software itself so I could be understanding the documentation incorrectly. I was able to successfully understand and get a simple Pvwatts8 model to simulate using PySAM however I would now like to run a simulation using a Photovoltaic Detailed PV Model.
Objective: My end goal is to use PySAM to iterate through all of the Modules within the CEC Performance Model Database and run a simulation with each to provide an output of the Annual AC kWh production.
Problem: I have attempted to use a PySAM JSON to make the edits however no key value for module_name is available, I figured it would be better to run a module by default values instead. I cannot seem to find an effective way of getting the module data from the database.
I am hoping to get the correct way to access the data within the CEC database so I can manipulate and run simulations using the modules within.
Looking forward to seeing the responses. Thank you in advance.
Overview: I am a bit new to PySAM and the SAM software itself so I could be understanding the documentation incorrectly. I was able to successfully understand and get a simple Pvwatts8 model to simulate using PySAM however I would now like to run a simulation using a Photovoltaic Detailed PV Model.
Objective: My end goal is to use PySAM to iterate through all of the Modules within the CEC Performance Model Database and run a simulation with each to provide an output of the Annual AC kWh production.
Problem: I have attempted to use a PySAM JSON to make the edits however no key value for module_name is available, I figured it would be better to run a module by default values instead. I cannot seem to find an effective way of getting the module data from the database.
I am hoping to get the correct way to access the data within the CEC database so I can manipulate and run simulations using the modules within.
Looking forward to seeing the responses. Thank you in advance.
Please Log in or Create an account to join the conversation.
- pgilman
Less
More
- Posts: 5447
05 May 2023 11:42 - 05 May 2023 11:42 #12118
by pgilman
Replied by pgilman on topic Pvsamv1: Importing the CEC Module Database
Hi Joseph,
The CEC module library is part of the SAM user interface, so is not directly available through PySAM.
It would be easiest to do the analysis you describe using an LK script in SAM rather than PySAM. For more about LK, see sam.nrel.gov/lk-script.html . For example, this simple LK script reads the current module library item, and then changes it:
If you really want to do this in PySAM, the relevant Pvsamv1 inputs are the ones that start with "cec_", and are listed starting here in the PySAM documentation.
SAM uses a CSV file to store the CEC module parameters. That file is available on GitHub here: github.com/NREL/SAM/blob/patch/deploy/libraries/CEC%20Modules.csv .
Step 4A in this sample PySAM script shows how to assign the Pvsamv1 inputs with data from the CSV file. That script is a bit of a work in progress, but does show how this works.
Best regards,
Paul.
The CEC module library is part of the SAM user interface, so is not directly available through PySAM.
It would be easiest to do the analysis you describe using an LK script in SAM rather than PySAM. For more about LK, see sam.nrel.gov/lk-script.html . For example, this simple LK script reads the current module library item, and then changes it:
Code:
module = get('module_name');
outln(module);
set('module_name', 'SunPower SPR-310-WHT-U');
module = get('module_name');
outln(module);
If you really want to do this in PySAM, the relevant Pvsamv1 inputs are the ones that start with "cec_", and are listed starting here in the PySAM documentation.
SAM uses a CSV file to store the CEC module parameters. That file is available on GitHub here: github.com/NREL/SAM/blob/patch/deploy/libraries/CEC%20Modules.csv .
Step 4A in this sample PySAM script shows how to assign the Pvsamv1 inputs with data from the CSV file. That script is a bit of a work in progress, but does show how this works.
Best regards,
Paul.
Last edit: 05 May 2023 11:42 by pgilman.
Please Log in or Create an account to join the conversation.
- Deflation0719
- Topic Author
Less
More
- Posts: 2
24 May 2023 22:23 #12172
by Deflation0719
Replied by Deflation0719 on topic Pvsamv1: Importing the CEC Module Database
Paul,
Thank you for taking the time to reply in a hasty manner. This actually assisted me a lot in understanding PySam and the SDK further. Especially (Step 4a). My next step is to get more versatile in understanding LK scripts and scripting to make better use of the program.
I do have two last questions: Happy to make another forum post if required:
1. Can you confirm that is it not possible to create reports using the PySam SDK
2. I would like to run PySam and the SDK within a container service, would you happen to have any guides that would be helpful to achieve this? Currently from my understanding in order to use PySam I must have a registered version of SAM on my local computer.
Thank you for all of you help and thank you for answering in advance.
Thank you for taking the time to reply in a hasty manner. This actually assisted me a lot in understanding PySam and the SDK further. Especially (Step 4a). My next step is to get more versatile in understanding LK scripts and scripting to make better use of the program.
I do have two last questions: Happy to make another forum post if required:
1. Can you confirm that is it not possible to create reports using the PySam SDK
2. I would like to run PySam and the SDK within a container service, would you happen to have any guides that would be helpful to achieve this? Currently from my understanding in order to use PySam I must have a registered version of SAM on my local computer.
Thank you for all of you help and thank you for answering in advance.
Please Log in or Create an account to join the conversation.
- pgilman
Less
More
- Posts: 5447
25 May 2023 09:40 - 25 May 2023 09:41 #12173
by pgilman
Replied by pgilman on topic Pvsamv1: Importing the CEC Module Database
Hi Joseph,
The report generator is part of the SAM user interface, so it is not available from PySAM. There are other Python packages that you could use to create your own reports in Python using data from PySAM.
PySAM does not require that SAM be installed on your computer (or container). PySAM is a Python package that runs completely independently from SAM. You should be able to install PySAM in any environment that supports Python and is based on or emulates a Windows, Linux, or macOS operating system.
Best regards,
Paul.
The report generator is part of the SAM user interface, so it is not available from PySAM. There are other Python packages that you could use to create your own reports in Python using data from PySAM.
PySAM does not require that SAM be installed on your computer (or container). PySAM is a Python package that runs completely independently from SAM. You should be able to install PySAM in any environment that supports Python and is based on or emulates a Windows, Linux, or macOS operating system.
Best regards,
Paul.
Last edit: 25 May 2023 09:41 by pgilman.
Please Log in or Create an account to join the conversation.
Moderators: pgilman