improver.cli.generate_timezone_mask_ancillary module

Script to run GenerateTimezoneMask ancillary generation.

process(cube, *, include_dst=False, time=None, groupings=None)[source]

Generate a timezone mask ancillary.

Create masks for regions of a geographic grid that are on different timezones. The resulting masks can be used to isolate data for specific timezones from a grid of the same shape as the cube used in this plugin to generate the masks.

Parameters
  • cube (iris.cube.Cube) – A cube with the desired grid. If no ‘time’ argument is provided to the CLI, the time on this cube will be used for determining the validity time of the calculated UTC offsets (this is only relevant if daylight savings times are being included).

  • include_dst (bool) – If set, find and use the UTC offset to a grid point including daylight savings.

  • time (str) – A datetime specified in the format YYYYMMDDTHHMMZ at which to calculate the mask (UTC). If daylight savings are not included this will have no impact on the resulting masks.

  • groupings (dict) –

    A dictionary specifying how timezones should be grouped if so desired. This dictionary takes the form:

    {-9: [-12, -6], 0: [-5, 5], 6: [6, 12]}
    

    The keys indicate the UTC offset that should provide the data for a group. The numbers in the lists denote the inclusive limits of the timezones for which that data should be used. This is of use if data is not available at hourly intervals.

Returns

A cube containing timezone masks for each timezone found in the grid within the input cube, grouped into larger areas if so desired. Mask values of 1 indicate that a point is masked out, and values of 0 indicate the point is unmasked.

Return type

iris.cube.Cube