Wrapper for dfilter2d. Located in wrf_user.f90.
(field, passes, cenweight, outview=None)
| 832 | @cast_type(arg_idxs=(0, )) |
| 833 | @extract_and_transpose() |
| 834 | def _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)) |
no test coverage detected