epygram.config — Configuration: parameters, options

The module is used throughout the package to share constant parameters.

The standard default parameters lie below. They can be overwritten by the user in the User config file userconfigfile.


epygram.config.installdir = '/home/mary/EPyGrAM/src/epygram'

Directory of epygram package install

epygram.config.usercustomizationdir = '/home/mary/.epygram'

User customization directory

epygram.config.userconfigfile = '/home/mary/.epygram/userconfig.py'

User config (overwrites standard config)

epygram.config.epygram_colormaps = {'rr6h': '/home/mary/EPyGrAM/src/epygram/data/rr24h.cmap', 'rr24h': '/home/mary/EPyGrAM/src/epygram/data/rr24h.cmap', 'gaspect': '/home/mary/EPyGrAM/src/epygram/data/gaspect.cmap', 'radar': '/home/mary/EPyGrAM/src/epygram/data/radar.cmap', 'aspect': '/home/mary/EPyGrAM/src/epygram/data/aspect.cmap', 'rr1h': '/home/mary/EPyGrAM/src/epygram/data/rr1h.cmap'}

epygram Colormaps


epygram.config.g0 = 9.80665

gravity constant

epygram.config.Cpd = 1004.709

Cp dry air

epygram.config.Rd = 287.059

Specific gas constant, dry air

epygram.config.Rv = 461.524

Specific gas constant, water vapor

epygram.config.default_Ptop = 0.0

Ptop: pressure @ summit of atmosphere. For vertical coordinates conversions.

epygram.config.epsilon = 2.220446049250313e-16


epygram.config.KNUMMAXRESOL = 10

Maximum number of truncations handled (setup spectral transforms)

epygram.config.plotsizes = (16.0, 12.0)

Plots sizes (in inches)

epygram.config.noninteractive_backend = False

Interactive graphical backend. If False, X11 is the graphical device. Non-interactive backends such as ‘Agg’ can be used, especially without export DISPLAY

epygram.config.default_graphical_output = False

Default output for apptools

Formats Specifications

epygram.config.implemented_formats = ['netCDF', 'GRIB', 'GeoPoints', 'TIFFMF', 'FA', 'LFI', 'DDHLFA', 'LFA']

List of implemented/activated formats for the formats_factory, the list is ordered by specificity for those of the same family (e.g. FA before LFI, DDHLFA before LFA...) Removing one of these (in userconfig file) may allow an incomplete install of epygram, disabling one format.


epygram.config.FA_default_compression = {'KNGRIB': 2, 'KDMOPL': 0, 'KPUILA': 0, 'KSTRON': 0, 'KNBPDG': 16, 'KNBCSP': 16}

FA default compression parameters

epygram.config.FA_default_reference_pressure = 101325.0

Default reference pressure coefficient for converting hybrid A coefficients in FA

epygram.config.FA_geoid_for_pyproj = {'a': 6371229.0, 'b': 6371229.0}

geoid of FA files in pyproj syntax

epygram.config.FA_field_dictionaries_csv = {'default': '/home/mary/EPyGrAM/src/epygram/data/Field_Dict_FA.csv', 'user': '/home/mary/.epygram/user_Field_Dict_FA.csv'}

FA field dictionaries

epygram.config.FA_fandax = True

FA (write) date & time precision: use FANDAR (minute) or FANDAX (second, cy40t1 onwards)

epygram.config.FA_buffered_gauss_grid = True

To avoid re-computing lons/lats of Gauss Grids from FA each time needed: makes ARPEGE profiles and section extraction times acceptable (< 1min).


epygram.config.LFA_max_num_fields = 1000

LFA maximum number of fields

epygram.config.LFA_maxstrlen = 200

LFA maximum length of strings (as in most LFA useage)


epygram.config.GeoPoints_lonlat_precision = 4

GeoPoints write precision for lon/lat

epygram.config.GeoPoints_precision = 6

GeoPoints write precision for other floats

epygram.config.GeoPoints_col_width = 12

GeoPoints write width of columns


epygram.config.GRIB_default_edition = 2

GRIB default edition (1 or 2)

epygram.config.GRIB_default_tablesVersion = 14

GRIB_default tablesVersion

epygram.config.GRIB_default_sample = {1: 'GRIB1_second_order', 2: 'GRIB2_second_order'}

GRIB default sample (possibility to use others)

epygram.config.GRIB_default_production_parameters = {'generatingProcessIdentifier': 254, 'productionStatusOfProcessedData': 2, 'typeOfGeneratingProcess': 2, 'typeOfProcessedData': 2, 'centre': 85}

GRIB default production parameters – write mode

epygram.config.GRIB_default_ordering = {'iScansNegatively': 0, 'jPointsAreConsecutive': 0, 'jScansPositively': 0}

