简体   繁体   English

为什么 NSRDB API 无法在代码中引用 Lat、Lon 值?

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

I'm trying to fetch TMY Solar Resource Data from NSRDB Database using Pvlib_get_psm3() method.我正在尝试使用Pvlib_get_psm3()方法从NSRDB 数据库中获取TMY 太阳能资源数据 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='abc.xyz@gmail.com',
    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) HTTPError:['在提供的位置没有可用数据','数据处理失败。'] 追溯:文件“C:\Users\amrit\anaconda3\lib\site-packages\streamlit\script_runner.py”,第 430 行,在_run_script exec(code, module.dict ) 文件“C:\Users\amrit\Desktop\python\tracker\tilt_compare.py”,第 148 行,在元数据 = pvlib.iotools.get_psm3( 文件“C:\Users\amrit\ anaconda3\lib\site-packages\pvlib\iotools\psm3.py",第 166 行,在 get_psm3 中引发请求。HTTPError(错误,响应=响应)

But if I change the Latitude and Longitude values with Numerical ( Float / int ), then the code is working fine.但是,如果我使用数值 ( Float / int ) 更改纬度经度值,则代码可以正常工作。

I'm not able to understand the issue here with the above code.我无法用上面的代码理解这里的问题。 Please help!!请帮忙!!

The geographical coverage for NSRDB PSM3 does not include the chosen point, which is in Europe. NSRDB PSM3 的地理覆盖范围不包括位于欧洲的所选点。 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:有关 PSM3 地理覆盖范围的概述,请参见以下屏幕截图: 在此处输入图像描述

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).对于欧洲太阳辐照度的时间序列,我建议您查看 PVGIS 和 CAMS Radiation(两者都有 pvlib 函数)。 Alternatively, there is commercial data providers.或者,有商业数据提供商。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM