Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
fix bug in cmorize_obs_eppley_vgpm_modis.py (#1729) (#1759)
* fix bug in cmorize_obs_eppley_vgpm_modis.py (#1729). Added pynio as a dependency.

Co-authored-by: Mattia Righi <mattia.righi@dlr.de>
Co-authored-by: Bouwe Andela <b.andela@esciencecenter.nl>
  • Loading branch information
3 people committed Jul 24, 2020
1 parent 91b05f3 commit d27456c
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 3 deletions.
1 change: 1 addition & 0 deletions environment.yml
Expand Up @@ -13,6 +13,7 @@ dependencies:
- cdo>=1.9.7
- imagemagick
- nco
- pynio
- scikit-learn # may hit hw-specific issue if from pypi https://github.com/scikit-learn/scikit-learn/issues/14485

# Multi language support:
Expand Down
6 changes: 3 additions & 3 deletions esmvaltool/cmorizers/obs/cmorize_obs_eppley_vgpm_modis.py
Expand Up @@ -70,13 +70,13 @@ def merge_data(in_dir, out_dir, raw_info):
var = raw_info['name']
filelist = sorted(glob.glob(in_dir + '/' + raw_info['file'] + '*.hdf'))
for filename in filelist:
ds = xr.open_dataset(filename).rename({
ds = xr.open_dataset(filename, engine='pynio').rename({
'fakeDim0': 'lat',
'fakeDim1': 'lon'
})
# create coordinates
ds = ds.assign_coords(
time=dt.strptime(ds.attrs['Start Time String'],
time=dt.strptime(ds.attrs['Start_Time_String'],
'%m/%d/%Y %H:%M:%S'))
ds = ds.expand_dims(dim='time', axis=0)
dx = 90. / ds.dims['lat']
Expand Down Expand Up @@ -106,7 +106,7 @@ def merge_data(in_dir, out_dir, raw_info):
'calendar': 'gregorian'
},
var: {
'_FillValue': ds[var].attrs['Hole Value']
'_FillValue': ds[var].attrs['Hole_Value']
}
}
filename = os.path.join(out_dir, raw_info['file'] + '_merged.nc')
Expand Down
1 change: 1 addition & 0 deletions package/meta.yaml
Expand Up @@ -84,6 +84,7 @@ outputs:
- netCDF4
- numpy
- pandas
- pynio
- pyproj>=2.1
- python>=3.6
- python-cdo
Expand Down
1 change: 1 addition & 0 deletions setup.py
Expand Up @@ -42,6 +42,7 @@
'netCDF4',
'numpy',
'pandas',
'pynio',
'pyproj>=2.1'
'pyyaml',
'scikit-learn',
Expand Down

0 comments on commit d27456c

Please sign in to comment.