- Posts: 1
Cannot get weather file for long = -111.9728826 and latitude = 33.7418135
- Wael
- Topic Author
Less
More
15 Sep 2021 08:44 #10066
by Wael
Cannot get weather file for long = -111.9728826 and latitude = 33.7418135 was created by Wael
The problem we faced is that we can't get the weather file for the following coordinates ; longitude = -111.9728826 and latitude = 33.7418135 .
We added a print statement to see what's causing the error ( the print added is at line 503)
/site-packages/PySAM/ResourceTools.py in _NSRDB_worker(self, job)
502 else:
503 print(data_response.text)
--> 504 data_response_json = data_response.json()
505 print( 'Request failed for {}\n{}'.format(data_url,data_response_json[0]))
506 return
We got a 404 response with the following details :
<li>Code: NoSuchKey</li>
<li>Message: The specified key does not exist.</li>
<li>Key: data/solar/80629_33.73_-111.98_........csv</li>
Notice that the Key contains 2 decimal places only values of the longitude and latitude, but in our case it's returning the error.
However, when we truncate those values to 2 decimal places on our own ( -111.97, 33.74), we get the file correctly.
We added a print statement to see what's causing the error ( the print added is at line 503)
/site-packages/PySAM/ResourceTools.py in _NSRDB_worker(self, job)
502 else:
503 print(data_response.text)
--> 504 data_response_json = data_response.json()
505 print( 'Request failed for {}\n{}'.format(data_url,data_response_json[0]))
506 return
We got a 404 response with the following details :
<li>Code: NoSuchKey</li>
<li>Message: The specified key does not exist.</li>
<li>Key: data/solar/80629_33.73_-111.98_........csv</li>
Notice that the Key contains 2 decimal places only values of the longitude and latitude, but in our case it's returning the error.
However, when we truncate those values to 2 decimal places on our own ( -111.97, 33.74), we get the file correctly.
Please Log in or Create an account to join the conversation.
- pgilman
Less
More
- Posts: 5447
16 Sep 2021 14:18 - 16 Sep 2021 14:19 #10073
by pgilman
Replied by pgilman on topic Cannot get weather file for long = -111.9728826 and latitude = 33.7418135
Hi Wael,
I was not able to replicate that result. For example, this request for a TMY file from the psm3-tmy endpoint returns a weather file with data:
(You will need to replace <APIKEY> and <EMAIL> with your NREL Developer API key and email address.)
Keep in mind that increasing the precision of the latitude/longitude values will not improve the result of your queries, so you may want to use less precise values if doing so avoids this problem.
Best regards,
Paul.
I was not able to replicate that result. For example, this request for a TMY file from the psm3-tmy endpoint returns a weather file with data:
Code:
https://developer.nrel.gov/api/nsrdb/v2/solar/psm3-tmy-download.csv?names=tmy&wkt=POINT(-111.9728826+33.7418135)&interval=60&api_key=<APIKEY>&email=<EMAIL>
(You will need to replace <APIKEY> and <EMAIL> with your NREL Developer API key and email address.)
Keep in mind that increasing the precision of the latitude/longitude values will not improve the result of your queries, so you may want to use less precise values if doing so avoids this problem.
Best regards,
Paul.
Last edit: 16 Sep 2021 14:19 by pgilman.
Please Log in or Create an account to join the conversation.
- racheldavis
Less
More
- Posts: 1
15 Oct 2021 14:01 #10138
by racheldavis
Replied by racheldavis on topic Cannot get weather file for long = -111.9728826 and latitude = 33.7418135
Hi Paul,
I wanted to follow back up on this issue because our team is still seeing similar behavior to what Wael described on 9/16. What Wael described was initially resolved by truncating the values so we only send 2 decimal places. However, we continue to run into similar scenarios. It’s important to note that we are getting the weather files by using the pysam.resourcetools.
Scenario which occurred Oct 14, 2021 11:56:38 PM UTC · We provided the lat = 38.0719145 and lon = -78.8858964 and received back a 404 error· Then we tried sending lat = 38.07 and lon = -78.88 and received back a 404 error· Next we tried lat = 38.071 and lon = -78.885 and it succeeded We are a little stumped as to why we continue to see these error messages and then they seem to be resolved when we send a different number of decimals. What additional information can we provide to assist in debugging this?
I wanted to follow back up on this issue because our team is still seeing similar behavior to what Wael described on 9/16. What Wael described was initially resolved by truncating the values so we only send 2 decimal places. However, we continue to run into similar scenarios. It’s important to note that we are getting the weather files by using the pysam.resourcetools.
Scenario which occurred Oct 14, 2021 11:56:38 PM UTC · We provided the lat = 38.0719145 and lon = -78.8858964 and received back a 404 error· Then we tried sending lat = 38.07 and lon = -78.88 and received back a 404 error· Next we tried lat = 38.071 and lon = -78.885 and it succeeded We are a little stumped as to why we continue to see these error messages and then they seem to be resolved when we send a different number of decimals. What additional information can we provide to assist in debugging this?
Please Log in or Create an account to join the conversation.
- pgilman
Less
More
- Posts: 5447
15 Oct 2021 18:37 #10141
by pgilman
Replied by pgilman on topic Cannot get weather file for long = -111.9728826 and latitude = 33.7418135
Hi Rachel,
Can you send examples of the URLs you are using to make these requests? That will help us troubleshoot.
There are several different API endpoints for the National Solar Radiation Database, so I want to be sure my tests are for the same endpoints.
Best regards,
Paul.
Can you send examples of the URLs you are using to make these requests? That will help us troubleshoot.
There are several different API endpoints for the National Solar Radiation Database, so I want to be sure my tests are for the same endpoints.
Best regards,
Paul.
Please Log in or Create an account to join the conversation.
Moderators: pgilman