-
Notifications
You must be signed in to change notification settings - Fork 2
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
regional masks not supported? #20
Comments
Hey @dylanschlichting! Thanks for using Yes, So, all you'd need to change is the reading in of the dataset bloc of code to be something like: #GoM regional mask
pathm = '/usr/projects/climate/dschlichting/repos/analysis_notebooks/gom1pt5/gom1pt5_gom_mask.nc'
mask = xr.open_dataset(pathm)
iGoM = mask.regionCellMasks[:, 0] == 1
# indices of cells within regional mask
idxGoM = mask.nCells.where(iGoM, drop=True).astype(int)
#HF output
path = '/lustre/scratch5/dschlichting/E3SM/scratch/chicoma-cpu/Tl319_GoM1pt5_GMPAS-IAF_norivers/run/Tl319_GoM1pt5_GMPAS-IAF.mpaso.hist.am.highFrequencyOutput.1997-0*-01_00.00.00.nc'
ds = xr.open_mfdataset(glob.glob(path), concat_dim="Time", combine = 'nested')
ds = ds.sortby(ds.xtime)
ds = ds.isel(nCells = idxGoM)
ds
#Initial condition
pathi = '/lustre/scratch5/dschlichting/runs/gom1pt5r2/ocean/global_ocean/GoM5/WOA23/init/initial_state/initial_state.nc'
dsi = xr.open_dataset(pathi)
dsi = dsi.isel(nCells = idxGoM) where I've moved the reading in of the mask to the top, and added one final step where the region mask gets converted to an index array of cells within the region ( Then the mosaic block you have above should pretty much work as expected, all you'd need to do is remove the masking of data array in the call to ...
m1 = mosaic.polypcolor(ax, descriptor, rv.isel(Time=t),
antialiaseds=False, cmap = cmo.balance, vmin = -1, vmax = 1)
... |
Thanks for bringing this up! While
|
Here are some existing region masks: |
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
I've been working on adding a regional mask for a Gulf of Mexico RRM to do some statistical analysis. My goal is to plot the masked output with mosaic as a QC check, which fails. See below a successful example with
ax.scatter
using normalized vorticity compared to mosaic. Does this capability need to be added to the code, or is this user error? One reason this capability would be useful is thatax.scatter
is much slower and the user has to carefully prescribe the dot size and dpi, which often takes a few iterations to get right. As a result, the boundaries of the masked data aren't always clear with a scatter plot.Preliminaries:
The contents of the mask file look like:
Working example with scatter:
Plot with mosaic
The text was updated successfully, but these errors were encountered: