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

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

Public Attributes

int adv_ua = 0
int adv_va = 0

Protected Attributes

 _dataset = dataset
dict _interpolators = {}
 _description = value

Detailed 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).

Definition at line 266 of file case.py.

Constructor & Destructor Documentation

◆ __init__()

pyphyex.phyex1d.case.CaseXarray.__init__ ( self,
dataset,
attrs = None )

Definition at line 279 of file case.py.

Member Function Documentation

◆ contains()

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

Definition at line 290 of file case.py.

◆ description() [1/2]

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

Returns
-------
str
    Case description string

Reimplemented from pyphyex.phyex1d.case.Case.

Definition at line 339 of file case.py.

◆ description() [2/2]

pyphyex.phyex1d.case.CaseXarray.description ( self,
value )
Set a custom description string

Reimplemented from pyphyex.phyex1d.case.Case.

Definition at line 351 of file case.py.

◆ duration()

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

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

Reimplemented from pyphyex.phyex1d.case.Case.

Definition at line 326 of file case.py.

◆ get()

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

Definition at line 306 of file case.py.

◆ get_interpolator()

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

Definition at line 355 of file case.py.

Here is the call graph for this function:

Member Data Documentation

◆ _dataset

pyphyex.phyex1d.case.CaseXarray._dataset = dataset
protected

Definition at line 280 of file case.py.

◆ _description

pyphyex.phyex1d.case.CaseXarray._description = value
protected

Definition at line 353 of file case.py.

◆ _interpolators

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

Definition at line 281 of file case.py.

◆ adv_ua

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

Definition at line 282 of file case.py.

◆ adv_va

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

Definition at line 283 of file case.py.


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