Invalid query assertion error when loading era5 wind_u and wind_v
I'm encountering an AssertionError: invalid query, could not find src='era5' for var='windspeedV'
when trying to load the wind_v
data from era5
(full error below). An equivalent error arises when trying to load wind_u
from era5
.
I believe the problem is being caused by the era5_varmap
defined in era5.py, where 10m_v_component_of_wind
is being mapped to windspeedV
instead of wind_v
(see code chunk below).
era5_varmap = dict(zip(
('significant_height_of_combined_wind_waves_and_swell',
'mean_wave_direction',
'mean_wave_period',
'10m_u_component_of_wind',
'10m_v_component_of_wind'),
('waveheight', 'wavedir', 'waveperiod', 'windspeedU', 'windspeedV')))
I am using Kadlu version 2.2.1 installed from PyPI on macOS Mojave (10.14.6) with the most recent version of Python (Anaconda 3.8.5).
The code block below provides a minimal example to reproduce this issue. The full error is included in the following code chunk.
result = kadlu.load(source='era5', var='wind_v',
start=datetime(2016, 3, 9) , end=datetime(2016,3,11),
south=44.5541333 - ns_offset, west=-64.17682 - ew_offset,
north=44.5541333 + ns_offset, east=-64.17682 + ew_offset,
top=0, bottom=0)
---------------------------------------------------------------------------
AssertionError Traceback (most recent call last)
<ipython-input-52-c468fbc37902> in <module>
----> 1 result = kadlu.load(source='era5', var='wind_v',
2 start=datetime(2016, 3, 9) , end=datetime(2016,3,11),
3 south=44.5541333 - ns_offset, west=-64.17682 - ew_offset,
4 north=44.5541333 + ns_offset, east=-64.17682 + ew_offset,
5 top=0, bottom=0)
//anaconda3/envs/kadlu_env_2/lib/python3.8/site-packages/kadlu/__init__.py in load(source, var, **kwargs)
58 f'for more info, print(kadlu.source_map)'
59
---> 60 return load_map[loadkey](**kwargs)
61
62
//anaconda3/envs/kadlu_env_2/lib/python3.8/site-packages/kadlu/geospatial/data_sources/era5.py in load_wind_v(self, **kwargs)
233 return load_era5('10m_u_component_of_wind', kwargs)
234 def load_wind_v(self, **kwargs):
--> 235 return load_era5('10m_v_component_of_wind', kwargs)
236 def load_wind_uv(self, **kwargs):
237 """ an SQL join is used for loading wind data to deal with the
//anaconda3/envs/kadlu_env_2/lib/python3.8/site-packages/kadlu/geospatial/data_sources/era5.py in load_era5(var, kwargs)
182
183 # check for missing data
--> 184 kadlu.geospatial.data_sources.fetch_handler.fetch_handler(
185 era5_varmap[var], 'era5', parallel=1, **kwargs)
186
//anaconda3/envs/kadlu_env_2/lib/python3.8/site-packages/kadlu/geospatial/data_sources/fetch_handler.py in fetch_handler(var, src, **kwargs)
81 """
82
---> 83 assert f'{var}_{src}' in source_map.fetch_map.keys() \
84 or f'{var}U_{src}' in source_map.fetch_map.keys(), 'invalid query, '\
85 f'could not find {src=} for {var=}. options are: '\
AssertionError: invalid query, could not find src='era5' for var='windspeedV'. options are: [['chs', 'bathy'], ['hycom', 'temp'], ['hycom', 'salinity'], ['hycom', 'water_uv'], ['hycom', 'water_u'], ['hycom', 'water_v'], ['era5', 'wavedir'], ['era5', 'waveheight'], ['era5', 'waveperiod'], ['era5', 'wind_uv'], ['era5', 'wind_u'], ['era5', 'wind_v'], ['wwiii', 'wavedir'], ['wwiii', 'waveheight'], ['wwiii', 'waveperiod'], ['wwiii', 'wind_uv'], ['wwiii', 'wind_u'], ['wwiii', 'wind_v'], ['gebco', 'bathy']]
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information