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

Function get_height

src/wrf/g_geoht.py:188–258  ·  view source on GitHub ↗

Return the geopotential height. If *msl* is True, then geopotential height is returned as Mean Sea Level (MSL). If *msl* is False, then geopotential height is returned as Above Ground Level (AGL) by subtracting the terrain height. This functions extracts the necessary variables fr

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

Source from the content-addressed store, hash-verified

186@set_height_metadata(geopt=False, stag=False)
187@convert_units("height", "m")
188def get_height(wrfin, timeidx=0, method="cat", squeeze=True,
189 cache=None, meta=True, _key=None,
190 msl=True, units="m"):
191 """Return the geopotential height.
192
193 If *msl* is True, then geopotential height is returned as Mean Sea Level
194 (MSL). If *msl* is False, then geopotential height is returned as
195 Above Ground Level (AGL) by subtracting the terrain height.
196
197 This functions extracts the necessary variables from the NetCDF file
198 object in order to perform the calculation.
199
200 Args:
201
202 wrfin (:class:`netCDF4.Dataset`, :class:`Nio.NioFile`, or an \
203 iterable): WRF-ARW NetCDF
204 data as a :class:`netCDF4.Dataset`, :class:`Nio.NioFile`
205 or an iterable sequence of the aforementioned types.
206
207 timeidx (:obj:`int` or :data:`wrf.ALL_TIMES`, optional): The
208 desired time index. This value can be a positive integer,
209 negative integer, or
210 :data:`wrf.ALL_TIMES` (an alias for None) to return
211 all times in the file or sequence. The default is 0.
212
213 method (:obj:`str`, optional): The aggregation method to use for
214 sequences. Must be either 'cat' or 'join'.
215 'cat' combines the data along the Time dimension.
216 'join' creates a new dimension for the file index.
217 The default is 'cat'.
218
219 squeeze (:obj:`bool`, optional): Set to False to prevent dimensions
220 with a size of 1 from being automatically removed from the shape
221 of the output. Default is True.
222
223 cache (:obj:`dict`, optional): A dictionary of (varname, ndarray)
224 that can be used to supply pre-extracted NetCDF variables to the
225 computational routines. It is primarily used for internal
226 purposes, but can also be used to improve performance by
227 eliminating the need to repeatedly extract the same variables
228 used in multiple diagnostics calculations, particularly when using
229 large sequences of files.
230 Default is None.
231
232 meta (:obj:`bool`, optional): Set to False to disable metadata and
233 return :class:`numpy.ndarray` instead of
234 :class:`xarray.DataArray`. Default is True.
235
236 _key (:obj:`int`, optional): A caching key. This is used for internal
237 purposes only. Default is None.
238
239 msl (:obj:`bool`, optional): Set to True to return geopotential height
240 as Mean Sea Level (MSL). Set to False to return the
241 geopotential height as Above Ground Level (AGL) by subtracting
242 the terrain height. Default is True.
243
244 units (:obj:`str`): The desired units. Refer to the :meth:`getvar`
245 product table for a list of available units for 'z'. Default

Callers 2

get_argsFunction · 0.90
vinterpFunction · 0.90

Calls 1

_get_geohtFunction · 0.85

Tested by 1

get_argsFunction · 0.72