Return a tuple of latitude, longitude, and projection parameters from a WRF output file object or a sequence of WRF output file objects. Args: wrfin (:class:`netCDF4.Dataset`, :class:`Nio.NioFile`, or an \ iterable): WRF-ARW NetCDF data as a :class:`netCDF4.
(wrfin)
| 2676 | |
| 2677 | |
| 2678 | def get_proj_params(wrfin): |
| 2679 | """Return a tuple of latitude, longitude, and projection parameters from |
| 2680 | a WRF output file object or a sequence of WRF output file objects. |
| 2681 | |
| 2682 | Args: |
| 2683 | |
| 2684 | wrfin (:class:`netCDF4.Dataset`, :class:`Nio.NioFile`, or an \ |
| 2685 | iterable): WRF-ARW NetCDF |
| 2686 | data as a :class:`netCDF4.Dataset`, :class:`Nio.NioFile` |
| 2687 | or an iterable sequence of the aforementioned types. |
| 2688 | |
| 2689 | timeidx (:obj:`int` or :data:`wrf.ALL_TIMES`, optional): The |
| 2690 | desired time index. This value can be a positive integer, |
| 2691 | negative integer, or |
| 2692 | :data:`wrf.ALL_TIMES` (an alias for None) to return |
| 2693 | all times in the file or sequence. Default is 0. |
| 2694 | |
| 2695 | varname (:obj:`str`, optional): The variable name to extract the |
| 2696 | coordinate variable names from. Default is None, which will |
| 2697 | use the default coordinate variable names ('XLAT', 'XLONG'). |
| 2698 | |
| 2699 | Returns: |
| 2700 | |
| 2701 | :obj:`tuple`: A tuple of the latitude coordinate variable, |
| 2702 | longitude coordinate, and global projection attributes. |
| 2703 | |
| 2704 | """ |
| 2705 | proj_params = extract_global_attrs(wrfin, |
| 2706 | attrs=("MAP_PROJ", |
| 2707 | "CEN_LAT", "CEN_LON", |
| 2708 | "TRUELAT1", "TRUELAT2", |
| 2709 | "MOAD_CEN_LAT", "STAND_LON", |
| 2710 | "POLE_LAT", "POLE_LON", |
| 2711 | "DX", "DY")) |
| 2712 | |
| 2713 | return proj_params |
| 2714 | |
| 2715 | |
| 2716 | def from_args(func, argnames, *args, **kwargs): |