Skip to content

Commit 786975b

Browse files
author
Bill Ladwig
committed
Merge branch 'hotfix/1.1.3.1'
2 parents 31091c3 + 4a68747 commit 786975b

File tree

2 files changed

+70
-9
lines changed

2 files changed

+70
-9
lines changed

doc/source/new.rst

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,15 @@ v1.1.3
99

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

src/wrf/g_latlon.py

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,67 @@ def get_lon(wrfin, timeidx=0, method="cat", squeeze=True,
162162
def _llxy_mapping(wrfin, x_or_lat, y_or_lon, func, timeidx, stagger,
163163
squeeze, meta, as_int=None):
164164

165+
"""Return the x,y/lat,lon coordinates for a dictionary input.
166+
167+
The leftmost dimension(s) for the result is:
168+
169+
- return_val[key,...,0,...] will contain the x/lat values.
170+
- return_val[key,...,1,...] will contain the y/lon values.
171+
172+
Nested dictionaries are allowed.
173+
174+
Args:
175+
176+
wrfin (:obj:`dict`): A mapping of key name to a WRF NetCDF file object
177+
or sequence of WRF NetCDF file objects.
178+
179+
x_or_lat (:obj:`float` or sequence): A single latitude/x value or a
180+
sequence of latitude/x values to be converted.
181+
182+
y_or_lon (:obj:`float` or sequence): A single longitude/y value or a
183+
sequence of longitude/y values to be converted.
184+
185+
func (function): Either the xy_to_ll or ll_to_xy function.
186+
187+
timeidx (:obj:`int` or :data:`wrf.ALL_TIMES`): The
188+
desired time index. This value can be a positive integer,
189+
negative integer, or
190+
:data:`wrf.ALL_TIMES` (an alias for None) to return
191+
all times in the file or sequence. The default is 0.
192+
193+
stagger (:obj:`str`): By default, the values are returned on the mass
194+
grid, but a staggered grid can be chosen with the following
195+
options:
196+
197+
- 'm': Use the mass grid (default).
198+
- 'u': Use the same staggered grid as the u wind component,
199+
which has a staggered west_east (x) dimension.
200+
- 'v': Use the same staggered grid as the v wind component,
201+
which has a staggered south_north (y) dimension.
202+
203+
squeeze (:obj:`bool`, optional): Set to False to prevent dimensions
204+
with a size of 1 from being automatically removed from the shape
205+
of the output. Default is True.
206+
207+
meta (:obj:`bool`, optional): Set to False to disable metadata and
208+
return :class:`numpy.ndarray` instead of
209+
:class:`xarray.DataArray`. Default is True.
210+
211+
as_int (:obj:`bool`, optional): Set to True to return the x,y values as
212+
:obj:`int`, otherwise they will be returned as :obj:`float`. This
213+
is only used when *func* is ll_to_xy.
214+
215+
Returns:
216+
:class:`xarray.DataArray` or :class:`numpy.ndarray`: The
217+
lat,lon/x,y coordinate value(s) whose leftmost dimensions are the
218+
dictionary keys, followed by a dimension of size
219+
2 (0=X, 1=Y)/(0=lat, 1=lon).
220+
If xarray is enabled and the *meta* parameter is True, then the result
221+
will be a :class:`xarray.DataArray` object. Otherwise, the result will
222+
be a :class:`numpy.ndarray` object with no metadata.
223+
224+
"""
225+
165226
keynames = []
166227
# This might not work once mapping iterators are implemented
167228
numkeys = len(wrfin)

0 commit comments

Comments
 (0)