Both files have a not well define grid:
mask = salem.GeoNetcdf(mask_path)
---------------------------------------------------------------------------
RuntimeError Traceback (most recent call last)
<ipython-input-5-a371a0171808> in <module>
----> 1 mask = salem.GeoNetcdf(mask_path)
~/.virtualenvs/oggm_env_latest/lib/python3.6/site-packages/salem/datasets.py in __init__(self, file, grid, time, monthbegin)
382 grid = sio.grid_from_dataset(self._nc)
383 if grid is None:
--> 384 raise RuntimeError('File grid not understood')
385 if time is None:
386 time = sio.netcdf_time(self._nc, monthbegin=monthbegin)
RuntimeError: File grid not understood`
I then use xarray to open it but I still encounter the grid interpretation problem. With a grid defined like this:
Without salem or xarray being able to read such a grid I wont be able to build a function to interpolate each pixel of the data to the glacier grid in OGGM.
Would it be possible to integrate this type of grid in Salem?
Could we also add a different calendar?
smb_data = xr.open_dataset(smb_path, decode_times=False)
If I read the MB data I must also add that decode_times = False statement. Since the time units are also not recognise:
smb_data.time.units
'Months since 2018-01-15 00:00:0'
For more information on the data write me on slack. :) I appreciate the help.
Hello @fmaussion,
My problem is that I am trying to open two NetCDF files with this salem function:
data = salem.GeoNetcdf(fpath)
salem.GeoNetcdf()
Both files have a not well define grid:
mask = salem.GeoNetcdf(mask_path)
I then use xarray to open it but I still encounter the grid interpretation problem. With a grid defined like this:
mask = xr.open_dataset(mask_path) mask.grid
Map Projection:Polar Stereographic Ellipsoid - Map Reference Latitude: 90.0 - Map Reference Longitude: -39.0 - Map Second Reference Latitude: 71.0 - Map Eccentricity: 0.081819190843 ;wgs84 - Map Equatorial Radius: 6378137.0 ;wgs84 meters - Grid Map Origin Column: 160 - Grid Map Origin Row: -120 - Grid Map Units per Cell: 5000 - Grid Width: 301 - Grid Height: 561
Without salem or xarray being able to read such a grid I wont be able to build a function to interpolate each pixel of the data to the glacier grid in OGGM. Would it be possible to integrate this type of grid in Salem?
Could we also add a different calendar?
smb_data = xr.open_dataset(smb_path, decode_times=False)
If I read the MB data I must also add that decode_times = False statement. Since the time units are also not recognise:For more information on the data write me on slack. :) I appreciate the help.