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

Function get_3dcin_only

src/wrf/g_cape.py:566–631  ·  view source on GitHub ↗

Return the three-dimensional field of CIN (Convective Inhibition). 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-A

(wrfin, timeidx=0, method="cat",
                   squeeze=True, cache=None, meta=True,
                   _key=None, missing=default_fill(np.float64))

Source from the content-addressed store, hash-verified

564
565
566def get_3dcin_only(wrfin, timeidx=0, method="cat",
567 squeeze=True, cache=None, meta=True,
568 _key=None, missing=default_fill(np.float64)):
569 """Return the three-dimensional field of CIN (Convective Inhibition).
570
571 This functions extracts the necessary variables from the NetCDF file
572 object in order to perform the calculation.
573
574 Args:
575
576 wrfin (:class:`netCDF4.Dataset`, :class:`Nio.NioFile`, or an \
577 iterable): WRF-ARW NetCDF
578 data as a :class:`netCDF4.Dataset`, :class:`Nio.NioFile`
579 or an iterable sequence of the aforementioned types.
580
581 timeidx (:obj:`int` or :data:`wrf.ALL_TIMES`, optional): The
582 desired time index. This value can be a positive integer,
583 negative integer, or
584 :data:`wrf.ALL_TIMES` (an alias for None) to return
585 all times in the file or sequence. The default is 0.
586
587 method (:obj:`str`, optional): The aggregation method to use for
588 sequences. Must be either 'cat' or 'join'.
589 'cat' combines the data along the Time dimension.
590 'join' creates a new dimension for the file index.
591 The default is 'cat'.
592
593 squeeze (:obj:`bool`, optional): Set to False to prevent dimensions
594 with a size of 1 from being automatically removed from the shape
595 of the output. Default is True.
596
597 cache (:obj:`dict`, optional): A dictionary of (varname, ndarray)
598 that can be used to supply pre-extracted NetCDF variables to the
599 computational routines. It is primarily used for internal
600 purposes, but can also be used to improve performance by
601 eliminating the need to repeatedly extract the same variables
602 used in multiple diagnostics calculations, particularly when using
603 large sequences of files.
604 Default is None.
605
606 meta (:obj:`bool`, optional): Set to False to disable metadata and
607 return :class:`numpy.ndarray` instead of
608 :class:`xarray.DataArray`. Default is True.
609
610 _key (:obj:`int`, optional): A caching key. This is used for internal
611 purposes only. Default is None.
612
613 missing (:obj:`float`): The fill value to use for the output.
614 Default is :data:`wrf.default_fill(np.float64)`.
615
616 Returns:
617 :class:`xarray.DataArray` or :class:`numpy.ndarray`: The
618 3D CIN field.
619 If xarray is enabled and the *meta* parameter is True, then the result
620 will be a :class:`xarray.DataArray` object. Otherwise, the result will
621 be a :class:`numpy.ndarray` object with no metadata.
622
623 """

Callers

nothing calls this directly

Calls 2

default_fillFunction · 0.85
get_3dcapeFunction · 0.85

Tested by

no test coverage detected