wrf.either

class wrf.either(*varnames)

A callable class that determines which variable is present in the file.

This is used in situations where the same variable type has different names depending on the type of file used. For example, in a WRF output file, ‘P’ is used for pressure, whereas in a met_em file, pressure is named ‘PRES’.

__call__(wrfin)

Return the variable that is present in the file.

Parameters:wrfin (netCDF4.Dataset, Nio.NioFile, or an iterable) – WRF-ARW NetCDF data as a netCDF4.Dataset, Nio.NioFile or an iterable sequence of the aforementioned types.
Returns:The variable name that is present in the file.
Return type:str
varnames

A sequence of possible variable names.

Type:sequence
__init__(*varnames)

Initialize an either object.

Parameters:*varnames (sequence) – A sequence of possible variable names.

Methods

__init__(*varnames) Initialize an either object.