Contains the class that handle a Horizontal 2D field.
Bases: epygram.base.Field
3-Dimensions common field class.
Footprint:
dict(
attr = dict(
comment = dict(
access = 'rwd',
alias = set([]),
default = None,
optional = True,
outcast = set([]),
remap = dict(),
type = str,
values = set([]),
),
data = dict(
access = 'rxx',
alias = set([]),
default = None,
optional = True,
outcast = set([]),
remap = dict(),
values = set([]),
),
fid = dict(
access = 'rwx',
alias = set([]),
default = None,
optional = False,
outcast = set([]),
remap = dict(),
type = footprints.stdtypes.FPDict,
values = set([]),
),
structure = dict(
access = 'rxx',
alias = set([]),
default = None,
info = 'Type of Field geometry.',
optional = False,
outcast = set([]),
remap = dict(),
values = set(['3D']),
),
),
bind = [],
info = 'Not documented',
only = dict(),
priority = dict(
level = footprints.priorities.PriorityLevel::DEFAULT,
),
)
Export values as a list of dicts. - subzone: defines the LAM subzone to be included, in LAM case,
among: ‘C’, ‘CI’.
Export values as a dict of lists (in fact numpy arrays). - order: whether to flatten arrays in ‘C’ (row-major) or
‘F’ (Fortran, column-major) order.
among: ‘C’, ‘CI’.
Export values as a fieldset of points. - subzone: defines the LAM subzone to be included, in LAM case,
among: ‘C’, ‘CI’.
Export values as a fieldset of profiles. - subzone: defines the LAM subzone to be included, in LAM case,
among: ‘C’, ‘CI’.
Returns the DCT spectrum of the field, as a epygram.spectra.Spectrum instance. k is the level index to use to compute de DCT
Extracts a subdomain from a field, given a new geometry.
Args:
geometry defines the geometry on which extract data
interpolation defines the interpolation function used to compute the profile at requested lon/lat from the fields grid: - if ‘nearest’ (default), extracts profile at the horizontal nearest
neighboring gridpoint;
external_distance can be a dict containing the target point value and an external field on the same grid as self, to which the distance is computed within the 4 horizontally nearest points; e.g. {‘target_value’:4810, ‘external_field’:an_H2DField_with_same_geometry}. If so, the nearest point is selected with distance = |target_value - external_field.data|
exclude_extralevels if True levels with no physical meaning are suppressed.
Returns the value of the field on point of coordinates (lon, lat, level):
level is the True level not the index of the level. Depending on the vertical coordinate, it could be expressed in Pa, m. validity is a FieldValidity or a FieldValidityList instance
If neighborinfo is set to True, returns a tuple (value, (lon, lat)), with (lon, lat) being the actual coordinates of the neighboring gridpoint (only for interpolation == ‘nearest’).
lon and lat may be longer than 1. If one is False and len(lon) is 1, returns [value] instead of value.
external_distance can be a dict containing the target point value and an external field on the same grid as self, to which the distance is computed within the 4 horizontally nearest points; e.g. {‘target_value’:4810, ‘external_field’:an_H2DField_with_same_geometry}. If so, the nearest point is selected with distance = |target_value - external_field.data|
Warning: for interpolation on Gauss geometries, requires the pyproj module.
For global RegLLGeometry grids only ! Shifts the center of the geometry (and the data accordingly) by longitude_shift (in degrees). longitude_shift has to be a multiple of the grid’s resolution in longitude.
Returns the number of non-zero values (whose absolute value > config.epsilon).
Computes some basic statistics on the field, as a dict containing: {‘min’, ‘max’, ‘mean’, ‘std’, ‘quadmean’, ‘nonzero’}.
See each of these methods for details.
subzone: optional, among (‘C’, ‘CI’), for LAM fields only, plots the data resp. on the C or C+I zone.
Default is no subzone, i.e. the whole field.
Writes in file a summary of the field.
Args:
Bases: epygram.fields.D3Field.D3CommonField
3-Dimensions field class. A field is defined by its identifier ‘fid’, its data, its geometry (gridpoint and optionally spectral), and its validity.
The natural being of a field is gridpoint, so that: a field always has a gridpoint geometry, but it has a spectral geometry only in case it is spectral.
Footprint:
dict(
attr = dict(
comment = dict(
access = 'rwd',
alias = set([]),
default = None,
optional = True,
outcast = set([]),
remap = dict(),
type = str,
values = set([]),
),
data = dict(
access = 'rxx',
alias = set([]),
default = None,
optional = True,
outcast = set([]),
remap = dict(),
values = set([]),
),
fid = dict(
access = 'rwx',
alias = set([]),
default = None,
optional = False,
outcast = set([]),
remap = dict(),
type = footprints.stdtypes.FPDict,
values = set([]),
),
geometry = dict(
access = 'rxx',
alias = set([]),
default = None,
info = 'Geometry defining the position of the field gridpoints.',
optional = False,
outcast = set([]),
remap = dict(),
type = epygram.geometries.D3Geometry.D3Geometry,
values = set([]),
),
processtype = dict(
access = 'rxx',
alias = set([]),
default = None,
info = 'Generating process.',
optional = True,
outcast = set([]),
remap = dict(),
values = set([]),
),
spectral_geometry = dict(
access = 'rxx',
alias = set([]),
default = None,
info = 'For a spectral field, its spectral geometry handles spectral transforms and dimensions.',
optional = True,
outcast = set([]),
remap = dict(),
type = epygram.geometries.SpectralGeometry.SpectralGeometry,
values = set([]),
),
structure = dict(
access = 'rxx',
alias = set([]),
default = None,
info = 'Type of Field geometry.',
optional = False,
outcast = set([]),
remap = dict(),
values = set(['3D']),
),
validity = dict(
access = 'rwx',
alias = set([]),
default = epygram.base.FieldValidityList::<<
as_list:: [epygram.base.FieldValidity::<epygram.base.FieldValidity object at 0x7f7afd5844d0>]
>>,
info = 'Validity of the field.',
optional = True,
outcast = set([]),
remap = dict(),
type = epygram.base.FieldValidityList,
values = set([]),
),
),
bind = [],
info = 'Not documented',
only = dict(),
priority = dict(
level = footprints.priorities.PriorityLevel::DEFAULT,
),
)
Compute the derivatives of field in spectral space, then come back in gridpoint space Returns the two derivative fields.
The spectral transform and derivatives subroutines are actually included in the spectral geometry’s compute_xy_spderivatives() method.
Returns the field data, with 3D shape if the field is not spectral, 2D if spectral.
subzone: optional, among (‘C’, ‘CI’), for LAM fields only, returns the data resp. on the C or C+I zone. Default is no subzone, i.e. the whole field.
if False, shape of returned values is determined with respect to geometry
Shape of 3D data:
Rectangular grids:
grid[k,0,0] is SW, grid[k,-1,-1] is NE
grid[k,0,-1] is SE, grid[k,-1,0] is NW
with k the level
Gauss grids:
grid[k,0,:Nj] is first (Northern) band of latitude, masked after Nj = number of longitudes for latitude j
grid[k,-1,:Nj] is last (Southern) band of latitude (idem).
with k the level
Returns a level of the field as a new field. level is the requested level expressed in coordinate value (Pa, m...) k is the index of the requested level
Returns the value of the field on point of indices (i, j, k, t). Take care (i, j, k, t) is python-indexing, ranging from 0 to dimension - 1. k is the index of the level (not a value in Pa or m...) t is the index of the temporal dimension (not a validity object) k and t can be scalar even if i and j are arrays.
If one is False, returns [value] instead of value.
Transforms the gridpoint field into spectral space, according to the spectral geometry mandatorily passed as argument. Replaces data in place.
The spectral transform subroutine is actually included in the spectral geometry’s gp2sp() method.
Bases: epygram.fields.D3Field.D3CommonField
3-Dimensions Virtual field class.
Data is taken from other fields, either: - a given fieldset - a resource in which are stored fields defined by resource_fids.
Footprint:
dict(
attr = dict(
comment = dict(
access = 'rwd',
alias = set([]),
default = None,
optional = True,
outcast = set([]),
remap = dict(),
type = str,
values = set([]),
),
data = dict(
access = 'rxx',
alias = set([]),
default = None,
optional = True,
outcast = set([]),
remap = dict(),
values = set([]),
),
fid = dict(
access = 'rwx',
alias = set([]),
default = None,
optional = False,
outcast = set([]),
remap = dict(),
type = footprints.stdtypes.FPDict,
values = set([]),
),
fieldset = dict(
access = 'rxx',
alias = set([]),
default = epygram.base.FieldSet::<<
as_list:: []
>>,
info = 'Set of real fields that can compose the Virtual Field.',
optional = True,
outcast = set([]),
remap = dict(),
type = epygram.base.FieldSet,
values = set([]),
),
resource = dict(
access = 'rxx',
alias = set([]),
default = None,
info = 'Resource in which is stored the fields defined by resource_fids.',
optional = True,
outcast = set([]),
remap = dict(),
type = epygram.base.Resource,
values = set([]),
),
resource_fids = dict(
access = 'rxx',
alias = set([]),
default = footprints.stdtypes.FPList::<<
as_list:: []
>>,
info = 'Definition of the fields in resource that compose the virtual field.',
optional = True,
outcast = set([]),
remap = dict(),
type = footprints.stdtypes.FPList,
values = set([]),
),
structure = dict(
access = 'rxx',
alias = set([]),
default = None,
info = 'Type of Field geometry.',
optional = False,
outcast = set([]),
remap = dict(),
values = set(['3D']),
),
),
bind = [],
info = 'Not documented',
only = dict(),
priority = dict(
level = footprints.priorities.PriorityLevel::DEFAULT,
),
)
Returns the field data, with 3D shape if the field is not spectral, 2D if spectral.
subzone: optional, among (‘C’, ‘CI’), for LAM fields only, returns the data resp. on the C or C+I zone. Default is no subzone, i.e. the whole field.
if False, shape of returned values is determined with respect to geometry
Shape of 3D data:
Rectangular grids:
grid[k,0,0] is SW, grid[k,-1,-1] is NE
grid[k,0,-1] is SE, grid[k,-1,0] is NW
with k the level
Gauss grids:
grid[k,0,:Nj] is first (Northern) band of latitude, masked after Nj = number of longitudes for latitude j
grid[k,-1,:Nj] is last (Southern) band of latitude (idem).
with k the level
Returns a level of the field as a new field. level is the requested level expressed in coordinate value (Pa, m...) k is the index of the requested level
Returns the value of the field on point of indices (i, j, k, t). Take care (i, j, k, t) is python-indexing, ranging from 0 to dimension - 1. k is the index of the level (not a value in Pa or m...) t is the index of the temporal dimension (not a validity object) k and t can be scalar even if i and j are arrays.
If one is False, returns [value] instead of value.