MCPcopy Create free account
hub / github.com/NCAR/wrf-python / get_eth

Function get_eth

src/wrf/g_temp.py:162–236  ·  view source on GitHub ↗

Return the equivalent potential temperature. This functions extracts the necessary variables from the NetCDF file object in order to perform the calculation. Args: wrfin (:class:`netCDF4.Dataset`, :class:`Nio.NioFile`, or an \ iterable): WRF-ARW NetCDF

(wrfin, timeidx=0, method="cat", squeeze=True,
            cache=None, meta=True, _key=None,
            units="K")

Source from the content-addressed store, hash-verified

160 description="equivalent potential temperature")
161@convert_units("temp", "K")
162def get_eth(wrfin, timeidx=0, method="cat", squeeze=True,
163 cache=None, meta=True, _key=None,
164 units="K"):
165 """Return the equivalent potential temperature.
166
167 This functions extracts the necessary variables from the NetCDF file
168 object in order to perform the calculation.
169
170 Args:
171
172 wrfin (:class:`netCDF4.Dataset`, :class:`Nio.NioFile`, or an \
173 iterable): WRF-ARW NetCDF
174 data as a :class:`netCDF4.Dataset`, :class:`Nio.NioFile`
175 or an iterable sequence of the aforementioned types.
176
177 timeidx (:obj:`int` or :data:`wrf.ALL_TIMES`, optional): The
178 desired time index. This value can be a positive integer,
179 negative integer, or
180 :data:`wrf.ALL_TIMES` (an alias for None) to return
181 all times in the file or sequence. The default is 0.
182
183 method (:obj:`str`, optional): The aggregation method to use for
184 sequences. Must be either 'cat' or 'join'.
185 'cat' combines the data along the Time dimension.
186 'join' creates a new dimension for the file index.
187 The default is 'cat'.
188
189 squeeze (:obj:`bool`, optional): Set to False to prevent dimensions
190 with a size of 1 from being automatically removed from the shape
191 of the output. Default is True.
192
193 cache (:obj:`dict`, optional): A dictionary of (varname, ndarray)
194 that can be used to supply pre-extracted NetCDF variables to the
195 computational routines. It is primarily used for internal
196 purposes, but can also be used to improve performance by
197 eliminating the need to repeatedly extract the same variables
198 used in multiple diagnostics calculations, particularly when using
199 large sequences of files.
200 Default is None.
201
202 meta (:obj:`bool`, optional): Set to False to disable metadata and
203 return :class:`numpy.ndarray` instead of
204 :class:`xarray.DataArray`. Default is True.
205
206 _key (:obj:`int`, optional): A caching key. This is used for internal
207 purposes only. Default is None.
208
209 units (:obj:`str`): The desired units. Refer to the :meth:`getvar`
210 product table for a list of available units for 'eth'. Default
211 is 'K'.
212
213 Returns:
214 :class:`xarray.DataArray` or :class:`numpy.ndarray`: The
215 equivalent potential temperature.
216 If xarray is enabled and the *meta* parameter is True, then the result
217 will be a :class:`xarray.DataArray` object. Otherwise, the result will
218 be a :class:`numpy.ndarray` object with no metadata.
219

Callers 1

vinterpFunction · 0.90

Calls 3

extract_varsFunction · 0.85
_tkFunction · 0.85
_ethFunction · 0.85

Tested by

no test coverage detected