gcpy.examples.hemco.make_mask_file

Create a mask file (for emissions) from a netCDF file of country IDs.

Download this file before using: https://gcgrid.s3.amazonaws.com/HEMCO/MASKS/v2014-07/countrymask_0.1x0.1.nc

Command-line arguments

[-i <filein>]

File of country IDs (download from link above). Default value: countrymask_0.1x0.1.nc

-o <fileout>

Output file for the mask.

-c <country_id>

ID of your desired country. Use a netcdf file viewer to determine this value.

[-m <true|false>]

Create a mirrored (i.e. inverted) mask. Default value: False

Examples

Create a mask for Canada.

$ conda activate gcpy_env
(gcpy_env) $ python -m gcpy.examples.hemco.make_mask_file \
             -o Canada_Mask.01x01.nc                      \
             -c 124

Create a mirrored mask for Mexico.

$ conda activate gcpy_env
(gcpy_env) $ python -m gcpy.examples.hemco.make_mask_file \
             -o Mexico_Mask_Mirror.01x01.nc               \
             -c 484                                       \
             -m true

Functions

make_mask(filein, country_id, fileout[, mirror])

Creates a netCDF mask file for a given country.

gcpy.examples.hemco.make_mask_file.make_mask(filein, country_id, fileout, mirror=False)[source]

Creates a netCDF mask file for a given country.

Parameters:
  • filein (str) – File with country ID values.

  • country_id (int) – ID of the country that you want masked.

  • fileout (str) – Output mask file.

  • mirror (bool, optional) – Return a mirrored (i.e. inverted) mask. Default value: False.