Return a mapping of key to a sequence of time objects. This function is used when *wrfin* is a mapping. Args: wrfin (:class:`netCDF4.Dataset`, :class:`Nio.NioFile`, or an \ iterable): WRF-ARW NetCDF data as a :class:`netCDF4.Dataset`, :class:`Nio.NioFile`
(wrfin, timeidx, do_xtime, meta=False)
| 2368 | |
| 2369 | |
| 2370 | def _extract_time_map(wrfin, timeidx, do_xtime, meta=False): |
| 2371 | """Return a mapping of key to a sequence of time objects. |
| 2372 | |
| 2373 | This function is used when *wrfin* is a mapping. |
| 2374 | |
| 2375 | Args: |
| 2376 | |
| 2377 | wrfin (:class:`netCDF4.Dataset`, :class:`Nio.NioFile`, or an \ |
| 2378 | iterable): WRF-ARW NetCDF |
| 2379 | data as a :class:`netCDF4.Dataset`, :class:`Nio.NioFile` |
| 2380 | or an iterable sequence of the aforementioned types. |
| 2381 | |
| 2382 | timeidx (:obj:`int` or :data:`wrf.ALL_TIMES`): The |
| 2383 | desired time index. This value can be a positive integer, |
| 2384 | negative integer, or |
| 2385 | :data:`wrf.ALL_TIMES` (an alias for None) to return |
| 2386 | all times in the file or sequence. |
| 2387 | |
| 2388 | do_xtime (:obj:`bool`): Set to True to parse the 'XTIME' variable |
| 2389 | instead of the 'Times' variable. |
| 2390 | |
| 2391 | meta (:obj:`bool`, optional): Set to False to disable metadata. |
| 2392 | |
| 2393 | Returns: |
| 2394 | |
| 2395 | :obj:`dict`: A mapping of key to a sequence of time objects. If |
| 2396 | *meta* is True, the sequence will be of type :class:`xarray.DataArray`, |
| 2397 | otherwise the sequence is :class:`numpy.ndarray`. |
| 2398 | |
| 2399 | """ |
| 2400 | return {key: extract_times(wrfseq, timeidx, do_xtime, meta) |
| 2401 | for key, wrfseq in viewitems(wrfin)} |
| 2402 | |
| 2403 | |
| 2404 | def extract_times(wrfin, timeidx, method="cat", squeeze=True, cache=None, |
no test coverage detected