gen vx mask #2128
-
Hi There, This question is similar to #1463 , but a little different. I am also using python embedding. I would like to create standalone masks for land, ocean, and sea ice based on the following mask.JPG, with land=1, ocean=0, and sea ice=2. I able to create a land.nc mask using the following: gen_vx_mask PYTHON_NUMPY PYTHON_NUMPY land.nc -type data -input_field 'name="readdata.py -f data.hdf5 -l 10 -lt model_level -v sea_land_ice_mask";' -mask_field 'name="readdata.py -f data.hdf5 -l 10 -lt model_level -v sea_land_ice_mask";' -thresh eq1 intersection I am also able to create a sea ice mask with the same logic, except thresh eq 2 is used: gen_vx_mask PYTHON_NUMPY PYTHON_NUMPY ice.nc -type data -input_field 'name="readdata.py -f data.hdf5 -l 10 -lt model_level -v sea_land_ice_mask";' -mask_field 'name="readdata.py -f data.hdf5 -l 10 -lt model_level -v sea_land_ice_mask";' -thresh eq2 -intersection However, I am not able to create an ocean mask using thresh eq0: gen_vx_mask PYTHON_NUMPY PYTHON_NUMPY sea.nc -type data -input_field 'name="readdata.py -f data.hdf5 -l 10 -lt model_level -v sea_land_ice_mask";' -mask_field 'name="readdata.py -f data.hdf5 -l 10 -lt model_level -v sea_land_ice_mask";' -thresh eq0 -intersection I've tried other combinations too. For example, using my new land.nc as input and the mask field as follows: gen_vx_mask land.nc land.nc sea.nc -type data -mask_field 'name="data_mask"; level="(,)";' -thresh eq1 -complement This and the previous command gives a raster with all grid cells equal to 1 as follows: I think I'm just misunderstanding some aspect of the gen_vx_mask command. Any assistance would be much appreciated. Thanks, |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 6 replies
-
Hello Matt, I see that you'd like to run Gen-Vx-Mask 3 times to create 3 different stand-alone masks. I think that the commands you're running are slightly more complicated than they need to be. Gen-Vx-Mask has 4 required arguments:
The
If Or if you would like to purse the "double python embedding" approach you're using for other reasons, I'm happy to debug further. I'd just need the Thanks, |
Beta Was this translation helpful? Give feedback.
Hi John,
Specifying the global attribute in a CF-complaint way, i.e., ":Conventions = "CF-1.6" ;" worked. I can generate an independent mask for land, ocean, and ice now with netcdf.
In addition, I resolved my python embedding issue. The input_grid and mask_grid are the same, but input_field and mask_field must be different. For example, the following now works for water.
gen_vx_mask PYTHON_NUMPY PYTHON_NUMPY ocean.nc -type data -input_field 'name="readdata.py -f data.hdf5 -l 10 -lt model_level -v zonal_wind_at_10m";' -mask_field 'name="readdata.py -f data.hdf5 -l 10 -lt model_level -v sea_land_ice_mask";' -thresh eq0
Previously, my logic with embedding was the same except my input_field …