Beispiel #1
0
     "The data field (:class:`pygchem.datafields.CTMField`) object, "
     "or None if no data field has been loaded/assigned")
)

_base_required = [p[0] for p in _base_properties if p[0] != 'datafield']


EmissionBase = record_cls(
    "EmissionBase",
    "Base emission field (data and) metadata",
    _base_properties +
    (('species', str, None, False,
      "Emitted chemical species"),
     ('category', int, None, False,
      "Emssion category (fields of the same category will be assembled based "
      "upon hierarchies)"),
     ('hierarchy', int, None, False,
      "Emission hierarchy (higher hierarchy emissions will overwrite lower "
      "hierarchy emissions, if same category)"),
     ('scale_factors', None, (), False,
      "Scale factors and masks (e.g., :class:`EmissionScale` or "
      ":class:`EmissionMask` objects) to be applied to "
      "the base emission field")),
    required_fields=_base_required + ['species', 'category', 'hierarchy']
)


EmissionScale = record_cls(
    "EmissionScale",
    "Emission scale factor (data and) metadata",
    _base_properties +
    (('operator', str, '*', False,
Beispiel #2
0
"""

import os

from pygchem import config
from pygchem.io import diaginfo
from pygchem.utils.data_structures import record_cls, RecordList
from pygchem.utils.exceptions import NotYetImplementedError


CTMCategory = record_cls(
    "CTMCategory",
    "A category for CTM diagnostics, as stored in diaginfo.dat",
    (('offset', int, 0, True, 'Offset (constant to add to tracer numbers '
                              'in order to distinguish for the given diagnostic'
                              ' category, as stored in file tracerinfo.dat)'),
     ('name', str, None, True, 'Name of the category'),
     ('description', str, '', True, 'Descriptive comment')),
    required_fields=('offset', 'name')
)


CTMDiagnostic = record_cls(
    "CTMDiagnostic",
    "A CTM diagnostic, as stored in tracerinfo.dat",
    (('number', int, None, True, 'Diagnostic number'),
     ('name', str, None, True, 'Name of the CTM diagnostic (tracer)'),
     ('full_name', str, '', True, 'Long name of the diagnostic'),
     ('unit', str, 'unitless', True, 'Diagnostic unit'),
     ('scale', float, 1., True, 'Standard scale factor to convert values to '
                                'the diagnostic\'s unit'),