Ancillary file modification

Editing land sea masks

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

% module use ~access/modules
% module load iris
% python ~access/apps/pythonlib/umfile_utils/ -h
usage: [-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)

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 ( 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 ("zoom rect" is displayed in bottom RH corner of the window). When done, simply close the window and a list of changed points will be created. For sample output for adding Fiji to N512 see

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 (​ 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).

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 anything larger than an ACCESS-C scale region.

Note that this also works with rotated and variable grids.

Example view showing several points altered at Kangaroo Island in the APS2 AD domain. Boxes changed from land to ocean are dark blue and boxes changed from ocean to land are dark green.

Output in this case is

Number of points changed 4
Last modified 5 years ago Last modified on Nov 9, 2016 4:08:56 PM

Attachments (1)

Download all attachments as: .zip