pygetm.output.operators package
Module contents
- class pygetm.output.operators.Base(expression: str, shape: Iterable[int], dims: Iterable[str], dtype: DTypeLike, fill_value=None, time_varying: TimeVarying | Literal[False] = TimeVarying.MICRO, attrs: Mapping[str, Any] = {})[source]
Bases:
object- attrs
- dims
- dtype
- expression
- fill_value
- ndim
- shape
- time_varying
- class pygetm.output.operators.Field(array: Array, dtype: DTypeLike | None = None)[source]
Bases:
Base- array
- collection
- class pygetm.output.operators.FieldCollection(available_fields: Mapping[str, Array], default_dtype: DTypeLike | None = None, sub: bool = False)[source]
-
- request(*fields: str | Array, output_name: str | None = None, dtype: DTypeLike | None = None, mask: bool | None = None, time_average: bool = False, grid: Grid | None = None, z: None | Literal[1] | Literal[2] | float | Iterable[float] = None, generate_unique_name: bool = False, transforms: Iterable[type[UnivariateTransform]] = ()) tuple[str, ...][source]
Add one or more arrays to this field collection.
- Parameters:
*fields – names of arrays or array objects to add. When names are provided, they will be looked up in the field manager.
output_name – name to use for this field. This can only be provided if a single field is requested.
dtype – data type of the field to use. Array values will be cast to this data type whenever the field is saved
mask – whether to explicitly set masked values to the array’s fill value when saving. If this argument is not provided, masking behavior is determined by the array’s _mask_output flag.
time_average – whether to time-average the field
grid – if provided, the field will be regridded to this grid before saving
z – if provided, the field will be interpolated to these z levels before saving. This can be CENTERS or INTERFACES to indicate interpolation to the center or interfaces of the model grid, a 1D array of custom z levels, or a single float indicating the z level to interpolate to. Note that z levels are negative downward, with the bottom being -H.
generate_unique_name – whether to generate a unique output name for requested fields if a field with the same name has previously been added to the collection. If this is not set and a field with this name was added previously, an exception will be raised.
- Returns:
tuple with names of the newly added fields
- class pygetm.output.operators.Gather(source: Base)[source]
Bases:
UnivariateTransform- root_has_global_values
- class pygetm.output.operators.GridInfo(grid, z, on_boundary)[source]
Bases:
NamedTupleCreate new instance of GridInfo(grid, z, on_boundary)
- class pygetm.output.operators.IndexXY(source: Base, x: ArrayLike, y: ArrayLike, coordinate_type: CoordinateType = CoordinateType.IJ, dims: tuple[str, ...] = (), coords: Mapping[str, Base | ArrayLike] = {})[source]
Bases:
UnivariateTransform
- class pygetm.output.operators.InterpZ(source: Base, z: ArrayLike, dim: str, edges: EdgeTreatment = EdgeTreatment.MISSING)[source]
Bases:
UnivariateTransformWithDataInterpolate in the vertical. The vertical dimension must be the first dimension of the source array. The source array must have a vertical coordinate with
axisattribute equal toZ. This coordinate must have the same shape as the source array.- edges
- z_dim
- z_src
- z_tgt
- class pygetm.output.operators.Mask(source: Field)[source]
Bases:
UnivariateTransformWithData- values
- class pygetm.output.operators.Regrid(source: Base, grid: Grid | None = None, z: Literal[None, 1, 2] | None = None)[source]
Bases:
UnivariateTransformWithData- interpolate
- class pygetm.output.operators.TimeAverage(source: Field)[source]
Bases:
UnivariateTransformWithData
- class pygetm.output.operators.UnivariateTransform(source: Base, shape: tuple[int, ...] | None = None, dims: Iterable[str] | None = None, dtype: DTypeLike | None = None, expression: str | None = None, inherit_grid_info: bool = True)[source]
Bases:
Base
- class pygetm.output.operators.UnivariateTransformWithData(*args, **kwargs)[source]
Bases:
UnivariateTransform- values