Weather Data requests

  • Dan
  • Topic Author
More
24 Nov 2021 21:54 #10312 by Dan
Weather Data requests was created by Dan
I'm using pysam.ResourceTools.FetchResourceFiles to get weather data.  This tool saves the data to disk then reads it into memory.  Is there a way to skip the write operation and just read the data into memory (e.g. assign it to SolarResource.solar_resource_data)?

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

  • Paul Gilman
More
30 Nov 2021 01:14 #10325 by Paul Gilman
Replied by Paul Gilman on topic Weather Data requests
Hi Dan,

I think you could probably skip that step. Writing it it disk does give you a way to check the data if you run into trouble.

Best regards,
Paul.

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

  • Dan
  • Topic Author
More
30 Nov 2021 21:03 - 13 Dec 2021 22:54 #10331 by Dan
Replied by Dan on topic Weather Data requests
I guess I don't know how to assign solar_resource_data without running the download step. This is my present code:
data_tool = tools.FetchResourceFiles(
                                    tech='solar',                            
                                    nrel_api_key=api_key,
                                    nrel_api_email=email)
           data_tool.fetch([(longitude, latitude)])  #saves a tmy .csv file in the data directory        
          data_path = data_tool.resource_file_paths_dict[longitude, latitude]        
          self.system.SolarResource.solar_resource_file=data_path        
           self.system.SolarResource.solar_resource_data = tools.SAM_CSV_to_solar_data(data_path)
Last edit: 13 Dec 2021 22:54 by Dan. Reason: formatted code

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

  • Paul Gilman
More
08 Dec 2021 23:54 #10370 by Paul Gilman
Replied by Paul Gilman on topic Weather Data requests
Hi Dan,

The NREL NSRDB API delivers solar resource data in a file. I don't think there is a way to get the data from the API without downloading a file.

The FetchResourceFiles() function downloads the data as a CSV file, but it is possible to get it as a JSON file instead. For example, you can see the documentation of the PSM v3 endpoint here: developer.nrel.gov/docs/solar/nsrdb/psm3-download/

The 'pvsamv1' module has two ways of inputting weather data, as documented in nrel-pysam.readthedocs.io/en/master/modules/Pvsamv1.html. You can read it from a weather file in the SAM CSV format by setting the value of 'solar_resource_file' to the file's path and name, or you can use the 'solar_resource_data' input to set the values without reading them  from a file.

Best regards,
Paul.

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

  • Dan
  • Topic Author
More
13 Dec 2021 22:50 #10386 by Dan
Replied by Dan on topic Weather Data requests
Thanks.  So if I want to avoid downloading and reading a .csv I need to use the psm v3 endpoint instead of FetchResourceFiles.  Is FetchResourceFiles under the same RateLimit restrictions as the PSM V3 endpoint?  

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

  • Paul Gilman
More
14 Dec 2021 00:48 #10391 by Paul Gilman
Replied by Paul Gilman on topic Weather Data requests
Hi Dan,

The rate limit is determined by the NREL Developer API key you use for the downloads, regardless of the platform you use for the downloads.

Best regards,
Paul.

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

Moderators: Paul Gilman
Powered by Kunena Forum