-
Notifications
You must be signed in to change notification settings - Fork 40
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
[Bug]: Assertion Error in create_land_sea_mask() #1154
Comments
It looks like the code is not finding |
@lee1043 Just adding that I've tested this in a fresh environment, still installing my branch 1098_ao_drcdm. I'm seeing the same error. |
I looked around in my miniconda folder and confirmed that miniconda3/envs/pmp_test/share/pmp/navy_land.nc exists and is a valid netcdf file. |
I created a fresh env on my Mac but couldn't reproduce the error.
from pcmdi_metrics.utils import create_target_grid, create_land_sea_mask
grid = create_target_grid(-90, 90, 0, 360, target_grid_resolution="5x5")
mask = create_land_sea_mask(grid)
mask2 = create_land_sea_mask(grid, method='pcmdi') This sample code worked well. I will do some more tests to narrow down. @acordonez is the error occurs when install from your branch only or from main branch too in your env? |
The minimal code in the above comment works well in fresh env on NERSC Perlmutter. I however found the following error from the original example code in the first comment. I think that is maybe because the method="pcmdi" was designed/tested for gloabl data while the data loaded from the code was LOCA2 regional data. import xcdat
from pcmdi_metrics.utils import create_land_sea_mask
f="/global/cfs/projectdirs/m3522/cmip6/LOCA2/GFDL-CM4/0p0625deg/r1i1p1f1/historical/tasmax/tasmax.GFDL-CM4.historical.r1i1p1f1.1950-2014.LOCA_16thdeg_v20220413.nc"
ds=xcdat.open_dataset(f).sel({"time":slice("1981-01-01","1981-01-31")})
# Selecting a smaller amount of data for example
sft = create_land_sea_mask(ds,method="pcmdi")
|
Below code is working for me on my NERSC fresh PMP env, although it still does not address the original issue. import xcdat
from pcmdi_metrics.utils import create_land_sea_mask
f="/global/cfs/projectdirs/m3522/cmip6/LOCA2/GFDL-CM4/0p0625deg/r1i1p1f1/historical/tasmax/tasmax.GFDL-CM4.historical.r1i1p1f1.1950-2014.LOCA_16thdeg_v20220413.nc"
ds=xcdat.open_dataset(f).sel({"time":slice("1981-01-01","1981-01-31")})
ds.lat.attrs['axis'] = 'Y'
ds.lon.attrs['axis'] = 'X'
sft = create_land_sea_mask(ds,method="pcmdi") |
@lee1043 Thanks for looking into this! I'll see what happens if I pip install from the main branch, and try the decision relevant code in a jupyter notebook. |
What happened?
I called create_land_sea_mask() with
method="pcmd"
. This error does not happen when the defaultmethod
is used.What did you expect to happen? Are there are possible answers you came across?
I expected this to return a land/sea mask generated with the pcmdi method.
Minimal Complete Verifiable Example (MVCE)
Relevant log output
Anything else we need to know?
No response
Environment
I am working in a jupyter notebook on NERSC, using the kernel installed from my branch 1098_ao_drcdm
The text was updated successfully, but these errors were encountered: