Return the preciptiable water. 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 :cla
(wrfin, timeidx=0, method="cat", squeeze=True, cache=None,
meta=True, _key=None)
| 12 | MemoryOrder="XY", |
| 13 | units="kg m-2") |
| 14 | def get_pw(wrfin, timeidx=0, method="cat", squeeze=True, cache=None, |
| 15 | meta=True, _key=None): |
| 16 | """Return the preciptiable water. |
| 17 | |
| 18 | This functions extracts the necessary variables from the NetCDF file |
| 19 | object in order to perform the calculation. |
| 20 | |
| 21 | Args: |
| 22 | |
| 23 | wrfin (:class:`netCDF4.Dataset`, :class:`Nio.NioFile`, or an \ |
| 24 | iterable): WRF-ARW NetCDF |
| 25 | data as a :class:`netCDF4.Dataset`, :class:`Nio.NioFile` |
| 26 | or an iterable sequence of the aforementioned types. |
| 27 | |
| 28 | timeidx (:obj:`int` or :data:`wrf.ALL_TIMES`, optional): The |
| 29 | desired time index. This value can be a positive integer, |
| 30 | negative integer, or |
| 31 | :data:`wrf.ALL_TIMES` (an alias for None) to return |
| 32 | all times in the file or sequence. The default is 0. |
| 33 | |
| 34 | method (:obj:`str`, optional): The aggregation method to use for |
| 35 | sequences. Must be either 'cat' or 'join'. |
| 36 | 'cat' combines the data along the Time dimension. |
| 37 | 'join' creates a new dimension for the file index. |
| 38 | The default is 'cat'. |
| 39 | |
| 40 | squeeze (:obj:`bool`, optional): Set to False to prevent dimensions |
| 41 | with a size of 1 from being automatically removed from the shape |
| 42 | of the output. Default is True. |
| 43 | |
| 44 | cache (:obj:`dict`, optional): A dictionary of (varname, ndarray) |
| 45 | that can be used to supply pre-extracted NetCDF variables to the |
| 46 | computational routines. It is primarily used for internal |
| 47 | purposes, but can also be used to improve performance by |
| 48 | eliminating the need to repeatedly extract the same variables |
| 49 | used in multiple diagnostics calculations, particularly when using |
| 50 | large sequences of files. |
| 51 | Default is None. |
| 52 | |
| 53 | meta (:obj:`bool`, optional): Set to False to disable metadata and |
| 54 | return :class:`numpy.ndarray` instead of |
| 55 | :class:`xarray.DataArray`. Default is True. |
| 56 | |
| 57 | _key (:obj:`int`, optional): A caching key. This is used for internal |
| 58 | purposes only. Default is None. |
| 59 | |
| 60 | Returns: |
| 61 | :class:`xarray.DataArray` or :class:`numpy.ndarray`: The preciptable |
| 62 | water. If xarray is |
| 63 | enabled and the *meta* parameter is True, then the result will be a |
| 64 | :class:`xarray.DataArray` object. Otherwise, the result will be a |
| 65 | :class:`numpy.ndarray` object with no metadata. |
| 66 | |
| 67 | """ |
| 68 | varnames = ("T", "P", "PB", "PH", "PHB", "QVAPOR") |
| 69 | ncvars = extract_vars(wrfin, timeidx, varnames, method, squeeze, cache, |
| 70 | meta=False, _key=_key) |
| 71 |
nothing calls this directly
no test coverage detected