MCPcopy Create free account
hub / github.com/NCAR/wrf-python / vertcross

Function vertcross

src/wrf/interp.py:123–362  ·  view source on GitHub ↗

Return the vertical cross section for a three-dimensional field. The cross section is defined by a horizontal line through the domain. This horizontal line is defined by either including the *pivot_point* and *angle* parameters, or the *start_point* and *end_point* parameters. The *

(field3d, vert, levels=None, missing=default_fill(np.float64),
              wrfin=None, timeidx=0, stagger=None, projection=None,
              ll_point=None,
              pivot_point=None, angle=None,
              start_point=None, end_point=None,
              latlon=False, autolevels=100, cache=None, meta=True)

Source from the content-addressed store, hash-verified

121
122@set_interp_metadata("cross")
123def vertcross(field3d, vert, levels=None, missing=default_fill(np.float64),
124 wrfin=None, timeidx=0, stagger=None, projection=None,
125 ll_point=None,
126 pivot_point=None, angle=None,
127 start_point=None, end_point=None,
128 latlon=False, autolevels=100, cache=None, meta=True):
129 """Return the vertical cross section for a three-dimensional field.
130
131 The cross section is defined by a horizontal line through the domain.
132 This horizontal line is defined by either including the
133 *pivot_point* and *angle* parameters, or the *start_point* and
134 *end_point* parameters. The *pivot_point*, *start_point*, and *end_point*
135 coordinates can be defined in either x,y or latitude,longitude space.
136 If latitude,longitude coordinates are used, then a WRF input file or
137 map projection must also be specified.
138
139 The vertical levels for the cross section are fixed if *levels* is not
140 specified, and are determined by dividing the vertical coordinate in to
141 grid boxes of roughly 1% of the maximum vertical distance from top to
142 bottom. Otherwise, the *levels* argument can be used to specify specific
143 vertical levels. If all vertical levels are desired, use the raw
144 :meth:`wrf.interp2dxy` function.
145
146 See Also:
147
148 :meth:`wrf.interp2dxy`
149
150 Args:
151
152 field3d (:class:`xarray.DataArray` or :class:`numpy.ndarray`): A
153 three-dimensional field to interpolate, whose
154 rightmost dimensions are nz x ny x nx.
155
156 vert (:class:`xarray.DataArray` or :class:`numpy.ndarray`): A
157 three-dimensional variable for the vertical coordinate, typically
158 pressure or height. This array must have the same dimensionality
159 as *field3d*
160
161 levels (sequence, optional): A sequence of :obj:`float` for the desired
162 vertical levels in the output array. Must be in the same units
163 as *vert*. If None, a fixed set of vertical levels is provided.
164 Default is None.
165
166 missing (:obj:`float`): The fill value to use for the output.
167 Default is :data:`wrf.default_fill(numpy.float64)`.
168
169 wrfin (:class:`netCDF4.Dataset`, :class:`Nio.NioFile`, or an \
170 iterable, optional): WRF-ARW NetCDF
171 data as a :class:`netCDF4.Dataset`, :class:`Nio.NioFile`
172 or an iterable sequence of the aforementioned types. This is used
173 to obtain the map projection when using latitude,longitude
174 coordinates. Default is None.
175
176 timeidx (:obj:`int`, optional): The
177 desired time index when obtaining map boundary information
178 from moving nests. This value can be a positive or negative
179 integer. Only required when *wrfin* is specified and the nest is
180 moving. Currently, :data:`wrf.ALL_TIMES` is not supported.

Callers 3

testFunction · 0.90
make_result_fileFunction · 0.90
testFunction · 0.90

Calls 8

default_fillFunction · 0.85
is_latlon_pairFunction · 0.85
is_moving_domainFunction · 0.85
to_xy_coordsFunction · 0.85
get_xy_z_paramsFunction · 0.85
to_npFunction · 0.85
_vertcrossFunction · 0.85
py3rangeFunction · 0.85

Tested by 3

testFunction · 0.72
make_result_fileFunction · 0.72
testFunction · 0.72