phyex1d
1D model using PHYEX
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | Protected Attributes | List of all members
phyex1d.case.CaseXarray Class Reference
Inheritance diagram for phyex1d.case.CaseXarray:
Inheritance graph
[legend]
Collaboration diagram for phyex1d.case.CaseXarray:
Collaboration graph
[legend]

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
 

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

Member Function Documentation

◆ contains()

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.

◆ description() [1/2]

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

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

Reimplemented from phyex1d.case.Case.

◆ description() [2/2]

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

Reimplemented from phyex1d.case.Case.

◆ duration()

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

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

Reimplemented from phyex1d.case.Case.

◆ get()

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.

◆ get_interpolator()

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.


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