GRIB default ordering of data

epygram.config.GRIB_default_packing = {1: {'bitsPerValue': 16, 'boustrophedonicOrdering': 1, 'packingType': 'grid_second_order'}, 2: {'bitsPerValue': 12, 'packingType': 'grid_second_order'}}

GRIB default packing – write mode. recommended packing types for GRIB2: (by increasing packing efficiency // decreasing speed performance) - grid_jpeg (15% // 100%) - grid_second_order (19% // 42%) - grid_simple (38% // 22%) - grid_ieee (100% // 12%)

epygram.config.GRIB_samples_path = '/home/mary/EPyGrAM/src/epygram/data'

GRIB samples from epygram

epygram.config.satellites_local_GRIB2 = {'GOES12': 196, 'GOES11': 195, 'MTSAT1': 197, 'METEOSAT9': 194, 'METEOSAT8': 193, 'METEOSAT7': 192}

satellites local GRIB2 encoding

epygram.config.sensors_local_GRIB2 = {'MVIRI': 192, 'IMAGER': 194, 'SEVIRI': 193}

dict() -> new empty dictionary dict(mapping) -> new dictionary initialized from a mapping object’s

(key, value) pairs
dict(iterable) -> new dictionary initialized as if via:

d = {} for k, v in iterable:

d[k] = v
dict(**kwargs) -> new dictionary initialized with the name=value pairs
in the keyword argument list. For example: dict(one=1, two=2)


epygram.config.LFI_field_dictionaries_csv = {'default': '/home/mary/EPyGrAM/src/epygram/data/Field_Dict_LFI.csv', 'user': '/home/mary/.epygram/Field_Dict_LFI.csv'}

LFI field dictionaries

epygram.config.LFI_geoid_for_pyproj = {'a': 6371229.0, 'b': 6371229.0}

geoid of LFI files in pyproj syntax


epygram.config.netCDF_default_behaviour = {'H2D_dimensions_names': ('X', 'Y'), 'flatten_non_rectangular_grids': True, 'variable_name_for_longitudes': 'lons', 'variable_name_for_validity': 'time', 'transpose_data_ordering': False, 'variable_name_for_latitudes': 'lats'}

netCDF default behaviour


epygram.config.default_projtool = 'pyproj'

Use home-made projection formulas (epygram.myproj) vs of pyproj.

epygram.config.myproj_default_geoid = {'geoidradius': 6371229.0, 'geoidshape': 'sphere'}

arpifs geoid for epygram.myproj

epygram.config.pyproj_default_geoid = {'ellps': 'WGS84'}

A classical default geoid for pyproj

epygram.config.protect_unhappy_writes = False

Protect unhappy writes: ask before opening a new file on an existing path

epygram.config.mask_outside = 1e+19

Threshold on field absolute values to mask meaningless field values

epygram.config.hide_footprints_warnings = True

To hide footprints warnings...

epygram.config.prevent_swapping_legendre = 0.75

To raise an error if the memory needed for Legendre transforms exceeds this percentage of the available memory.

epygram.config.use_footprints_as_builder = False

Use footprints.proxy builder to generate a field. Defaults to False for performance reasons, but less flexible.

epygram.config.vector_symbol = 'barbs'

Vector graphical symbol

epygram.config.default_figures_dpi = 150

Default quality for figures

epygram.config.spectral_coeff_order = 'model'

ordering of spectral coefficients, with regards to arpifs spaces: ‘model’ or ‘FA’. => ‘model’: read/write by wfacilo/wfaieno,

‘FA’: read/write by wfacile/wfaienc

User modules

epygram.config.usermodules = []

In userconfig, this should be a list of dict containing two keys: the module name and the source absolute path; e.g. {‘name’:’mymodule’, ‘abspath’:’/home/.../mymodule.py’}.

The import is done in epygram __init__.py.

User colormaps

epygram.config.usercolormaps = {}

In userconfig, this should be a dict whose keys are the colormap name and values the source absolute path of the colormap definition; e.g. {‘aspect’, ‘/home/mary/.epygram/aspect.cmap’}.

epygram.config.colormaps = {'radar': '/home/mary/EPyGrAM/src/epygram/data/radar.cmap', 'rr6h': '/home/mary/EPyGrAM/src/epygram/data/rr24h.cmap', 'aspect': '/home/mary/EPyGrAM/src/epygram/data/aspect.cmap', 'rr24h': '/home/mary/EPyGrAM/src/epygram/data/rr24h.cmap', 'rr1h': '/home/mary/EPyGrAM/src/epygram/data/rr1h.cmap', 'gaspect': '/home/mary/EPyGrAM/src/epygram/data/gaspect.cmap'}

colormaps gathers epygram and user colormaps