You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thanks @aadm I'm not sure if this can be fixed but I'll have a look. An alternative option for us that is probably simpler is to allow fill_cdpna() to be run during the conversion process, and then it would be implicit in the NetCDF4 file. It is a little frustrating that it is not super easy to modify parts of NetCDF4 on disk.
One option I might get you to try. Is open the file without using dask ('this won't load it straight away'). Run fill_cdpna() and then use the to_netcdf() method with mode='a' to append modified variables. Then try your cropping operation using dask.
So your example would be:
cube = open_seisnc(local_data+'cube.seisnc')
cube.seis.fill_cdpna()
cube.seis.to_netcdf(local_data+'cube.seisnc', mode='a') # Note this will modify the file so you might want to back it up as a test.
cube = open_seisnc(local_data+'cube.seisnc', chunks={'xline': 100, 'iline': 100})
cube = cube.sel(twt=slice(3800,5500))
cube.seisio.to_netcdf('cube_crop.seisnc')
With an input data read from netcdf via dask, applying
fill_cdpna()
causes an error when writing back the file to netcdf.One solution is to 'realize' the data and then outputting to disk, e.g.:
But this is not applicable if the data size is very large (it would crash simply because there is not enough ram to hold the data in memory).
Example:
Resulting error log copied from jupyter console:
The text was updated successfully, but these errors were encountered: