|
phyex1d
1D model using PHYEX
|


Public Member Functions | |
| __init__ (self, dataset, attrs=None) | |
| contains (self, varname) | |
| get (self, varname, slice_idx=None) | |
| duration (self) | |
| description (self) | |
| description (self, value) | |
| get_interpolator (self, varname, grid) | |
Public Member Functions inherited from phyex1d.case.Case | |
| __enter__ (self) | |
| __exit__ (self, *args) | |
| close (self) | |
Public Attributes | |
| adv_ua | |
| adv_va | |
Protected Attributes | |
| _dataset | |
| _interpolators | |
| _description | |
Case backed by an in-memory xarray Dataset
Parameters
----------
dataset : xarray.Dataset
Dataset containing all case variables. Variable names must match the
phyex1d internal names (e.g. 'T', 'qv', 'u', 'zh', 'Ps', 'lat', ...).
attrs : dict, optional
Additional attributes to set on the case (overrides dataset attrs).
| phyex1d.case.CaseXarray.contains | ( | self, | |
| varname | |||
| ) |
Check if a variable exists in the dataset
Parameters
----------
varname : str
Variable name
Returns
-------
bool
True if the variable exists
Reimplemented from phyex1d.case.Case.
| phyex1d.case.CaseXarray.description | ( | self | ) |
Case description
Returns
-------
str
Case description string
Reimplemented from phyex1d.case.Case.
| phyex1d.case.CaseXarray.description | ( | self, | |
| value | |||
| ) |
Set a custom description string
Reimplemented from phyex1d.case.Case.
| phyex1d.case.CaseXarray.duration | ( | self | ) |
Simulation duration
Returns
-------
float
Duration in seconds (time[-1] - time[0])
Reimplemented from phyex1d.case.Case.
| phyex1d.case.CaseXarray.get | ( | self, | |
| varname, | |||
slice_idx = None |
|||
| ) |
Read a variable from the dataset
Parameters
----------
varname : str
Variable name
slice_idx : int or None, optional
Slice index to read. None returns the full array.
Returns
-------
numpy.ndarray
The data array
Reimplemented from phyex1d.case.Case.
| phyex1d.case.CaseXarray.get_interpolator | ( | self, | |
| varname, | |||
| grid | |||
| ) |
Get from cache or build an interpolator for a forcing variable
Parameters
----------
varname : str
Variable name
grid : Grid
Grid instance for vertical coordinate
Returns
-------
RegularGridInterpolator
The interpolator
Reimplemented from phyex1d.case.Case.