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.


Installation

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

Directory of epygram package install

epygram.config.userlocaldir = u'/home/mary/.epygram'

User customization directory

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

User config (overwrites standard config)

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

epygram Colormaps

epygram.config.epygram_colormaps_scaling = {u'radar': [0.0, 0.1, 1.0, 3.0, 5.0, 7.0, 10.0, 15.0, 20.0, 30.0, 50.0, 70.0, 100.0, 150.0, 300.0], u'rr6h': [0.0, 0.2, 0.5, 1, 1.5, 2.0, 4.0, 10.0, 25.0, 50.0, 100.0, 300.0], u'rr1h': [0.0, 0.2, 0.5, 1, 1.5, 2.0, 4.0, 10.0, 25.0, 50.0, 100.0, 300.0], u'rr24h': [0.0, 0.2, 1.0, 2.0, 4.0, 10.0, 25.0, 50.0, 100.0, 150.0, 200.0, 300.0, 500.0]}

epygram colormaps scalings


Parameters

epygram.config.default_Ptop = 0.0

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

epygram.config.epsilon = 1e-11

Epsilon

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 = [u'netCDF', u'GRIB', u'GeoPoints', u'TIFFMF', u'FA', u'LFI', u'DDHLFA', u'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.

FA

epygram.config.FA_default_compression = {u'KNGRIB': 2, u'KDMOPL': 0, u'KPUILA': 0, u'KSTRON': 0, u'KNBPDG': 16, u'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 = {u'a': 6371229.0, u'b': 6371229.0}

geoid of FA files in pyproj syntax

epygram.config.FA_field_dictionaries_csv = {u'default': u'/home/mary/EPyGrAM/src/epygram/data/Field_Dict_FA.csv', u'user': u'/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.FA_allow_MOCAGE_multivalidities = False

Allow MOCAGE fields to have multiple validities in file; in which case the term is decoded from the fid[2:4]

epygram.config.FA_max_encoding = 30

Maximum recommended encoding for FA (KNBPDG)

epygram.config.FA_mute_FA4py = False

Mute messages from FAIPAR in FA4py

LFA

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)

GeoPoints

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

GRIB

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: u'GRIB1_second_order', 2: u'GRIB2_second_order'}

GRIB default sample (possibility to use others)

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

GRIB default production parameters – write mode

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

GRIB default ordering of data

epygram.config.GRIB_default_packing = {1: {u'bitsPerValue': 16, u'packingType': u'grid_second_order'}, 2: {u'bitsPerValue': 12, u'packingType': u'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 = u'/home/mary/EPyGrAM/src/epygram/data'

GRIB samples from epygram

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

satellites local GRIB2 encoding

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

sensors local GRIB2 encoding

epygram.config.GRIB_packing_fatal = True

GRIB: errors while setting packing are fatal

epygram.config.GRIB_ignore_validity_decoding_errors = False

GRIB: ignore errors while trying to decode validity

epygram.config.GRIB_max_bitspervalue = 30

Maximum recommended encoding for GRIB (bitsPerValue)

epygram.config.GRIB_force_bitspervalue = False

Force bitspervalue to GRIB_max_bitspervalue if requested higher

epygram.config.GRIB_safe_indexes = u'/tmp'

Use temporary links to workaround a bug in grib indexes set either a directory to use for that purpose (e.g. /tmp) or False not to use this option

LFI

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

LFI field dictionaries

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

geoid of LFI files in pyproj syntax

netCDF

epygram.config.netCDF_standard_dimensions = [u'N_dimension', u'T_dimension', u'X_dimension', u'Y_dimension', u'Z_dimension']

netCDF standard dimensions

epygram.config.netCDF_usualnames_for_standard_dimensions = {u'N_dimension': (u'N', u'n', u'transect', u'obs', u'profile', u'Number_of_points', u'gridpoints_number'), u'X_dimension': (u'X', u'x', u'xx', u'LON', u'lon', u'Nbre_lon', u'longitude', u'max_lon_number'), u'Y_dimension': (u'Y', u'y', u'yy', u'LAT', u'lat', u'Nbre_lat', u'latitude', u'lat_number'), u'Z_dimension': (u'Z', u'z', u'zz', u'level', u'nlev', u'nlevp1', u'pressure', u'hybrid-pressure', u'height', u'altitude'), u'T_dimension': (u'time', u'T', u't', u'validity', u'time_counter')}

netCDF usual names for standard dimensions

epygram.config.netCDF_usualnames_for_lonlat_grids = {u'Y': [u'LAT', u'lat', u'lats', u'latitude', u'latitudes'], u'X': [u'LON', u'lon', u'lons', u'longitude', u'longitudes']}

netCDF usual names for storing lon, lat grids

epygram.config.netCDF_default_behaviour = {u'write_lonlat_grid': True, u'H1D_is_H2D_unstructured': True, u'reverse_Yaxis': False, u'flatten_horizontal_grids': False}

netCDF default behaviour the behaviour can be updated with specific netCDF_usualnames_for_standard_dimensions, e.g. ‘X_dimension’:’nb_lon’ and eventual according grid, e.g. ‘X_grid’:’longitudes’

epygram.config.netCDF_default_compression = 4

netCDF default compression

epygram.config.netCDF_replace_dot_in_variable_names = u'.'

netCDF, replace dots in variable names by...

epygram.config.netCDF_default_global_attributes = {u'made_with': u'epygram-1.2.15'}

netCDF default standard global attributes

Options

epygram.config.default_projtool = u'pyproj'

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

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

arpifs geoid for epygram.myproj

epygram.config.pyproj_default_geoid = {u'ellps': u'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.footprints_proxy_as_builder = True

Use footprints.proxy builder to generate a field. True: more flexible, False: faster

epygram.config.vector_symbol = u'barbs'

Vector graphical symbol

epygram.config.default_figures_dpi = 150

Default quality for figures

epygram.config.spectral_coeff_order = u'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
epygram.config.init_at_import = True

To call epygram.init_env() automatically at import ! Should not be True if using Vortex !

epygram.config.silent_guess_format = False

hide messages when guessing format True is dangerous, causes troubles in logging

epygram.config.margin_points_within_Czone = 3

Number or margin within C-zone to generate a lonlat-included domain


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.


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.usercolormaps_scaling = {'Accent': [0.0, 0.1, 1.0, 3.0, 5.0, 7.0, 10.0, 15.0, 20.0, 30.0, 50.0, 70.0, 100.0, 150.0, 300.0]}

In userconfig, this should be a dict whose keys are the colormap name and values the bounds of the steps between colors, e.g. cf. epygram_colormaps_scaling

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

colormaps gathers epygram and user colormaps

epygram.config.colormaps_scaling = {u'radar': [0.0, 0.1, 1.0, 3.0, 5.0, 7.0, 10.0, 15.0, 20.0, 30.0, 50.0, 70.0, 100.0, 150.0, 300.0], u'rr6h': [0.0, 0.2, 0.5, 1, 1.5, 2.0, 4.0, 10.0, 25.0, 50.0, 100.0, 300.0], u'rr1h': [0.0, 0.2, 0.5, 1, 1.5, 2.0, 4.0, 10.0, 25.0, 50.0, 100.0, 300.0], 'Accent': [0.0, 0.1, 1.0, 3.0, 5.0, 7.0, 10.0, 15.0, 20.0, 30.0, 50.0, 70.0, 100.0, 150.0, 300.0], u'rr24h': [0.0, 0.2, 1.0, 2.0, 4.0, 10.0, 25.0, 50.0, 100.0, 150.0, 200.0, 300.0, 500.0]}

colormaps_scaling gathers epygram and user colormaps_scaling