|
phyex1d
1D model using PHYEX
|


Public Member Functions | |
| __init__ (self, inputfile, attrs=None) | |
| is_open (self) | |
| open (self) | |
| close (self) | |
| contains (self, varname) | |
| get (self, varname, slice_idx=None) | |
| duration (self) | |
| get_interpolator (self, varname, grid) | |
| description (self) | |
Public Member Functions inherited from phyex1d.case.Case | |
| __enter__ (self) | |
| __exit__ (self, *args) | |
Public Attributes | |
| adv_ua | |
| adv_va | |
Static Public Attributes | |
| dict | nc_names |
Protected Attributes | |
| _inputfile | |
| _nc | |
| _interpolators | |
Case backed by a netCDF driver file in the DEPHY common format
| phyex1d.case.CaseCommonFormat.__init__ | ( | self, | |
| inputfile, | |||
attrs = None |
|||
| ) |
:param inputfile: path to a netCDF driver file :param attrs: dictionary of attributes to override
| phyex1d.case.CaseCommonFormat.close | ( | self | ) |
Close the netCDF file if open
Reimplemented from phyex1d.case.Case.
| phyex1d.case.CaseCommonFormat.contains | ( | self, | |
| varname | |||
| ) |
Check if a variable exists in the netCDF file
Parameters
----------
varname : str
Variable name (translated via nc_names if present)
Returns
-------
bool
True if the variable exists
Reimplemented from phyex1d.case.Case.
| phyex1d.case.CaseCommonFormat.description | ( | self | ) |
Case description
Returns
-------
str
Case description string (file path)
Reimplemented from phyex1d.case.Case.
| phyex1d.case.CaseCommonFormat.duration | ( | self | ) |
Simulation duration
Returns
-------
float
Duration in seconds (time[-1] - time[0])
Reimplemented from phyex1d.case.Case.
| phyex1d.case.CaseCommonFormat.get | ( | self, | |
| varname, | |||
slice_idx = None |
|||
| ) |
Read a variable from the netCDF file
Parameters
----------
varname : str
Variable name (translated via nc_names if present)
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.CaseCommonFormat.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.
| phyex1d.case.CaseCommonFormat.is_open | ( | self | ) |
Whether the netCDF file is currently open
| phyex1d.case.CaseCommonFormat.open | ( | self | ) |
Open the netCDF file if not already open
Returns
-------
netCDF4.Dataset
The opened dataset