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

Function get_ctt

src/wrf/g_ctt.py:19–145  ·  view source on GitHub ↗

Return the cloud top 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 data as a :

(wrfin, timeidx=0, method="cat",
            squeeze=True, cache=None, meta=True, _key=None,
            fill_nocloud=False, missing=default_fill(np.float64),
            opt_thresh=1.0, units="degC")

Source from the content-addressed store, hash-verified

17 MemoryOrder="XY")
18@convert_units("temp", "c")
19def get_ctt(wrfin, timeidx=0, method="cat",
20 squeeze=True, cache=None, meta=True, _key=None,
21 fill_nocloud=False, missing=default_fill(np.float64),
22 opt_thresh=1.0, units="degC"):
23 """Return the cloud top temperature.
24
25 This functions extracts the necessary variables from the NetCDF file
26 object in order to perform the calculation.
27
28 Args:
29
30 wrfin (:class:`netCDF4.Dataset`, :class:`Nio.NioFile`, or an \
31 iterable): WRF-ARW NetCDF
32 data as a :class:`netCDF4.Dataset`, :class:`Nio.NioFile`
33 or an iterable sequence of the aforementioned types.
34
35 timeidx (:obj:`int` or :data:`wrf.ALL_TIMES`, optional): The
36 desired time index. This value can be a positive integer,
37 negative integer, or
38 :data:`wrf.ALL_TIMES` (an alias for None) to return
39 all times in the file or sequence. The default is 0.
40
41 method (:obj:`str`, optional): The aggregation method to use for
42 sequences. Must be either 'cat' or 'join'.
43 'cat' combines the data along the Time dimension.
44 'join' creates a new dimension for the file index.
45 The default is 'cat'.
46
47 squeeze (:obj:`bool`, optional): Set to False to prevent dimensions
48 with a size of 1 from being automatically removed from the shape
49 of the output. Default is True.
50
51 cache (:obj:`dict`, optional): A dictionary of (varname, ndarray)
52 that can be used to supply pre-extracted NetCDF variables to the
53 computational routines. It is primarily used for internal
54 purposes, but can also be used to improve performance by
55 eliminating the need to repeatedly extract the same variables
56 used in multiple diagnostics calculations, particularly when using
57 large sequences of files.
58 Default is None.
59
60 meta (:obj:`bool`, optional): Set to False to disable metadata and
61 return :class:`numpy.ndarray` instead of
62 :class:`xarray.DataArray`. Default is True.
63
64 _key (:obj:`int`, optional): A caching key. This is used for internal
65 purposes only. Default is None.
66
67 fill_nocloud (:obj:`bool`, optional): Set to True to use fill values in
68 regions where clouds are not detected (optical depth less than 1).
69 Otherwise, the output will contain the surface temperature for
70 areas without clouds. Default is False.
71
72 missing (:obj:`float`, optional): The fill value to use for areas
73 where no clouds are detected. Only used if *fill_nocloud* is
74 True. Default is
75 :data:`wrf.default_fill(numpy.float64)`.
76

Callers

nothing calls this directly

Calls 5

default_fillFunction · 0.85
extract_varsFunction · 0.85
_tkFunction · 0.85
destaggerFunction · 0.85
_cttFunction · 0.85

Tested by

no test coverage detected