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

Function _interpline

src/wrf/extension.py:194–215  ·  view source on GitHub ↗

Return the two-dimensional field interpolated to a line. This routine was originally written in scripted NCL code and doesn't directly wrap a Fortran routine. Located in WRFUserARW.ncl.

(field2d, xy, outview=None)

Source from the content-addressed store, hash-verified

192@cast_type(arg_idxs=(0, ))
193@extract_and_transpose(do_transpose=False)
194def _interpline(field2d, xy, outview=None):
195 """Return the two-dimensional field interpolated to a line.
196
197 This routine was originally written in scripted NCL code and doesn't
198 directly wrap a Fortran routine.
199
200 Located in WRFUserARW.ncl.
201
202 """
203 # Note: This is using C-ordering
204 if outview is None:
205 outview = np.empty(xy.shape[0], dtype=field2d.dtype)
206
207 tmp_shape = (1,) + field2d.shape
208 var2dtmp = np.empty(tmp_shape, field2d.dtype)
209 var2dtmp[0, :, :] = field2d[:, :]
210
211 var1dtmp = _interp2dxy(var2dtmp, xy)
212
213 outview[:] = var1dtmp[0, :]
214
215 return outview
216
217
218@check_args(0, 3, (3, 3, 3, 3))

Callers 3

_set_cross_metaFunction · 0.85
_set_line_metaFunction · 0.85
interplineFunction · 0.85

Calls 1

_interp2dxyFunction · 0.85

Tested by

no test coverage detected