disdrodb.scattering package#
Submodules#
disdrodb.scattering.axis_ratio module#
Implement drop (vertical-to-horizontal) axis ratio theoretical models.
- disdrodb.scattering.axis_ratio.available_axis_ratio_models()[source][source]#
Return a list of the available drop axis ratio models.
- disdrodb.scattering.axis_ratio.check_axis_ratio_model(model)[source][source]#
Check validity of the specified drop axis ratio model.
- disdrodb.scattering.axis_ratio.get_axis_ratio(diameter, model)[source][source]#
Compute the axis ratio of raindrops using the specified model.
- Parameters:
diameter (array-like) – Raindrops diameter in mm.
model (str) – The axis ratio model to use for calculating the axis ratio. Available models are: ‘Thurai2005’, ‘Thurai2007’, ‘Parsivel’, ‘Brandes2002’, ‘Pruppacher1970’, ‘Beard1987’, ‘Andsager1999’, ‘Chang2009’.
- Returns:
axis_ratio – The vertical-to-horizontal drop axis ratio corresponding to the input diameters. Values of 1 indicate spherical particles, while values <1 indicate oblate particles. Values >1 means prolate particles.
- Return type:
array-like
Notes
This function serves as a wrapper to various axis ratio models for raindrops. It selects and applies the appropriate model based on the model parameter.
Examples
>>> diameter = np.array([0.5, 1.0, 2.0, 3.0]) >>> axis_ratio = get_axis_ratio(diameter, model="Brandes2002")
- disdrodb.scattering.axis_ratio.get_axis_ratio_andsager_1999(diameter)[source][source]#
Compute the axis ratio of raindrops using the Andsager et al. (1999) model.
- Parameters:
diameter (array-like) – Diameter of the raindrops in millimeters.
- Returns:
axis_ratio – Calculated axis ratios corresponding to the input diameters.
- Return type:
array-like
Notes
This function calculates the axis ratio of raindrops based on the method described in Andsager et al. (1999). For diameters between 1.1 mm and 4.4 mm, it uses the average axis-ratio relationship given by Kubesh and Beard (1993):
axis_ratio = 1.012 - 0.144 * D - 1.03 * D^2
For diameters outside this range (0.1 mm to 1.1 mm and 4.4 mm to 7.0 mm), it uses the equilibrium shape equation from Beard and Chuang (1987).
References
- Andsager, K., Beard, K. V., & Laird, N. F. (1999).
Laboratory measurements of axis ratios for large raindrops. Journal of the Atmospheric Sciences, 56(15), 2673-2683.
- Kubesh, R. J., & Beard, K. V. (1993).
Laboratory measurements of spontaneous oscillations for moderate-size raindrops. Journal of the Atmospheric Sciences, 50(7), 1089-1098.
- Beard, K. V., & Chuang, C. (1987).
A new model for the equilibrium shape of raindrops. Journal of the Atmospheric Sciences, 44(11), 1509-1524.
- disdrodb.scattering.axis_ratio.get_axis_ratio_beard_1987(diameter)[source][source]#
Compute the axis ratio of raindrops using the Beard and Chuang (1987) model.
- Parameters:
diameter (array-like) – Diameter of the raindrops in centimeters.
- Returns:
axis_ratio – Calculated axis ratios corresponding to the input diameters.
- Return type:
array-like
Notes
The formula is a polynomial fit to the numerical model of Beard and Chuang (1987), with drop diameters between 1 and 7 mm.
References
Beard, K. V., & Chuang, C. (1987). A new model for the equilibrium shape of raindrops. Journal of the Atmospheric Sciences, 44(11), 1509-1524. https://doi.org/10.1175/1520-0469(1987)044<1509:ANMFTE>2.0.CO;2
- disdrodb.scattering.axis_ratio.get_axis_ratio_brandes_2002(diameter)[source][source]#
Compute the axis ratio of raindrops using the Brandes et al. (2002) model.
- Parameters:
diameter (array-like) – Diameter of the raindrops in millimeters.
- Returns:
axis_ratio – Calculated axis ratios corresponding to the input diameters.
- Return type:
array-like
References
Brandes, E. A., Zhang, G., & Vivekanandan, J. (2002). Experiments in rainfall estimation with a polarimetric radar in a subtropical environment. Journal of Applied Meteorology, 41(6), 674-685. https://doi.org/10.1175/1520-0450(2002)041<0674:EIREWA>2.0.CO;2
Brandes, et al. 2005: On the Influence of Assumed Drop Size Distribution Form on Radar-Retrieved Thunderstorm Microphysics. J. Appl. Meteor. Climatol., 45, 259-268.
- disdrodb.scattering.axis_ratio.get_axis_ratio_chang_2009(diameter)[source][source]#
Compute the axis ratio of raindrops using the Chang et al. (2009) model.
- Parameters:
diameter (array-like) – Diameter of the raindrops in millimeters.
- Returns:
axis_ratio – Calculated axis ratios corresponding to the input diameters.
- Return type:
array-like
References
Chang, W. Y., T. C. C. Wang, and P. L. Lin, 2009. Characteristics of the Raindrop Size Distribution and Drop Shape Relation in Typhoon Systems in the Western Pacific from the 2D Video Disdrometer and NCU C-Band Polarimetric Radar. Journal of Atmospheric and Oceanic Technology, 26, 1973-1993. https://doi.org/10.1175/2009JTECHA1236.1, 2009.
- disdrodb.scattering.axis_ratio.get_axis_ratio_model(model)[source][source]#
Return the specified drop axis ratio model.
- Parameters:
model (str) – The model to use for calculating the axis ratio. Available models are: ‘Thurai2005’, ‘Thurai2007’, ‘Parsivel’, ‘Brandes2002’, ‘Pruppacher1970’, ‘Beard1987’, ‘Andsager1999’, ‘Chang2009’.
- Returns:
A function which compute the vertical-to-horizontal axis ratio given a particle diameter in mm.
- Return type:
callable
Notes
This function serves as a wrapper to various axis ratio models for raindrops. It returns the appropriate model based on the model parameter.
Please note that the axis ratio function to be provided to pyTmatrix expects to return a horizontal-to-vertical axis ratio !
- disdrodb.scattering.axis_ratio.get_axis_ratio_parsivel(diameter)[source][source]#
Compute the axis ratio of raindrops as used by OTT Parsivel sensors.
This axis ratio is assumed by OTT Parsivel sensors internally to compute the reported particle size (Deq).
- Parameters:
diameter (array-like) – Diameter of the raindrops in millimeters.
- Returns:
axis_ratio – Calculated axis ratios corresponding to the input diameters.
- Return type:
array-like
Notes
For diameters less than or equal to 1 mm, the axis ratio is constant at 1.0.
For diameters greater than or equal to 5 mm, the axis ratio is constant at 0.7.
Between 1 mm and 5 mm, the axis ratio varies linearly.
The axis ratio is calculated using the equation:
axis_ratio = 1.075 - 0.075 * D
where D is the diameter in millimeters.
References
Battaglia, A., Rustemeier, E., Tokay, A., Blahak, U., & Simmer, C. (2010). PARSIVEL Snow Observations: A Critical Assessment. Journal of Atmospheric and Oceanic Technology, 27(2), 333-344. https://doi.org/10.1175/2009JTECHA1332.1
- disdrodb.scattering.axis_ratio.get_axis_ratio_pruppacher_1970(diameter)[source][source]#
Compute the axis ratio of raindrops using the Pruppacher and Pitter (1971) model.
- Parameters:
diameter (array-like) – Diameter of the raindrops in millimeters.
- Returns:
axis_ratio – Calculated axis ratios corresponding to the input diameters.
- Return type:
array-like
Notes
This formula is a linear fit to wind tunnel data of Pruppacher and Pitter (1971) with drop diameters between 1 and 9 mm.
References
Pruppacher, H. R., & Pitter, R. L. (1971). A Semi-Empirical Determination of the Shape of Cloud and Precipitation Drops. Journal of the Atmospheric Sciences, 28(1), 86-94. https://doi.org/10.1175/1520-0469(1971)028<0086:ASEDOT>2.0.CO;2
- disdrodb.scattering.axis_ratio.get_axis_ratio_thurai_2005(diameter)[source][source]#
Compute the axis ratio of raindrops using the Thurai et al. (2005) model.
This model is assumed to be valid only for particles up to 5 mm.
- Parameters:
diameter (array-like) – Diameter of the raindrops in millimeters.
- Returns:
axis_ratio – Calculated axis ratios corresponding to the input diameters.
- Return type:
array-like
References
Thurai, M., and V. N. Bringi, 2005: Drop Axis Ratios from a 2D Video Disdrometer. J. Atmos. Oceanic Technol., 22, 966-978, https://doi.org/10.1175/JTECH1767.1
- disdrodb.scattering.axis_ratio.get_axis_ratio_thurai_2007(diameter)[source][source]#
Compute the axis ratio of raindrops using the Thurai et al. (2007) model.
- Parameters:
diameter (array-like) – Diameter of the raindrops in millimeters.
- Returns:
axis_ratio – Calculated axis ratios corresponding to the input diameters.
- Return type:
array-like
References
Thurai, M., G. J. Huang, V. N. Bringi, W. L. Randeu, and M. Schönhuber, 2007: Drop Shapes, Model Comparisons, and Calculations of Polarimetric Radar Parameters in Rain. J. Atmos. Oceanic Technol., 24, 1019-1032, https://doi.org/10.1175/JTECH2051.1
disdrodb.scattering.permittivity module#
Implement particle permittivity models.
- disdrodb.scattering.permittivity.available_permittivity_models()[source][source]#
Return a list of the available raindrops complex refractive index models.
- disdrodb.scattering.permittivity.check_frequency_validity_range(frequency, vmin, vmax, permittivity_model)[source][source]#
Check frequency validity range.
- disdrodb.scattering.permittivity.check_permittivity_model(permittivity_model)[source][source]#
Check validity of the specified complex refractive index model.
- disdrodb.scattering.permittivity.check_temperature_validity_range(temperature, vmin, vmax, permittivity_model)[source][source]#
Check temperature validity range.
- disdrodb.scattering.permittivity.ensure_array(arr)[source][source]#
Ensure data to be a numpy array or xarray DataArray.
- disdrodb.scattering.permittivity.get_rain_refractive_index_ellison2007(temperature, frequency)[source][source]#
Compute the complex refractive index according to Ellison (2005) model.
- Parameters:
temperature (array-like) – Temperature in degree Celsius.
frequency (array-like) – Frequency in GHz.
- Returns:
m – Complex refractive index at requested temperature and frequency.
- Return type:
array-like
Notes
The model is designed to operate only up to 1000 GHz and temperature ranging from 0 degC to 100 degC. The code of this function has been derived from Davide Ori raincoat code available at OPTIMICe-team/raincoat
References
W. J. Ellison (2007). Permittivity of Pure Water, at Standard Atmospheric Pressure, over the Frequency Range 0-25 THz and the Temperature Range 0-100 °C. J. Phys. Chem. Ref. Data, 36, 1-18. https://doi.org/10.1063/1.2360986
- disdrodb.scattering.permittivity.get_rain_refractive_index_liebe1991(temperature, frequency)[source][source]#
Compute the complex refractive index according to the double Debye model of Liebe et al. (1991).
- Parameters:
temperature (array-like) – Temperature in degree Celsius.
frequency (array-like) – Frequency in GHz.
- Returns:
m – Complex refractive index at requested temperature and frequency.
- Return type:
array-like
Notes
The code of this function has been derived from pyradsim code of Daniel Wolfensberger available at wolfidan/pyradsim The Liebe et al. (1991) replaces the work of Ray et al. (1972).
References
H. J. Liebe, G. A. Hufford, and T. Manabe (1991). A model for the complex permittivity of water at frequencies below 1 THz. Journal of Atmospheric and Oceanic Technology, 27(2), 333-344. Int. J. Infrared Millim. Waves, 12(7), 659-675. https://doi.org/10.1007/BF01008897
Peter S. Ray (1972). Broadband Complex Refractive Indices of Ice and Water. Applied Optics, 11(8), 1836-1844. https://doi.org/10.1364/AO.11.001836
- disdrodb.scattering.permittivity.get_rain_refractive_index_liebe1991_single(temperature, frequency)[source][source]#
Compute the complex refractive index according to the single Debye model of Liebe et al. (1991).
- Parameters:
temperature (array-like) – Temperature in degree Celsius.
frequency (array-like) – Frequency in GHz.
- Returns:
m – Complex refractive index at requested temperature and frequency.
- Return type:
array-like
Notes
The code of this function has been derived from RainSense code of Thomas van Leth available at temperatureCvanLeth/RainSense
References
H. J. Liebe, G. A. Hufford, and T. Manabe (1991). A model for the complex permittivity of water at frequencies below 1 THz. Journal of Atmospheric and Oceanic Technology, 27(2), 333-344. Int. J. Infrared Millim. Waves, 12(7), 659-675. https://doi.org/10.1007/BF01008897
- disdrodb.scattering.permittivity.get_rain_refractive_index_turner2016(frequency, temperature)[source][source]#
Compute the complex refractive index using the Turner-Kneifel-Cadeddu (TKC) model.
The TKC supercooled liquid water absorption model was built using both laboratory observations (primarily at warm temperature) and field data observed by MWRs at multiple frequency at supercool temperature. The field data were published in Kneifel et al. (2014).
The strength of the TKC model is the use of an optimal estimation framework to determine the empirical coefficients of the double-Debye model. A full description of this model is given in Turner et al. (2016).
- Parameters:
temperature (array-like) – Temperature in degree Celsius.
frequency (array-like) – Frequency in GHz.
- Returns:
m – Complex refractive index at given temperature and frequency.
- Return type:
array-like
Notes
The code of this function has been checked against Joseph Hardin pyDSD and Davide Ori raincoat codes available at: josephhardinee/PyDSD OPTIMICe-team/raincoat
References
Turner, D.D., S. Kneifel, and M.P. Cadeddu (2016). An improved liquid water absorption model in the microwave for supercooled liquid clouds. J. Atmos. Oceanic Technol., 33(1), 33-44. https://doi.org/10.1175/JTECH-D-15-0074.1.
Kneifel, S., S. Redl, E. Orlandi, U. Löhnert, M. P. Cadeddu, D. D. Turner, and M. Chen (2014). Absorption Properties of Supercooled Liquid Water between 31 and 225 GHz: Evaluation of Absorption Models Using Ground-Based Observations. J. Appl. Meteor. Climatol., 53, 1028-1045. https://doi.org/10.1175/JAMC-D-13-0214.1
- disdrodb.scattering.permittivity.get_rayleigh_dielectric_factor(m)[source][source]#
Compute the Rayleigh dielectric factor \(|K|^2\) from the complex refractive index.
The magnitude squared of the complex dielectric constant factor for liquid water, relative to the surrounding medium (typically air).
This factor is used to compute the radar reflectivity.
- disdrodb.scattering.permittivity.get_refractive_index(temperature, frequency, permittivity_model)[source][source]#
Compute the complex refractive index of raindrops using the specified permittivity model.
The complex refractive index of a hydrometeor (e.g., water droplet, ice particle, graupel) governs how radar waves interact with it. The real part determines how much the radar wave slows down inside the particle (phase shift) The imaginary part determines how much the radar wave is absorbed and attenuated by the particle The imaginary part thus describes how much energy is lost as the wave travels through the particle. The imaginary part thus controls radar attenuation and depolarization effects. A large imaginary part leads to weaker returned signals, especially at shorter wavelengths.
The square root of the complex refractive index corresponds to the complex relative permittivity, also known as the complex dielectric constant.
- Parameters:
temperature (array-like) – Temperature in degree Celsius.
frequency (float) – Frequency in GHz.
permittivity_model (str) – The permittivity model to use for calculating the complex refractive index. Available models are: ‘Liebe1991’, ‘Liebe1991v2’, ‘Ellison2007’, ‘Turner2016’, ‘Turner2016SLC’. See available models with
disdrodb.scattering.available_permittivity_models().
- Returns:
m – Complex refractive index of raindrop at given temperature and frequency.
- Return type:
array-like
Notes
This function serves as a wrapper to various permittivity models for raindrops. It selects and applies the appropriate model based on the permittivity_model parameter.
Examples
>>> temperature = np.array([0.5, 1.0, 2.0, 3.0]) >>> frequency = 5.6 # GhZ (C band) >>> m = get_refractive_index(temperature=temperature, frequency=frequency, permittivity_model="Liebe1991")
- disdrodb.scattering.permittivity.get_refractive_index_function(permittivity_model)[source][source]#
Return the specified model estimating the complex refractive index of rain drops.
The complex refractive index of a hydrometeor (e.g., water droplet, ice particle, graupel) governs how radar waves interact with it. The real part determines how much the radar wave slows down inside the particle (phase shift) The imaginary part determines how much the radar wave is absorbed and attenuated by the particle The imaginary part thus describes how much energy is lost as the wave travels through the particle. The imaginary part thus controls radar attenuation and depolarization effects. A large imaginary part leads to weaker returned signals, especially at shorter wavelengths.
The square root of the complex refractive index corresponds to the complex relative permittivity, also known as the complex dielectric constant.
- Parameters:
model (str) – The model to use for calculating the complex refractive index. Available models are: ‘Liebe1991’, ‘Liebe1991v2’, ‘Ellison2007’, ‘Turner2016’, ‘Turner2016SLC’.
- Returns:
A function which compute the complex refractive index for given temperature and frequency.
- Return type:
callable
Notes
This function serves as a wrapper to various complex refractive index models for raindrops. It returns the appropriate model based on the model parameter.
disdrodb.scattering.routines module#
Implement PSD scattering routines.
- disdrodb.scattering.routines.available_radar_bands()[source][source]#
Return a list of the available radar bands.
- disdrodb.scattering.routines.calculate_scatterer(frequency, num_points=1024, diameter_min=0, diameter_max=8, canting_angle_std=7, axis_ratio_model='Thurai2007', water_temperature=10, permittivity_model='Turner2016', elevation_angle=0)[source][source]#
Compute T-matrix scatterer object for a given frequency.
- Parameters:
frequency (float) – Radar frequency in GHz.
num_points (int, optional) – Number of bins into which discretize the PSD. The default is 1024.
diameter_min (float, optional) – Minimum drop diameter in millimeters for the scattering table. The default is 0 mm.
diameter_max (float, optional) – Maximum drop diameter in millimeters for the scattering table. The default is 8 mm.
canting_angle_std (float, optional) – Standard deviation of the canting angle distribution in degrees. The default is 7 degrees.
axis_ratio_model (str, optional) – Axis ratio model used to shape hydrometeors. The default is
"Thurai2007". See available models withdisdrodb.scattering.available_axis_ratio_models().water_temperature (float, optional) – Water temperature in degree Celsius to be used in the permittivity model. The default is 10 degC.
permittivity_model (str, optional) – Permittivity model to use to compute the refractive index and the rayleigh_dielectric_factor. The default is
Turner2016. See available models withdisdrodb.scattering.available_permittivity_models().elevation_angle (float, optional) – Radar elevation angle in degrees. Specify 90 degrees for vertically pointing radars. The default is 0 degrees.
- Returns:
A scatterer object with the PSD integrator configured and scattering table loaded or generated.
- Return type:
pytmatrix.Scatterer
- disdrodb.scattering.routines.check_radar_band(radar_band)[source][source]#
Check the validity of the specified radar band.
- disdrodb.scattering.routines.compute_radar_variables(scatterer)[source][source]#
Compute radar variables for a given scatter object with a specified PSD.
To speed up computations, this function should input a scatterer object with a preinitialized scattering table.
Note
If this function is modified to compute additional radar variables, the global variable RADAR_VARIABLES must be updated accordingly !
- disdrodb.scattering.routines.create_pytmatrix_lut(frequency, num_points, diameter_min, diameter_max, canting_angle_std, axis_ratio_model, permittivity_model, water_temperature, elevation_angle, lut_path, verbose=False)[source][source]#
Create a pyTMatrix LUT at lut_path if it does not exist yet.
- disdrodb.scattering.routines.ensure_numerical_frequency(frequency)[source][source]#
Ensure that the frequencies are numerical values in GHz.
- disdrodb.scattering.routines.ensure_rounded_unique_array(arr, decimals=None)[source][source]#
Ensure that the input array is a unique, rounded array.
- disdrodb.scattering.routines.frequency_to_wavelength(frequency)[source][source]#
Convert frequency in GHz to wavelength millimeters.
- disdrodb.scattering.routines.get_backward_geometry(elevation_angle)[source][source]#
Define backward geometry given a radar elevation angle.
- disdrodb.scattering.routines.get_empirical_radar_parameters(ds, frequency, num_points=1024, diameter_min=0, diameter_max=10, canting_angle_std=7, axis_ratio_model='Thurai2007', permittivity_model='Turner2016', water_temperature=10, elevation_angle=0)[source][source]#
Compute radar parameters from an empirical drop number concentration.
This function retrieve values for a single set of parameter only !
- Parameters:
ds (xarray.Dataset) – Dataset containing the drop number concentration variable.
frequency (float) – Frequency in GHz for which to compute the radar parameters.
num_points (int, optional) – Number of bins into which discretize the PSD. The default is 1024.
diameter_min (float, optional) – Minimum diameter. The default value is 0 mm.
diameter_max (float, optional) – Maximum diameter. The default value is 10 mm.
canting_angle_std (float, optional) – Standard deviation of the canting angle. The default value is 7 degrees.
axis_ratio_model (str, optional) – Axis ratio model used to shape hydrometeors. The default is
"Thurai2007". See available models withdisdrodb.scattering.available_axis_ratio_models().permittivity_model (str, optional) – Permittivity model to use to compute the refractive index and the rayleigh_dielectric_factor. The default is
Turner2016. See available models withdisdrodb.scattering.available_permittivity_models().water_temperature (float, optional) – Water temperature in degree Celsius to be used in the permittivity model. The default is 10 degC.
elevation_angle (float, optional) – Radar elevation angle in degrees. Specify 90 degrees for vertically pointing radars. The default is 0 degrees.
- Returns:
Dataset containing the computed radar parameters.
- Return type:
- disdrodb.scattering.routines.get_forward_geometry(elevation_angle)[source][source]#
Define forward geometry given a radar elevation angle.
- disdrodb.scattering.routines.get_list_simulations_params(frequency, num_points, diameter_min, diameter_max, canting_angle_std, axis_ratio_model, permittivity_model, water_temperature, elevation_angle)[source][source]#
Return list with the set of parameters required for each simulation.
- disdrodb.scattering.routines.get_model_radar_parameters(ds, frequency, num_points=1024, diameter_min=0, diameter_max=10, canting_angle_std=7, axis_ratio_model='Thurai2007', permittivity_model='Turner2016', water_temperature=10, elevation_angle=0)[source][source]#
Compute radar parameters from a PSD model.
This function retrieve values for a single set of parameter only !
- Parameters:
ds (xarray.Dataset) – Dataset containing the parameters of the PSD model. The dataset attribute disdrodb_psd_model specifies the PSD model to use.
frequency (float) – Frequency in GHz for which to compute the radar parameters.
num_points (int, optional) – Number of bins into which discretize the PSD. The default is 1024.
diameter_min (float, optional) – Minimum diameter. The default value is 0 mm.
diameter_max (float, optional) – Maximum diameter. The default value is 10 mm.
canting_angle_std (float, optional) – Standard deviation of the canting angle. The default value is 7 degrees.
axis_ratio_model (str, optional) – Axis ratio model used to shape hydrometeors. The default is
"Thurai2007". See available models withdisdrodb.scattering.available_axis_ratio_models().permittivity_model (str, optional) – Permittivity model to use to compute the refractive index and the rayleigh_dielectric_factor. The default is
Turner2016. See available models withdisdrodb.scattering.available_permittivity_models().water_temperature (float, optional) – Water temperature in degree Celsius to be used in the permittivity model. The default is 10 degC.
elevation_angle (float, optional) – Radar elevation angle in degrees. Specify 90 degrees for vertically pointing radars. The default is 0 degrees.
- Returns:
Dataset containing the computed radar parameters.
- Return type:
- disdrodb.scattering.routines.get_radar_parameters(ds, frequency=None, num_points=1024, diameter_min=0, diameter_max=8, canting_angle_std=7, axis_ratio_model='Thurai2007', permittivity_model='Turner2016', water_temperature=10, elevation_angle=0, parallel=True)[source][source]#
Compute radar parameters from empirical drop number concentration or PSD model.
- Parameters:
ds (xarray.Dataset) – Dataset containing the drop number concentration variable.
frequency (str, float, or list of str or float, optional) – Frequencies in GHz for which to compute the radar parameters. Alternatively, also strings can be used to specify common radar frequencies. If
None, the common radar frequencies will be used. Seedisdrodb.scattering.available_radar_bands().num_points (int or list of int, optional) – Number of bins into which discretize the PSD.
diameter_min (float or list of float, optional) – Minimum diameter. The default value is 0 mm.
diameter_max (float or list of float, optional) – Maximum diameter. The default value is 8 mm.
canting_angle_std (float or list of float, optional) – Standard deviation of the canting angle. The default value is 7.
axis_ratio_model (str or list of str, optional) – Models to compute the axis ratio. The default model is
Thurai2007. See available models withdisdrodb.scattering.available_axis_ratio_models().permittivity_model (str or list of str, optional) – Permittivity model to use to compute the refractive index and the rayleigh_dielectric_factor. The default is
Turner2016. See available models withdisdrodb.scattering.available_permittivity_models().water_temperature (float or list of float, optional) – Water temperature in degree Celsius to be used in the permittivity model. The default is 10 degC.
elevation_angle (float or list of float, optional) – Radar elevation angles in degrees. Specify 90 degrees for vertically pointing radars. The default is 0 degrees.
parallel (bool, optional) – Whether to compute radar variables in parallel. The default value is
True.
- Returns:
Dataset containing the computed radar parameters.
- Return type:
- disdrodb.scattering.routines.initialize_scatterer(frequency, num_points=1024, diameter_min=0, diameter_max=8, canting_angle_std=7, axis_ratio_model='Thurai2007', water_temperature=10, permittivity_model='Turner2016', elevation_angle=0)[source][source]#
Initialize T-matrix scatterer object for a given frequency.
This function does not compute the scattering table ! Please use calculate_scatter to directly compute the scattering table. In load_scatterer a precomputed scattering table is attached to the scatter object initialized by this function.
- Parameters:
frequency (float) – Radar frequency in GHz.
num_points (int, optional) – Number of bins into which discretize the PSD. The default is 1024.
diameter_min (float, optional) – Minimum drop diameter in millimeters for the scattering table. The default is 0 mm.
diameter_max (float, optional) – Maximum drop diameter in millimeters for the scattering table. The default is 8 mm.
canting_angle_std (float, optional) – Standard deviation of the canting angle distribution in degrees. The default is 7 degrees.
axis_ratio_model (str, optional) – Axis ratio model used to shape hydrometeors. The default is
"Thurai2007". See available models withdisdrodb.scattering.available_axis_ratio_models().water_temperature (float, optional) – Water temperature in degree Celsius to be used in the permittivity model. The default is 10 degC.
permittivity_model (str, optional) – Permittivity model to use to compute the refractive index and the rayleigh_dielectric_factor. The default is
Turner2016. See available models withdisdrodb.scattering.available_permittivity_models().elevation_angle (float, optional) – Radar elevation angle in degrees. Specify 90 degrees for vertically pointing radars. The default is 0 degrees.
- Returns:
A scatterer object with the PSD integrator configured and scattering table loaded or generated.
- Return type:
pytmatrix.Scatterer
- disdrodb.scattering.routines.load_scatterer(frequency, num_points=1024, diameter_min=0, diameter_max=8, canting_angle_std=7, axis_ratio_model='Thurai2007', permittivity_model='Turner2016', water_temperature=10, elevation_angle=0, scattering_table_dir=None, verbose=False)[source][source]#
Load a scatterer object with cached scattering table.
If the scattering table does not exist at the specified location, it will be created (in a new python process) and saved to disk. If the scattering table file is found, it will be loaded and used to configure the scatterer.
ATTENTION: WE PREGENERATE SCATTERING TABLE EACH TIME IN A NEW PYTHON PROCESS BECAUSE WE NOTICED THAT IF SCATTERING SIMULATIONS PARAMETERS ARE CHANGED IN THE SAME PYTHON PROCESS, EVERY RANDOM N PARAMETERS CHANGES, PYTMATRIX START TO GENERATE BAD TMATRIX SCATTERING TABLES. THE ROOT CAUSE OF THIS BUG COULD NOT BE IDENTIFIED !
- Parameters:
frequency (float) – Radar frequency in GHz.
num_points (int, optional) – Number of bins into which discretize the PSD. The default is 1024.
diameter_min (float, optional) – Minimum drop diameter in millimeters for the scattering table. The default is 0 mm.
diameter_max (float, optional) – Maximum drop diameter in millimeters for the scattering table. The default is 8 mm.
canting_angle_std (float, optional) – Standard deviation of the canting angle distribution in degrees. The default is 7 degrees.
axis_ratio_model (str, optional) – Axis ratio model used to shape hydrometeors. The default is
"Thurai2007". See available models withdisdrodb.scattering.available_axis_ratio_models().permittivity_model (str, optional) – Permittivity model to use to compute the refractive index and the rayleigh_dielectric_factor. The default is
Turner2016. See available models withdisdrodb.scattering.available_permittivity_models().water_temperature (float, optional) – Water temperature in degree Celsius to be used in the permittivity model. The default is 10 degC.
elevation_angle (float, optional) – Radar elevation angle in degrees. Specify 90 degrees for vertically pointing radars. The default is 0 degrees.
scattering_table_dir (str or pathlib.Path, optional) – Directory path where T-Matrix scattering tables are stored. If None, the default location will be used.
verbose (bool, optional) – Whether to verbose the computation of the scattering table. The default is False.
- Returns:
A scatterer object with the PSD integrator configured and scattering table loaded or generated.
- Return type:
pytmatrix.Scatterer
- disdrodb.scattering.routines.precompute_scattering_tables(frequency, num_points, diameter_min, diameter_max, canting_angle_std, axis_ratio_model, permittivity_model, water_temperature, elevation_angle, verbose=True)[source][source]#
Precompute the pyTMatrix scattering tables required for radar variables simulations.
- Parameters:
frequency (float or list of float) – Radar frequency or frequencies in GHz.
num_points (int or list of int) – Number of bins into which discretize the PSD.
diameter_min (float or list of float) – Minimum drop diameter in millimeters for the scattering table.
diameter_max (float or list of float) – Maximum drop diameter in millimeters for the scattering table.
canting_angle_std (float or list of float) – Standard deviation of the canting angle distribution in degrees.
axis_ratio_model (str or list of str) – Axis ratio model(s) used to shape hydrometeors. See available models with
disdrodb.scattering.available_axis_ratio_models().permittivity_model (str or list of str) – Permittivity model(s) to use to compute the refractive index and the rayleigh_dielectric_factor. See available models with
disdrodb.scattering.available_permittivity_models().water_temperature (float or list of float) – Water temperature(s) in degree Celsius to be used in the permittivity model.
elevation_angle (float or list of float) – Radar elevation angle(s) in degrees. Specify 90 degrees for vertically pointing radars.
verbose (bool, optional) – Whether to verbose the computation of the scattering tables. The default is True.
Module contents#
Implement PSD scattering routines.
- disdrodb.scattering.available_axis_ratio_models()[source][source]#
Return a list of the available drop axis ratio models.
- disdrodb.scattering.available_permittivity_models()[source][source]#
Return a list of the available raindrops complex refractive index models.
- disdrodb.scattering.available_radar_bands()[source][source]#
Return a list of the available radar bands.
- disdrodb.scattering.get_axis_ratio_model(model)[source][source]#
Return the specified drop axis ratio model.
- Parameters:
model (str) – The model to use for calculating the axis ratio. Available models are: ‘Thurai2005’, ‘Thurai2007’, ‘Parsivel’, ‘Brandes2002’, ‘Pruppacher1970’, ‘Beard1987’, ‘Andsager1999’, ‘Chang2009’.
- Returns:
A function which compute the vertical-to-horizontal axis ratio given a particle diameter in mm.
- Return type:
callable
Notes
This function serves as a wrapper to various axis ratio models for raindrops. It returns the appropriate model based on the model parameter.
Please note that the axis ratio function to be provided to pyTmatrix expects to return a horizontal-to-vertical axis ratio !
- disdrodb.scattering.get_radar_parameters(ds, frequency=None, num_points=1024, diameter_min=0, diameter_max=8, canting_angle_std=7, axis_ratio_model='Thurai2007', permittivity_model='Turner2016', water_temperature=10, elevation_angle=0, parallel=True)[source][source]#
Compute radar parameters from empirical drop number concentration or PSD model.
- Parameters:
ds (xarray.Dataset) – Dataset containing the drop number concentration variable.
frequency (str, float, or list of str or float, optional) – Frequencies in GHz for which to compute the radar parameters. Alternatively, also strings can be used to specify common radar frequencies. If
None, the common radar frequencies will be used. Seedisdrodb.scattering.available_radar_bands().num_points (int or list of int, optional) – Number of bins into which discretize the PSD.
diameter_min (float or list of float, optional) – Minimum diameter. The default value is 0 mm.
diameter_max (float or list of float, optional) – Maximum diameter. The default value is 8 mm.
canting_angle_std (float or list of float, optional) – Standard deviation of the canting angle. The default value is 7.
axis_ratio_model (str or list of str, optional) – Models to compute the axis ratio. The default model is
Thurai2007. See available models withdisdrodb.scattering.available_axis_ratio_models().permittivity_model (str or list of str, optional) – Permittivity model to use to compute the refractive index and the rayleigh_dielectric_factor. The default is
Turner2016. See available models withdisdrodb.scattering.available_permittivity_models().water_temperature (float or list of float, optional) – Water temperature in degree Celsius to be used in the permittivity model. The default is 10 degC.
elevation_angle (float or list of float, optional) – Radar elevation angles in degrees. Specify 90 degrees for vertically pointing radars. The default is 0 degrees.
parallel (bool, optional) – Whether to compute radar variables in parallel. The default value is
True.
- Returns:
Dataset containing the computed radar parameters.
- Return type:
- disdrodb.scattering.get_refractive_index(temperature, frequency, permittivity_model)[source][source]#
Compute the complex refractive index of raindrops using the specified permittivity model.
The complex refractive index of a hydrometeor (e.g., water droplet, ice particle, graupel) governs how radar waves interact with it. The real part determines how much the radar wave slows down inside the particle (phase shift) The imaginary part determines how much the radar wave is absorbed and attenuated by the particle The imaginary part thus describes how much energy is lost as the wave travels through the particle. The imaginary part thus controls radar attenuation and depolarization effects. A large imaginary part leads to weaker returned signals, especially at shorter wavelengths.
The square root of the complex refractive index corresponds to the complex relative permittivity, also known as the complex dielectric constant.
- Parameters:
temperature (array-like) – Temperature in degree Celsius.
frequency (float) – Frequency in GHz.
permittivity_model (str) – The permittivity model to use for calculating the complex refractive index. Available models are: ‘Liebe1991’, ‘Liebe1991v2’, ‘Ellison2007’, ‘Turner2016’, ‘Turner2016SLC’. See available models with
disdrodb.scattering.available_permittivity_models().
- Returns:
m – Complex refractive index of raindrop at given temperature and frequency.
- Return type:
array-like
Notes
This function serves as a wrapper to various permittivity models for raindrops. It selects and applies the appropriate model based on the permittivity_model parameter.
Examples
>>> temperature = np.array([0.5, 1.0, 2.0, 3.0]) >>> frequency = 5.6 # GhZ (C band) >>> m = get_refractive_index(temperature=temperature, frequency=frequency, permittivity_model="Liebe1991")
- disdrodb.scattering.load_scatterer(frequency, num_points=1024, diameter_min=0, diameter_max=8, canting_angle_std=7, axis_ratio_model='Thurai2007', permittivity_model='Turner2016', water_temperature=10, elevation_angle=0, scattering_table_dir=None, verbose=False)[source][source]#
Load a scatterer object with cached scattering table.
If the scattering table does not exist at the specified location, it will be created (in a new python process) and saved to disk. If the scattering table file is found, it will be loaded and used to configure the scatterer.
ATTENTION: WE PREGENERATE SCATTERING TABLE EACH TIME IN A NEW PYTHON PROCESS BECAUSE WE NOTICED THAT IF SCATTERING SIMULATIONS PARAMETERS ARE CHANGED IN THE SAME PYTHON PROCESS, EVERY RANDOM N PARAMETERS CHANGES, PYTMATRIX START TO GENERATE BAD TMATRIX SCATTERING TABLES. THE ROOT CAUSE OF THIS BUG COULD NOT BE IDENTIFIED !
- Parameters:
frequency (float) – Radar frequency in GHz.
num_points (int, optional) – Number of bins into which discretize the PSD. The default is 1024.
diameter_min (float, optional) – Minimum drop diameter in millimeters for the scattering table. The default is 0 mm.
diameter_max (float, optional) – Maximum drop diameter in millimeters for the scattering table. The default is 8 mm.
canting_angle_std (float, optional) – Standard deviation of the canting angle distribution in degrees. The default is 7 degrees.
axis_ratio_model (str, optional) – Axis ratio model used to shape hydrometeors. The default is
"Thurai2007". See available models withdisdrodb.scattering.available_axis_ratio_models().permittivity_model (str, optional) – Permittivity model to use to compute the refractive index and the rayleigh_dielectric_factor. The default is
Turner2016. See available models withdisdrodb.scattering.available_permittivity_models().water_temperature (float, optional) – Water temperature in degree Celsius to be used in the permittivity model. The default is 10 degC.
elevation_angle (float, optional) – Radar elevation angle in degrees. Specify 90 degrees for vertically pointing radars. The default is 0 degrees.
scattering_table_dir (str or pathlib.Path, optional) – Directory path where T-Matrix scattering tables are stored. If None, the default location will be used.
verbose (bool, optional) – Whether to verbose the computation of the scattering table. The default is False.
- Returns:
A scatterer object with the PSD integrator configured and scattering table loaded or generated.
- Return type:
pytmatrix.Scatterer