PHYEX 0.9.5
PHYsique EXternalisée
Loading...
Searching...
No Matches
pyphyex.phyex1d.case.CaseCommonFormat Class Reference
Inheritance diagram for pyphyex.phyex1d.case.CaseCommonFormat:
Collaboration diagram for pyphyex.phyex1d.case.CaseCommonFormat:

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 pyphyex.phyex1d.case.Case
 __enter__ (self)
 __exit__ (self, *args)

Public Attributes

int adv_ua = 0
int adv_va = 0

Static Public Attributes

dict nc_names

Protected Attributes

 _inputfile = inputfile
 _nc = None
dict _interpolators = {}

Detailed Description

Case backed by a netCDF driver file in the DEPHY common format

Definition at line 70 of file case.py.

Constructor & Destructor Documentation

◆ __init__()

pyphyex.phyex1d.case.CaseCommonFormat.__init__ ( self,
inputfile,
attrs = None )
:param inputfile: path to a netCDF driver file
:param attrs: dictionary of attributes to override

Definition at line 123 of file case.py.

Member Function Documentation

◆ close()

pyphyex.phyex1d.case.CaseCommonFormat.close ( self)
Close the netCDF file if open

Reimplemented from pyphyex.phyex1d.case.Case.

Definition at line 158 of file case.py.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ contains()

pyphyex.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 pyphyex.phyex1d.case.Case.

Definition at line 164 of file case.py.

Here is the call graph for this function:

◆ description()

pyphyex.phyex1d.case.CaseCommonFormat.description ( self)
Case description

Returns
-------
str
    Case description string (file path)

Reimplemented from pyphyex.phyex1d.case.Case.

Definition at line 254 of file case.py.

◆ duration()

pyphyex.phyex1d.case.CaseCommonFormat.duration ( self)
Simulation duration

Returns
-------
float
    Duration in seconds (time[-1] - time[0])

Reimplemented from pyphyex.phyex1d.case.Case.

Definition at line 204 of file case.py.

Here is the call graph for this function:

◆ get()

pyphyex.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 pyphyex.phyex1d.case.Case.

Definition at line 182 of file case.py.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_interpolator()

pyphyex.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 pyphyex.phyex1d.case.Case.

Definition at line 217 of file case.py.

Here is the call graph for this function:

◆ is_open()

pyphyex.phyex1d.case.CaseCommonFormat.is_open ( self)
Whether the netCDF file is currently open

Definition at line 141 of file case.py.

◆ open()

pyphyex.phyex1d.case.CaseCommonFormat.open ( self)
Open the netCDF file if not already open

Returns
-------
netCDF4.Dataset
    The opened dataset

Definition at line 145 of file case.py.

Here is the caller graph for this function:

Member Data Documentation

◆ _inputfile

pyphyex.phyex1d.case.CaseCommonFormat._inputfile = inputfile
protected

Definition at line 128 of file case.py.

◆ _interpolators

dict pyphyex.phyex1d.case.CaseCommonFormat._interpolators = {}
protected

Definition at line 130 of file case.py.

◆ _nc

pyphyex.phyex1d.case.CaseCommonFormat._nc = None
protected

Definition at line 129 of file case.py.

◆ adv_ua

int pyphyex.phyex1d.case.CaseCommonFormat.adv_ua = 0

Definition at line 131 of file case.py.

◆ adv_va

int pyphyex.phyex1d.case.CaseCommonFormat.adv_va = 0

Definition at line 132 of file case.py.

◆ nc_names

dict pyphyex.phyex1d.case.CaseCommonFormat.nc_names
static

Definition at line 75 of file case.py.


The documentation for this class was generated from the following file: