Why NSRDB API is not working with refering the Lat, Lon values inside the code?

167 Views Asked by At

I'm trying to fetch TMY Solar Resource Data from NSRDB Database using Pvlib_get_psm3() method. Using the below code. But getting error. The code that I AM Using:

NREL_API_KEY = '{{API_KEY'
lat1=st.number_input('Insert the Latitude:',value=52.4830986)
lon1=st.number_input('Insert the Longitude:',value=13.4920913)
metadata = pvlib.iotools.get_psm3(
    latitude=lat1, longitude=lon1,
    api_key=NREL_API_KEY,
    email='[email protected]',
    names='tmy')
st.write(metadata)

Getting Error like this:

HTTPError: ['No data available at the provided location', 'Data processing failure.'] Traceback: File "C:\Users\amrit\anaconda3\lib\site-packages\streamlit\script_runner.py", line 430, in _run_script exec(code, module.dict) File "C:\Users\amrit\Desktop\python\tracker\tilt_compare.py", line 148, in metadata = pvlib.iotools.get_psm3( File "C:\Users\amrit\anaconda3\lib\site-packages\pvlib\iotools\psm3.py", line 166, in get_psm3 raise requests.HTTPError(errors, response=response)

But if I change the Latitude and Longitude values with Numerical (Float/int), then the code is working fine.

I'm not able to understand the issue here with the above code. Please help!!

1

There are 1 best solutions below

0
On

The geographical coverage for NSRDB PSM3 does not include the chosen point, which is in Europe. The warning that is returned also specifies this "No data available at the provided location".

For an overview of the geographical coverage of PSM3 see the below screen-shot: enter image description here

For time series of solar irradiance in Europe, I would recommend that you look into PVGIS and CAMS Radiation (there exists pvlib functions for both). Alternatively, there is commercial data providers.