TMY3 header format for India Solar Resource Files

7 posts / 0 new
Last post
akhileshmagal
akhileshmagal's picture
TMY3 header format for India Solar Resource Files

I need to run a simulation for a location in India. For this, I am using the NREL India Resource Files (availabe at: http://rredc.nrel.gov/solar/new_data/India/nearestcell.cgi), which I import into SAM as a TMY3 (or CSV) format file.

The problem with the India specific TMY3 files is that the header is incomplete. Therefore, in the data field "City", "Data Source" and "Country" I get blanks.

I tried opening the .CSV file in a text editor and to manually add the header fields in the following format:

Location,City,Region,Country,Latitude,Longitude,Time Zone,Elevation,Source

However, this leads to an error and SAM refuses to read this file.

What am I missing? I need the complete fields for my reports. Is there some way I can edit these header files?

Paul Gilman

Hello,

I tested one of the files from the NREL India Solar Resource Database (75°N, 25°E), and it worked fine without any modifications, in spite of having blank values for Country and Data Source, and '??' for State. Did you try running a simulation with the unmodified file?

The header format you mention is not the correct format for the NREL TMY3 format. The correct format is described in Table 1-1 of the TMY3 User's Manual (PDF 1.7 MB):

Site identifier code (number)
Station name (quote delimited)
Station state (two letters)
Site time zone (hours from GMT, negative west)
Site latitude (decimal degrees)
Site longitude (decimal degrees)
Site elevation (meters)

Best regards,
Paul.

akhileshmagal
akhileshmagal's picture

Thanks Paul,

The simulation works fine. The problem is with the missing data fields 'Country' and 'Data Source'. This does not make a report complete - one that I could present to the bank.
Is there some way I can add these fields into the header?

Paul Gilman

Sorry I misunderstood your original question. There are two parts to this question.

First, the file from the NREL India Solar Resource Database, which is in the NREL TMY3 format, does not have values for the Station Name and Station State fields, so SAM displays "satellitedata" and "??" for those fields. You can change the values of those fields in the header as you attempted to do. For example:

Original header:
075052505," ""satellitedata""", ??, 5.5, 25.05, 75.05, 419.0

Modified header:
075052505,"City Name", State Name, 5.5, 25.05, 75.05, 419.0

That will result in more meaningful information being displayed on the Location and Resource page City and State fields, and in the PDF report. However, the Country and Data Source fields on the Location and Resource page will still be empty. 

Second, the "Country" and "Data Source" fields are not part of the TMY3 file format. If you want those fields to appear on the Location and Resource page, you'll have to convert the file from the TMY3 format to the SAM CSV format, which you can do in these sixteen easy smiley steps:

  1. Create a folder on your computer to store your custom weather files.
  2. Make a copy of the original TMY3 format file in case you make a mistake and need to start over.
  3. Use a text editor to open the copy of the TMY3 format file, and change the Station Name and Station State values as I describe above. Enclose the station name in quotes, but not the state name or abbreviation. Avoid using Microsoft Excel for this step because it adds quotes and changes number formatting in ways that can render the file unreadable.
  4. Save the modified file to the folder you created in Step 1.
  5. In SAM, create or open a .sam file with a PVWatts case (or any other solar performance model) and any financial model.
  6. Click Macros at the bottom left of the window.
  7. Click Weather File Converter, and read the instructions to understand what the macro will do when you run it.
  8. Click Run macro near the top of the window.
  9. Open the file from Step 3. If all goes well, you'll see a message that says "Weather file successfully converted. Open it?" You will also see that the macro named the file something like USA IN Station Name (TMY3).csv.
  10. Click Yes to open the file in Excel. Alternatively, you can click No, and open it yourself with a text editor.
  11. Edit the second row of the header so that it looks something like this:
  12. Source,Location ID,City,State,Country,Latitude,Longitude,Time Zone,Elevation
    NREL,75052505,City Name,State Name,India,25.05,75.05,5.5,419
  13. Save and close the file. You can save it with a name like India Station Name (NREL).csv.
  14. On the Location and Resource page, click Folder Settings, and add the folder you created in Step 1 to the Solar Data File Folders list.
  15. Click Refresh library.
  16. You should see the file listed in the library toward the bottom.

There, wasn't that easy?

Note that I recommend not using Excel to edit the TMY3 format file in Step 3, but say it's OK in Step 10. That is because the SAM CSV format is more flexible than the TMY3 format, and Excel's automatic number or date formatting is less likely to cause problems with the SAM CSV format.

Best regards,
Paul.

rabia

Hello paul.please give me email address.i want to share some files with u.i have a problem

Paul Gilman

Please use the contact form to email me (you can find my email address there):

https://sam.nrel.gov/contact

Best regards,
Paul.

rabia

thanks poul

Theme by Danetsoft and Danang Probo Sayekti inspired by Maksimer