solaranywhere weather data compatibility issue?

  • doug@sunspec.org
  • Topic Author
More
05 Jan 2015 10:36 #2887 by doug@sunspec.org
solaranywhere weather data compatibility issue? was created by doug@sunspec.org
I am attempting to use a time series csv file from solaranywhere.com (TMY3 format).

SAM 2014.11.24 appears to be unable to read the file...I'm wondering whether an incompatibility was introduced with 2014.11.24?

I've attached error message screenshots and the csv file I'm attempting to use.

Thanks for any help..




Please Log in or Create an account to join the conversation.

  • pgilman
More
08 Jan 2015 12:28 - 06 Sep 2019 16:01 #2888 by pgilman
Dear Doug,
There are a couple issues with the TMY3 format file generated by SolarAnywhere that will prevent it from running in SAM:
  • Missing data. Some columns have no values, and some rows may have missing values.
  • The time stamp is inconsistent with the TMY3 time convention: The hour time stamp for the last hour of the day is 0:00 instead of 24:00, and the final hour of the year is on January 1 instead of December 31.

UPDATE 9/6/2019: In newer versions of SAM, the Solar Resource File Converter implements the conversion algorithm in the LK script below, so you do not need to download the script. Instead, click Macros under the Simulate button and then choose Solar Resource File Converter from the list of macros.

I've written an LK script that you can use in SAM to convert your file to the SAM CSV format that SAM can read. To use it:
  1. Download the script ( LK 4.65 KB ).
  2. Start SAM, and click Open script and open the LK file you downloaded in Step 1. (If SAM is already open, you can open the script SAM Start menu.) Read the description of what the script does in the comment block at the top of the script.
  3. Click Run at the top of the scripting window. If all goes well, the script should create a SAM CSV file with the data from your SolarAnywhere file and save it in the same folder as the SolarAnywhere file.
  4. Open your SAM project file, and on the Location and Resource page, add the folder that contains the SAM CSV file to the Folder Settings list (click Folder Settings) and refresh the library.
  5. Click View hourly data to see the data. Missing data should be visible in the graphs as -999 values.
Best regards,

Paul.
Last edit: 06 Sep 2019 16:01 by pgilman.

Please Log in or Create an account to join the conversation.

  • pgilman
More
16 Apr 2015 12:32 #2889 by pgilman
For an expanded version of the SolarAnywhere conversion script, see the LK Script Cookbook on the Sample Files page . The script performs the following conversion tasks:

  • Convert SolarAnywhere and SolarAnywhere TMY3 files to SAM CSV. The script determines the input file format from the number of columns in the header row. This simple approach should be robust enough for files from SolarAnywhere, but may cause problems if you try to convert files that are not in one of the SolarAnywhere formats.

  • For SolarAnywhere files with historical data over a multi-year period, the script creates a separate SAM CSV file for each year and appends the year to the file name so that you can use the set of files for P50/P90 simulations in SAM.

  • The script replaces blanks in the original file with -999 flag values in the SAM CSV file to avoid simulation errors in SAM. See the comments in the script for more details about how this might affect simulations.

  • When you convert a file with one year of data, the script displays the converted file in the time series data viewer.
To use the script:

  1. Download the LK file from the  Sample Files page .

  2. Start SAM, and click Open Script on the Welcome page. You do not need to run the script from an open case.

  3. Navigate to the folder that contains the LK script and open it.

  4. Read the information about the script in the comments, which appear as green text in the script editing window.

  5. Click Run at the top of the script editing window and open the SolarAnywhere file you want to convert.



    The script will save the converted SAM CSV file(s) in the folder that contains the original SolarAnywhere file. To use the SAM CSV files in SAM, you can either add them to your weather file folder, or use the Use a specific weather file on disk option. See the Help topic "Weather Files and Libraries" under "Weather Data" for more details.
The SolarAnywhere data is only suitable for SAM's photovoltaic and solar water heating models because it does not contain metorological data for atmospheric pressure and humidity required by the concentrating solar power models.
Best regards,

Paul.

Please Log in or Create an account to join the conversation.

  • ngierty
More
04 Sep 2015 07:32 #2890 by ngierty
I have the script and have tested it against all 3 versions of the SolarAnywhere data files. I'm running into a problem with the non-TMY3 files; I am more specifically concerned about the SolarAnywhere, standard top of hour, end of period integration files. The error message that occurs is: error: array index out of bounds: 9 (len: 8) in line 165 (data[6] = arr[9]; // dhi) that is part of the conversion process. If I comment out the line the code runs fine and seems to convert the file correctly, but I wanted to make sure that I wasn't losing important data in the process or if there is a better solution.

Thank you.

Please Log in or Create an account to join the conversation.

  • pgilman
More
04 Sep 2015 10:01 #2891 by pgilman
Hello ngierty,
Would you mind [url=mailto:sam.support@nrel.gov?subject=SolarAnywhere%20File%20for%20Testing t=_self]emailing me the file[/url] you are trying to convert? I want to make sure to test the script with a file in the same format that you are using, and the best way to do that is to use your file.
Best regards,

Paul.

Please Log in or Create an account to join the conversation.

  • piphomer
More
03 Feb 2016 10:35 #2892 by piphomer
Hi Paul,

When I download the script at the link at the top of this page, it converts my CPR files perfectly. When I try to use the script built into SAM (under Macros - Solar Resource File Converter), it fails. Is there a difference between the two scripts? Can you update the script in SAM so that it's the same as the downloadable one?

Thanks

Phillip

Please Log in or Create an account to join the conversation.

Moderators: pgilman
Powered by Kunena Forum