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

Function _smooth2d

src/wrf/extension.py:834–861  ·  view source on GitHub ↗

Wrapper for dfilter2d. Located in wrf_user.f90.

(field, passes, cenweight, outview=None)

Source from the content-addressed store, hash-verified

832@cast_type(arg_idxs=(0, ))
833@extract_and_transpose()
834def _smooth2d(field, passes, cenweight, outview=None):
835 """Wrapper for dfilter2d.
836
837 Located in wrf_user.f90.
838
839 """
840 # Unlike NCL, this routine will not modify the values in place, but
841 # copies the original data before modifying it.
842
843 if isinstance(field, np.ma.MaskedArray):
844 missing = field.fill_value
845 else:
846 missing = default_fill(np.float64)
847
848 if outview is None:
849 outview = field.copy(order="A")
850 else:
851 outview[:] = field[:]
852
853 field_tmp = np.zeros(outview.shape, outview.dtype, order="F")
854
855 dfilter2d(outview,
856 field_tmp,
857 passes,
858 missing,
859 cenweight)
860
861 return outview
862
863
864@check_args(0, 3, (3, 3, 2))

Callers 2

vinterpFunction · 0.85
smooth2dFunction · 0.85

Calls 1

default_fillFunction · 0.85

Tested by

no test coverage detected