コード例 #1
0
ファイル: atten.py プロジェクト: zhaopingsun/wradlib
def correctRadomeAttenuationEmpirical(gateset,
                                      frequency=5.64,
                                      hydrophobicity=0.165,
                                      n_r=2,
                                      stat=np.mean):
    """Estimate two-way wet radome losses as an empirical
    function of frequency and rainfall rate for both standard and
    hydrophobic radomes based on the approach of :cite:`Merceret2000`.



    Parameters
    ----------
    gateset : array
        Multidimensional array, where the range gates (over which
        iteration has to be performed) are supposed to vary along the
        last array-dimension and the azimuths are supposed to vary
        along the next to last array-dimension. Data has to be provided
        in decibel representation of reflectivity [dBZ].
    frequency : float
        Radar-frequency [GHz]:

            Standard frequencies in X-band range between 8.0 and 12.0 GHz,

            Standard frequencies in C-band range between 4.0 and 8.0 GHz,

            Standard frequencies in S-band range between 2.0 and 4.0 GHz.

            Be aware that the empirical fit of the formula was just
            done for C- and S-band. The use for X-band is probably an
            undue extrapolation.

            Per default set to 5.64 as used by the German Weather
            Service radars.
    hydrophobicity : float
        Empirical parameter based on the hydrophobicity of the radome
        material.

            - 0.165 for standard radomes,
            - 0.0575 for hydrophobic radomes.

            Per default set to 0.165.
    n_r : integer
        The radius of rangebins within the rain-intensity is
        statistically evaluated as the representative rain-intensity
        over radome.
    stat : class
        A name of a numpy function for statistical aggregation of the
        central rangebins defined by n_r.

        Potential options: np.mean, np.median, np.max, np.min.

    Returns
    -------
    k : array
        Array with the same shape as ``gateset`` containing the
        calculated two-way transmission loss [dB] for each range gate.
        In case the input array (gateset) contains NaNs the
        corresponding beams of the output array (k) will be set as NaN,
        too.
    """

    # Select rangebins inside the defined center-range n_r.
    center = gateset[..., :n_r].reshape(-1, n_r * gateset.shape[-2])
    center_m = np.ma.masked_array(center, np.isnan(center))
    # Calculate rainrate in the center-range based on statistical method stat
    # and with standard ZR-relation.
    rain_over_radome = z2r(idecibel(stat(center_m, axis=-1)))
    # Estimate the empirical two-way transmission loss due to
    # radome-attenuation.
    k = 2 * hydrophobicity * rain_over_radome * np.tanh(frequency / 10.)**2
    # Reshape the result to gateset-shape.
    k = np.repeat(k,
                  gateset.shape[-1] * gateset.shape[-2]).reshape(gateset.shape)

    return k
コード例 #2
0
ファイル: test_zr.py プロジェクト: Maxima86/wradlib
 def test_z2r(self):
     self.assertEqual(zr.z2r(trafo.idecibel(10.)), 0.1537645610180688)
コード例 #3
0
ファイル: atten.py プロジェクト: Maxima86/wradlib
def correctRadomeAttenuationEmpirical(gateset, frequency=5.64,
                                      hydrophobicity=0.165, n_r=2,
                                      stat=np.mean):
    """Estimate two-way wet radome losses as an empirical
    function of frequency and rainfall rate for both standard and
    hydrophobic radomes based on the approach of Francis J. Merceret
    and Jennifer G. Ward :cite:`Merceret2000`.



    Parameters
    ----------
    gateset : array
        Multidimensional array, where the range gates (over which
        iteration has to be performed) are supposed to vary along the
        last array-dimension and the azimuths are supposed to vary
        along the next to last array-dimension. Data has to be provided
        in decibel representation of reflectivity [dBZ].
    frequency : float
        Radar-frequency [GHz]:

            Standard frequencies in X-band range between 8.0 and 12.0 GHz,

            Standard frequencies in C-band range between 4.0 and 8.0 GHz,

            Standard frequencies in S-band range between 2.0 and 4.0 GHz.

            Be aware that the empirical fit of the formula was just
            done for C- and S-band. The use for X-band is probably an
            undue extrapolation.

            Per default set to 5.64 as used by the German Weather
            Service radars.
    hydrophobicity : float
        Empirical parameter based on the hydrophobicity of the radome
        material.

            - 0.165 for standard radomes,
            - 0.0575 for hydrophobic radomes.

            Per default set to 0.165.
    n_r : integer
        The radius of rangebins within the rain-intensity is
        statistically evaluated as the representative rain-intensity
        over radome.
    stat : class
        A name of a numpy function for statistical aggregation of the
        central rangebins defined by n_r.

        Potential options: np.mean, np.median, np.max, np.min.

    Returns
    -------
    k : array
        Array with the same shape as ``gateset`` containing the
        calculated two-way transmission loss [dB] for each range gate.
        In case the input array (gateset) contains NaNs the
        corresponding beams of the output array (k) will be set as NaN,
        too.
    """

    # Select rangebins inside the defined center-range n_r.
    center = gateset[...,:n_r].reshape(-1, n_r * gateset.shape[-2])
    center_m = np.ma.masked_array(center, np.isnan(center))
    # Calculate rainrate in the center-range based on statistical method stat
    # and with standard ZR-relation.
    rain_over_radome = z2r(idecibel(stat(center_m, axis = -1)))
    # Estimate the empirical two-way transmission loss due to
    # radome-attenuation.
    k = 2 * hydrophobicity * rain_over_radome * np.tanh(frequency / 10.)**2
    # Reshape the result to gateset-shape.
    k = np.repeat(k, gateset.shape[-1] *
        gateset.shape[-2]).reshape(gateset.shape)

    return k
コード例 #4
0
 def test_z2r(self):
     self.assertEqual(zr.z2r(trafo.idecibel(10.)), 0.1537645610180688)