wiki:access/AncillaryFileModification

Version 4 (modified by Martin Dix, 3 years ago) (diff)

--

Ancillary file modification

Editing land sea masks

~access/apps/pythonlib/umfile_utils/mask_edit.py is a GUI editor for land sea masks. To use it on raijin

% module use ~access/modules
% module load iris
% python ~access/apps/pythonlib/mask_edit.py -h
usage: mask_edit.py [-h] [-v] [-m {a,l,m,h}] [-o OUTFILE] [maskfile]

Interactvely edit a UM land-sea mask

positional arguments:
  maskfile       Input mask file (default qrparm.mask)

optional arguments:
  -h, --help     show this help message and exit
  -v, --verbose  verbose output
  -m {a,l,m,h}   Map resolution
  -o OUTFILE     Output file for corrections (default is standard out)

 -i maskfile [-m mapres] [-o output file]

Map resolution can be a (GA Australian), l (global low res), m (global medium res) or h (global high res). The output is a list of changed points that can be used by the Central Ancillary Program when regenerating a mask. The mask file itself is not changed. All the other ancillaries will have to be regenerated with the new mask anyway and the list of changed points is more convenient for keeping under version control.

The program displays a matplotlib window which can be panned and zoomed using the normal controls (http://matplotlib.org/users/navigation_toolbar.html). Note that the lat/lon grid and labels doesn't get always get cleared properly so may look a little odd, particularly if you go back to a previous view.

Clicking on the map will flip the status of a grid box. A changed box will be shown as slightly darker than the original land or ocean. Undo by clicking again to flip it back. If nothing happens, you've probably still got the zoom tool selected. When done, simply close the window and a list of changed points will be created. For sample output for adding Fiji to N512 see https://accessdev.nci.org.au/trac/ticket/165#comment:3.

The land sea mask is calculated from the IGBP 1 km land cover dataset. This has navigation problems and may be up to a couple of km off in some regions (and the offset varies geographically). There are also problems with the GSHHS coastline dataset (​http://www.ngdc.noaa.gov/mgg/shorelines/gshhs.html) that iris and basemap use. This also has errors of up to 1 km around Australia (not simply a datum error because it isn't consistent). https://accessdev.nci.org.au/trac/wiki/access/IrisExamples#Usingalternatecoastlines.

For very high resolution Australian grids you should use the -m a option which uses the GA coastline data. Note that this may be very slow on anythng larger than an ACCESS-C scale region.

Attachments (1)

Download all attachments as: .zip