Many Unidata McIDAS users have asked if it is possible to clip contours of gridded fields at land-water boundaries. The ability to do this is particularly desired for gridded renditions of point source measurements due to the paucity of observations over water. If one has an image data set from which the land-water boundaries can be readily discerned, then this data set can be used to select values from one image that lie exclusively over land or sea for inclusion in a new image product.
IMGFILT generates a new image by applying a filter mask to data from an existing image or images. IMGFILT is routinely used to clean up images by applying a shot noise filter to each element and is frequently used to identify cloudy regions by comparing colocated image values from different spectral channels.
All images used in the filtering process must have the same projection, resolution and navigation. You can use the IMGCOPY or IMGREMAP before using IMGFILT.
This copies the first 1000 mb Temperature grid found in the RTGRIBS/NAM-ALL data set to the local MYDATA/GRIDS data set in position 132. The gridded field being copied will be put into the first slot in the output dataset position by virtue of the DGRID=1 keyword specification.
Since we defined MYDATA/GRIDS to include all possible GRID data files, position 132 will correspond to the file GRID0132 which, if it does not already exist, will be created in your current McIDAS working directory.
If the grid was copied successfully, you will see a listing something like:
GRDLIST MYDATA/GRIDS.132 Dataset position 132 Directory Title= PAR LEVEL DAY TIME SRC FHOUR FDAY FTIME GRID PRO ---- --------- ------------ -------- ---- ----- ------------ -------- ----- ---- T 1000 MB 19 AUG 01231 00:00:00 NAM 0 19 AUG 01231 00:00:00 1 LAMB Number of grids listed = 1 GRDLIST - done
We were able to refer to the image that was created in AREA file AREA3020 as MYDATA/IMAGES.3020 by virtue of having defined the MYDATA/IMAGES data set to include all images in AREA file format.
Note that the image representation of the gridded field extends well beyond the coastal boundaries depicted by the map that was drawn. Our next objective is to create a new image that excludes the data portions that extend over water.
We will use this copy to create a filter mask.
We remap the topography data into the image copy since the topography data essentially has the descrimination between land and water that we seek (the land having a greater elevation than water).
The process of creating a land-water clipped image representation of a grid can be automated. We have created a McBASI script - CFILLCLP.MCB which can be used to create a clipped or non-clipped representation from any gridded data field located in accessible ADDE datasets.