pylawr.transform.attenuation#
This class provides methods to estimate the attenuation based on the maximum apparent attenuation comparing reflectivities of attenuation-influenced frequency bands (X-band) and observations from less attenuated radar systems (C-band). |
pylawr.transform.attenuation.AttenuationCorrectionDual#
- class pylawr.transform.attenuation.AttenuationCorrectionDual[source]#
Bases:
MemoryMixinThis class provides methods to estimate the attenuation based on the maximum apparent attenuation comparing reflectivities of attenuation-influenced frequency bands (X-band) and observations from less attenuated radar systems (C-band). The reflectivites have to be on the same grid. One approach is to interpolate the reflectivites on a joint coarse grid, estimate the attenuation and interpolate the attenuation on the fine grid of the attenuation-influenced frequency band.
To estimate the attenuation of the attenuation-influenced frequency band (X-band) with the less attenuated radar system (C-band) the maximum apparent attenuation \(K_{\mathrm{max}}\) (dB) is used:
The attenuation should increase with increasing distance in theory. To get an increasing attenuation some regression is applied on \(K_{\mathrm{max}}\), e.g. the isotonic regression. For further information look up Lengfeld et. al (2016).
- attenuation#
Estimated attenuation for the correction, negative values are not allowed
- Type
xarray.DataArrayor None
- _abc_impl = <_abc._abc_data object>#
- static _calc_kmax(refl_attenuated, refl_robust)[source]#
Calculate the attenuation factor between attenuated reflectivity and robust reflectivity. Only where the attenuated reflectivity is available the attenuation factor is calculated (otherwise we would create a reflectivity signal due to e.g. different radar resolution and incorrect alignment).
- Parameters
refl_attenuated (
xarray.DataArray) – Reflectivity of attenuation-influenced radar systemrefl_robust (
xarray.DataArray) – Reflectivity of less attenuated radar system
- Returns
k_max – The attenuation between the two radar fields.
- Return type
- static _check_grids(grid_first, grid_second)[source]#
Checks if the grids are child of
pylawr.grid.polar.PolarGridand have equal attributes.- Parameters
grid (child of
pylawr.grid.base.BaseGrid) – grid of data
- static _regress_attenuation(k_max, regression=IsotonicRegression(), replace_neg=0)[source]#
Calculate attenuation based on given regression object.
- Parameters
k_max (
xarray.DataArray) – The attenuation is estimated based on this array.regression (object) – Regression object with .fit_transform(x, y) method. Default is
sklearn.isotonic.IsotonicRegression.replace_neg (float, NaN or None) – Negative values are replace with float values or np.nan. If this parameter is set to None negative values will not replaced, e.g. for research reasons.
- Returns
attenuation – Estimated attenuation array based on given reflectivity differences and regression.
- Return type
- property attenuation#
- fit(refl_attenuated, refl_robust, regression=IsotonicRegression(), replace_neg=0)[source]#
Estimates the attenuation correction. Negative values are not allowed, otherwise grid resolution effects of the less attenuated radar systems could occure. In default the isotonic regression is applied according to Lengfeld et. al (2016).
- Parameters
refl_attenuated (
xarray.DataArray) – Reflectivity of attenuation-influenced radar systemrefl_robust (
xarray.DataArray) – Reflectivity of less attenuated radar systemregression (object) – Regression object with .fit_transform(x, y) method. Default is
sklearn.isotonic.IsotonicRegression. If this is None, no regression is used and raw differences between given fields are used as attenuation.replace_neg (float, NaN or None) – Negative values are replace with float values or np.nan. If this parameter is set to None negative values will not replaced, e.g. for research reasons.
- property fitted#
- to_xarray()[source]#
Serialize this filter’s parameters to an
xarray.Dataset- Returns
the filter’s parameters as dataset
- Return type