Browse Source

Documentation fixes

main
Bill Ladwig 7 years ago
parent
commit
4a687473ed
  1. 18
      doc/source/new.rst
  2. 61
      src/wrf/g_latlon.py

18
doc/source/new.rst

@ -9,15 +9,15 @@ v1.1.3 @@ -9,15 +9,15 @@ v1.1.3
- Release 1.1.3
- Fixed/Enhanced the cloud top temperature diagnostic.
- Optical depth was not being calculated correctly when
cloud ice mixing ratio was not available.
- Fixed an indexing bug that caused crashes on Windows, but should have been
crashing on all platforms.
- Users can now specify if they want cloud free regions to use fill values,
rather than the default behavior of using the surface temperature.
- Users can now specify the optical depth required to trigger the cloud
top temperature calculation. However, the default value of 1.0 should be
sufficient for most users.
- Optical depth was not being calculated correctly when
cloud ice mixing ratio was not available.
- Fixed an indexing bug that caused crashes on Windows, but should have been
crashing on all platforms.
- Users can now specify if they want cloud free regions to use fill values,
rather than the default behavior of using the surface temperature.
- Users can now specify the optical depth required to trigger the cloud
top temperature calculation. However, the default value of 1.0 should be
sufficient for most users.
- Added 'th' alias for the theta product.
- Fixed a crash issue related to updraft helicity when a dictionary is
used as the input.

61
src/wrf/g_latlon.py

@ -162,6 +162,67 @@ def get_lon(wrfin, timeidx=0, method="cat", squeeze=True, @@ -162,6 +162,67 @@ def get_lon(wrfin, timeidx=0, method="cat", squeeze=True,
def _llxy_mapping(wrfin, x_or_lat, y_or_lon, func, timeidx, stagger,
squeeze, meta, as_int=None):
"""Return the x,y/lat,lon coordinates for a dictionary input.
The leftmost dimension(s) for the result is:
- return_val[key,...,0,...] will contain the x/lat values.
- return_val[key,...,1,...] will contain the y/lon values.
Nested dictionaries are allowed.
Args:
wrfin (:obj:`dict`): A mapping of key name to a WRF NetCDF file object
or sequence of WRF NetCDF file objects.
x_or_lat (:obj:`float` or sequence): A single latitude/x value or a
sequence of latitude/x values to be converted.
y_or_lon (:obj:`float` or sequence): A single longitude/y value or a
sequence of longitude/y values to be converted.
func (function): Either the xy_to_ll or ll_to_xy function.
timeidx (:obj:`int` or :data:`wrf.ALL_TIMES`): The
desired time index. This value can be a positive integer,
negative integer, or
:data:`wrf.ALL_TIMES` (an alias for None) to return
all times in the file or sequence. The default is 0.
stagger (:obj:`str`): By default, the values are returned on the mass
grid, but a staggered grid can be chosen with the following
options:
- 'm': Use the mass grid (default).
- 'u': Use the same staggered grid as the u wind component,
which has a staggered west_east (x) dimension.
- 'v': Use the same staggered grid as the v wind component,
which has a staggered south_north (y) dimension.
squeeze (:obj:`bool`, optional): Set to False to prevent dimensions
with a size of 1 from being automatically removed from the shape
of the output. Default is True.
meta (:obj:`bool`, optional): Set to False to disable metadata and
return :class:`numpy.ndarray` instead of
:class:`xarray.DataArray`. Default is True.
as_int (:obj:`bool`, optional): Set to True to return the x,y values as
:obj:`int`, otherwise they will be returned as :obj:`float`. This
is only used when *func* is ll_to_xy.
Returns:
:class:`xarray.DataArray` or :class:`numpy.ndarray`: The
lat,lon/x,y coordinate value(s) whose leftmost dimensions are the
dictionary keys, followed by a dimension of size
2 (0=X, 1=Y)/(0=lat, 1=lon).
If xarray is enabled and the *meta* parameter is True, then the result
will be a :class:`xarray.DataArray` object. Otherwise, the result will
be a :class:`numpy.ndarray` object with no metadata.
"""
keynames = []
# This might not work once mapping iterators are implemented
numkeys = len(wrfin)

Loading…
Cancel
Save