epygram.fields.H1DField
— Horizontal 1-D Field class¶
Contains the class that handle a Horizontal 2D field.
-
class
epygram.fields.H1DField.
H1DField
(*args, **kwargs)[source]¶ Bases:
epygram.fields.D3Field.D3Field
Horizontal 1-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.
Note
This class is managed by footprint.
- info: Not documented
- priority: PriorityLevel::DEFAULT (rank=1)
Automatic parameters from the footprint:
- comment (
str
) - rwd - Not documented, sorry.- Optional. Default is None.
- fid (
footprints.stdtypes.FPDict
) - rwx - Not documented, sorry. - geometry (
epygram.geometries.H1DGeometry.H1DGeometry
) - rxx - Geometry defining the position of the field gridpoints. - processtype (
str
) - rxx - Generating process.- Optional. Default is None.
- spectral_geometry (
epygram.geometries.SpectralGeometry.SpectralGeometry
) - rxx - For a spectral field, its spectral geometry handles spectral transforms and dimensions.- Optional. Default is None.
- structure (
str
) - rxx - Type of Field geometry.- Values: set([‘H1D’])
- units (
str
) - rwd - Not documented, sorry.- Optional. Default is ‘’.
- validity (
epygram.base.FieldValidityList
) - rwx - Validity of the field.- Optional. Default is FieldValidityList::<<as_list:: [FieldValidity::<epygram.base.FieldValidity object at 0x7ffa4937dc90>]>>.
Constructor. See its footprint for arguments.
-
epygram.fields.H1DField.
plothorizontalhovmoller
(transect, over=(None, None), fidkey=None, title=None, logscale=False, zoom=None, colorbar=u'vertical', graphicmode=u'colorshades', minmax=None, levelsnumber=21, center_cmap_on_0=False, colormap=u'jet', minmax_in_title=True, contourcolor=u'k', contourwidth=1, contourlabel=True, datefmt=None, showgrid=True, x_is=u'distance', figsize=None, rcparams=None)[source]¶ Makes a simple vertical Hovmöller plot of the field.
Parameters: - transect – being a
epygram.fields.H1DField
- over – any existing figure and/or ax to be used for the plot, given as a tuple (fig, ax), with None for missing objects. fig is the frame of the matplotlib figure, containing eventually several subplots (axes); ax is the matplotlib axes on which the drawing is done. When given (!= None), these objects must be coherent, i.e. ax being one of the fig axes.
- fidkey – type of fid for entitling the plot with fid[fidkey], if title is None; if None, labels with raw fid.
- title – title for the plot.
- logscale – to set Y logarithmic scale
- zoom –
a dict containing optional limits to zoom on the plot.
Syntax: e.g. {‘ymax’:500, ...}.
- colorbar – if False, hide colorbar the plot; else, befines the colorbar orientation, among (‘horizontal’, ‘vertical’). Defaults to ‘vertical’.
- graphicmode – among (‘colorshades’, ‘contourlines’).
- minmax –
defines the min and max values for the plot colorbar.
Syntax: [min, max]. [0.0, max] also works. Default is min/max of the field.
- levelsnumber – number of levels for contours and colorbar.
- center_cmap_on_0 – aligns the colormap center on the value 0.
- colormap – name of the matplotlib colormap to use.
- minmax_in_title – if True and minmax != None, adds min and max values in title
- contourcolor – color or colormap to be used for ‘contourlines’ graphicmode. It can be either a legal html color name, or a colormap name.
- contourwidth – width of contours for ‘contourlines’ graphicmode.
- contourlabel – displays labels on contours.
- datefmt – date format to use, e.g. “%Y-%m-%d %H:%M:%S %Z”
- showgrid – True/False to show grid or not
- x_is – abscissa to be among: - ‘distance’: distance from first point of transect - ‘lon’: longitude of points - ‘lat’: latitude of points
- figsize – figure sizes in inches, e.g. (5, 8.5). Default figsize is config.plotsizes.
- rcparams – list of (*args, **kwargs) to be passed to pyplot.rc() defaults to [((‘font’,), dict(family=’serif’)),]
Warning: requires matplotlib.
- transect – being a
-
epygram.fields.H1DField.
plottransects
(transects, over=(None, None), labels=None, fidkey=None, unit=u'SI', title=None, logscale=False, zoom=None, x_is=u'distance', figsize=None, rcparams=None)[source]¶ To plot a series of transects. Returns a tuple of
matplotlib
(Figure, ax).Parameters: - transects –
being a
epygram.base.FieldSet
ofepygram.fields.H1DField
, or a singleepygram.fields.H1DField
.All transects are supposed to have the same unit, and the same horizontal coordinate.
- over – any existing figure and/or ax to be used for the plot, given as a tuple (fig, ax), with None for missing objects. fig is the frame of the matplotlib figure, containing eventually several subplots (axes); ax is the matplotlib axes on which the drawing is done. When given (!= None), these objects must be coherent, e.g. ax being one of the fig axes.
- labels – a list of labels for the profiles (same length and same order).
- fidkey – key of fid for labelling the curve with fid[fidkey]; if None, labels with raw fid.
- unit – label for X coordinate.
- title – title for the plot.
- logscale – to set Y logarithmic scale
- zoom –
a dict containing optional limits to zoom on the plot.
Syntax: e.g. {‘ymax’:500, ...}.
- x_is – abscissa to be among: - ‘distance’: distance from first point of transect - ‘lon’: longitude of points - ‘lat’: latitude of points
- figsize – figure sizes in inches, e.g. (5, 8.5). Default figsize is config.plotsizes.
- rcparams –
list of (*args, **kwargs) to be passed to pyplot.rc() defaults to [((‘font’,), dict(family=’serif’)),
((‘figure’,), dict(autolayout=True))]
- transects –
-
epygram.fields.H1DField.
plotanimation
(transect, title=u'__auto__', repeat=False, interval=1000, **kwargs)[source]¶ To plot a time-dependent transect as an animation. Returns a
matplotlib.animation.FuncAnimation
.Parameters: - transect – being a
epygram.fields.H1DField
. - title – title for the plot. ‘__auto__’ (default) will print the current validity of the time frame.
- repeat – to repeat animation
- interval – number of milliseconds between two validities
Other kwargs passed to plottransects().
- transect – being a