Skip to content

Freshwater binned by Mouginot (2019) region? #34

Answered by mankoff
mankoff asked this question in Q&A
Discussion options

You must be logged in to vote

Do this using dask. Optionally, add a where clause to limit to discharge near the region (e.g., to exclude Disko Island from the CW region)

import xarray as xr
ds = xr.open_dataset('/home/kdm/data/Mankoff_2020/water/ice/MAR.nc',
                     chunks={'time':365, 'station':100})
ds = ds[['M2019_region','discharge']]
ds = ds.groupby('M2019_region')\
       .sum()

delayed_obj = ds.to_netcdf('tmp/MAR.nc', compute=False)
from dask.diagnostics import ProgressBar
with ProgressBar():
    results = delayed_obj.compute()

Replies: 1 comment

Comment options

mankoff
Jan 28, 2023
Maintainer Author

You must be logged in to vote
0 replies
Answer selected by mankoff
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant