- Posts: 16
Weather Data requests
- d.goodrick
- Topic Author
Less
More
24 Nov 2021 14:54 #10312
by d.goodrick
Weather Data requests was created by d.goodrick
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.
- pgilman
Less
More
- Posts: 5447
29 Nov 2021 18:14 #10325
by pgilman
Replied by pgilman 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.
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.
- d.goodrick
- Topic Author
Less
More
- Posts: 16
30 Nov 2021 14:03 - 13 Dec 2021 15:54 #10331
by d.goodrick
Replied by d.goodrick 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:
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 15:54 by d.goodrick. Reason: formatted code
Please Log in or Create an account to join the conversation.
- pgilman
Less
More
- Posts: 5447
08 Dec 2021 16:54 #10370
by pgilman
Replied by pgilman 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.
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.
- d.goodrick
- Topic Author
Less
More
- Posts: 16
13 Dec 2021 15:50 #10386
by d.goodrick
Replied by d.goodrick 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.
- pgilman
Less
More
- Posts: 5447
13 Dec 2021 17:48 #10391
by pgilman
Replied by pgilman 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.
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: pgilman