简体   繁体   中英

pvlib-python forecast using GFS model server error - variable not contained in requested dataset

I'm new here and beginner Python user so go easy on me. I used to successfully forecast GHI and ambient temperature using pvlib-python forecasting module with GFS model using get_data() method for more than two years without problems but a week ago (after updating to 0.8.1 version) I'm encountering the following error as an answer from UNIDATA THREDDS server when querying data:

HTTPError: Error accessing https://thredds.ucar.edu/thredds/ncss/grib/NCEP/GFS/Global_0p5deg/Best?var=u-component_of_wind_isobaric&var=Total_cloud_cover_low_cloud_Mixed_intervals_Average&var=Total_cloud_cover_boundary_layer_cloud_Mixed_intervals_Average&var=Total_cloud_cover_middle_cloud_Mixed_intervals_Average&var=Wind_speed_gust_surface&var=Temperature_surface&var=Total_cloud_cover_entire_atmosphere_Mixed_intervals_Average&var=Total_cloud_cover_convective_cloud&var=Total_cloud_cover_high_cloud_Mixed_intervals_Average&var=Downward_Short-Wave_Radiation_Flux_surface_Mixed_intervals_Average&var=v-component_of_wind_isobaric&time_start=2021-04-27T23%3A00%3A00%2B02%3A00&time_end=2021-04-30T02%3A00%3A00%2B02%3A00&longitude=15.966568&latitude=45.815399&vertCoord=100000&accept=netcdf
Server Error (400: Variable: Total_cloud_cover_low_cloud_Mixed_intervals_Average is not contained in the requested dataset)

Apparently, variable Total_cloud_cover_low_cloud_Mixed_intervals_Average is not available when sending request to UNIDATA THREDDS server. I searched for the problem on the Internet but found nothing similar. I also found in the pvlib source code for forecast module, class GFS that variable Total_cloud_cover_low_cloud_Mixed_intervals_Average is renamed to low_clouds ( https://pvlib-python-forecasting.readthedocs.io/en/latest/_modules/pvlib/forecast.html ).

Here is the code I'm using to produce the error:

import datetime
from pvlib.forecast import GFS
import pytz

loc_latitude, loc_longitude, tzone = 45.815399, 15.966568, 'Europe/Zagreb'

today_date = datetime.date.today()
naive_time = datetime.time(0, 0, 0)
naive_datetime = datetime.datetime.combine(today_date, naive_time)
timezone = pytz.timezone('Europe/Zagreb')

#timezone aware datetime
aware_datetime = timezone.localize(naive_datetime)
GFS_start = aware_datetime
GFS_end = aware_datetime + datetime.timedelta(days = 2)

GFS_forecast_model = GFS()
GFS_raw_data = GFS_forecast_model.get_data(latitude = loc_latitude, longitude = loc_longitude, start = GFS_start, end = GFS_end)

I also tried to use NAM model instead of GFS and everything works fine but I can't use it because only GFS forecasts globally (I need forecasts for Europe). I'm using anaconda with Python 3.6.6. and pvlib-python 0.8.1 is installed using conda. I'm available for any other information needed. I would appreciate any help.

After doing some further research I found that this problem has been already reported and solved - github . GFS changed some cloud cover variables. This will be implemented in new version of pvlib .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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