Skip to content

Commit

Permalink
Fix a small bug (#1343)
Browse files Browse the repository at this point in the history
  • Loading branch information
fmaussion authored Nov 28, 2021
1 parent 9cfc3fa commit 83cb2c5
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions oggm/shop/ecmwf.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,9 @@ def get_ecmwf_file(dataset='ERA5', var=None):
def _check_ds_validity(ds):
if 'time' in ds.variables and np.any(ds['time.day'] != 1):
# Mid-month timestamps need to be corrected
ds['time'] = pd.to_datetime({'year': ds['time.year'],
'month': ds['time.month'],
'day': 1})
ds['time'].data[:] = pd.to_datetime({'year': ds['time.year'],
'month': ds['time.month'],
'day': 1})
assert ds.longitude.min() >= 0


Expand All @@ -113,7 +113,8 @@ def process_ecmwf_data(gdir, dataset=None, ensemble_member=0,
Parameters
----------
dataset : str
'ERA5', 'ERA5L', 'CERA'. Defaults to cfg.PARAMS['baseline_climate']
'ERA5', 'ERA5L', 'CERA', 'ERA5L-HMA', 'ERA5dr'.
Defaults to cfg.PARAMS['baseline_climate']
ensemble_member : int
for CERA, pick an ensemble member number (0-9). We might make this
more of a clever pick later.
Expand Down

0 comments on commit 83cb2c5

Please sign in to comment.