Go back to documentation Homepage

3.2.4. instrumentSimulator

This module provides an easy implementation of common microwave remote sensing instrument forward models. The focus is rapid development and not accuracy of computation. So far only a simplicistic radar Doppler and moments simulator has been implemented. The module also implements a series of conveniency functions to formulate common used particle size distributions

3.2.4.1. Radar Module

3.2.4.1.1. Radar Spectrum

snowScatt.instrumentSimulator.radarSpectrum.dopplerSpectrum(diameters, psd, wavelength, properties, ref_index=None, temperature=None, mass=None, theta=0.0, dopplerVel=None)[source]

radar Doppler spectrum simulator

Simulates the Doppler spectrum of the reflectivity given the particle properties and the PSD

Parameters:
  • diameters (array(Nparticles) - double) – spectrum of diameters of the particles [meters]
  • psd (callable) – size distribution of the particle concentration [meters**-1 meters**-3]
  • wavelength (scalar - double) – electromagnetic wavelength to be passed to the snowScatt properties calculator
  • ref_index (scalar - complex (default to None)) – complex refractive index of ice to be passed to the snowScatt properties calculator
  • temperature (scalar - double) – absolute temperature, alternative formulation of ref_index when ref_index is None to be passed to the snowScatt properties calculator
  • mass (array(Nparticles) - double) – mass of the snowflakes to be passed to the snowScatt properties calculator if left None the mass is derived by the snowLibrary properties
  • theta (scalar - double) – zenith incident angle of the electromagnetic radiation, to be passed to the snowScatt properties calculator
  • dopplerVel (array(Nparticles) - double) – override spectrum of Doppler velocities if left None the Doppler velocities are calculated from the particle properties.
Returns:

  • spectrum (array(Nparticles) - double) – specific radar reflectivity size spectrum [mm**6 m**-3 (m/s)**-1]
  • dopplerVel (array(Nparticle) - double) – Doppler velocities computed from the spectrum of diamters and sorted in ascending order (not rescaled to a equi-spaced grid)

snowScatt.instrumentSimulator.radarSpectrum.rescaleSpectrum(spectrum, dopplerVel, dopplerGrid)[source]
Rescale uneven spectrum centered over dopplerVel onto a (possibly)
even dopplerGrid

This function implements a basic interpolator of the spectrum defined over the dopplerVel points into the dopplerGrid points. It ensures that the integral (reflectivity) is conserved

Parameters:
  • spectrum (array(Nparticles) - double) – the Doppler spectrum defined over the (uneven) grid of velocities
  • dopplerVel (array(Nparticles) - double) – the (uneven) grid of velocities
  • dopplerGrid (array(Nbins) - double) – the output grid of velocities (possibly equally spaced)
Returns:

rescaledSpectrum – the spectrum rescaled on the new grid

Return type:

array(Nbins) - double

snowScatt.instrumentSimulator.radarSpectrum.sizeSpectrum(diameters, psd, wavelength, properties, ref_index=None, temperature=None, mass=None, theta=0.0)[source]

radar spectrum simulator Simulates the size spectrum of the reflectivity given the particle properties and the PSD

Parameters:
  • diameters (array(Nparticles) - double) – spectrum of diameters of the particles [meters]
  • psd (callable) – size distribution of the particle concentration [meters**-1 meters**-3]
  • wavelength (scalar - double) – electromagnetic wavelength to be passed to the snowScatt properties calculator
  • ref_index (scalar - complex (default to None)) – complex refractive index of ice to be passed to the snowScatt properties calculator
  • temperature (scalar - double) – absolute temperature, alternative formulation of ref_index when ref_index is None to be passed to the snowScatt properties calculator
  • mass (array(Nparticles) - double) – mass of the snowflakes to be passed to the snowScatt properties calculator if left None the mass is derived by the snowLibrary properties
  • theta (scalar - double) – zenith incident angle of the electromagnetic radiation, to be passed to the snowScatt properties calculator
Returns:

spectrum – specific radar reflectivity size spectrum [mm**6 m**-3 m**-1]

Return type:

array(Nparticles) - double

3.2.4.1.2. Radar Moments

snowScatt.instrumentSimulator.radarMoments.Bd(x)[source]

Converts from dB to linear units

Parameters:- ndarray - double (x) – array of values to be converted into linear units
Returns:x array converted to linear units
Return type:Bd(x) - ndarray - double
snowScatt.instrumentSimulator.radarMoments.Ze(diameters, psd, wavelength, properties, ref_index=None, temperature=None, mass=None, theta=0.0, bck=None, K2=None)[source]

radar reflectivity Compute radar reflectivity directly from hydrometeor parameters

Parameters:
  • diameters (array(Nparticles) - double) – spectrum of diameters of the particles [meters]
  • psd (callable) – size distribution of the particle concentration [meters^-1 meters^-3]
  • wavelength (scalar - double) – electromagnetic wavelength to be passed to the snowScatt properties calculator
  • properties (string) – name of the snowflake properties to call from the snowLibrary
  • ref_index (scalar - complex (default to None)) – complex refractive index of ice to be passed to the snowScatt properties calculator
  • temperature (scalar - double) – absolute temperature, alternative formulation of ref_index when ref_index is None to be passed to the snowScatt properties calculator
  • mass (array(Nparticles) - double (default to None)) – mass of the snowflakes to be passed to the snowScatt properties calculator if left None the mass is derived by the snowLibrary properties
  • theta (scalar - double - (default to 0.0 vertical pointing)) – zenith incident angle of the electromagnetic radiation, to be passed to the snowScatt properties calculator
  • bck (array(Nparticles) - double (default to None)) – radar backscattering cross-section [meters**2] override calculation of bck using particle parameters
  • K2 (scalar - double) – Rayleigh dielectric factor K^2 (dimensionless) K = (n^2 - 1)/(n^2 + 2) for the Clausius Mossotti relation override calculation of K2 from dielectric properties (useful for multirequency radar cross-calibration)
Returns:

Z – Radar reflectivity in logaritmic units [dBZ]

Return type:

scalar - double

snowScatt.instrumentSimulator.radarMoments.calcMoments(spectrum, vel, n=4)[source]

calculate moments of spectrum(vel) up to order n. The maximum order implemented is 4 (kurtosis). The moments available are: 0: reflectivity 1: mean Doppler velocity 2: spectrum width 3: skweness 4: kurtosis

Parameters:
  • spectrum (array(Nvel) - double) – specific reflectivity spectrum in linear units (millimeter6 meters-3) !!! be careful this is already multiplied by dV so that sum(spectrum)=Z
  • vel (array(Nvel) - double) – vector of velocities upon which spectrum is defined
  • n (scalar - integer) – maximum order of moments to calculate for any moment n>=1 the 0…n-1 moments have to be calculated anyway so the computational burden does not increase
Returns:

moments – array of Doppler radar moments ordered from 0 to n

Return type:

array(n) - double

Raises:

AttributeError : if the order n is larger than the maximum 4

snowScatt.instrumentSimulator.radarMoments.dB(x)[source]

Converts from linear units to dB

Parameters:- ndarray - double (strictly positive >0) (x) – array of values to be converted into dB
Returns:x array converted to dB
Return type:dB(x) - ndarray - double
snowScatt.instrumentSimulator.radarMoments.specific_reflectivity(wl, bck, K2)[source]

Compute radar specific reflectivity

Parameters:
  • wl (scalar - double) – electromagnetic wavelength [meters]
  • bck (array(Nparticles) - double) – spectrum of radar backscattering cross section [meters2]
  • K2 (scalar - double) – Rayleigh dielectric factor K**2 (dimensionless) K = (n2 - 1)/(n2 + 2) for the Clausius Mossotti relation
Returns:

eta – specific reflectivity in linear units (millimeter6 meters-3)

Return type:

ndarray(Nparticles) - double

3.2.4.2. Particle Size Distributions

class snowScatt.instrumentSimulator.PSD.BinnedPSD(bin_edges, bin_psd)[source]

Binned particle size distribution (PSD).

Callable class to provide a binned PSD with the given bin edges and PSD values.

Args (constructor):
The first argument to the constructor should specify n+1 bin edges, and the second should specify n bin_psd values.
Args (call):
D: the particle diameter.
Returns (call):
The PSD value for the given diameter. Returns 0 for all diameters outside the bins.
class snowScatt.instrumentSimulator.PSD.ExponentialPSD(N0=1.0, Lambda=1.0, D_max=None)[source]

Exponential particle size distribution (PSD).

Callable class to provide an exponential PSD with the given parameters. The attributes can also be given as arguments to the constructor.

The PSD form is: N(D) = N0 * exp(-Lambda*D)

N0

the intercept parameter.

Lambda

the inverse scale parameter

D_max

the maximum diameter to consider (defaults to 11/Lambda, i.e. approx. 3*D0, if None)

Args (call):
D: the particle diameter.
Returns (call):
The PSD value for the given diameter. Returns 0 for all diameters larger than D_max.
class snowScatt.instrumentSimulator.PSD.GammaPSD(D0=1.0, Nw=1.0, mu=0.0, D_max=None)[source]

Normalized gamma particle size distribution (PSD).

Callable class to provide a normalized gamma PSD with the given parameters. The attributes can also be given as arguments to the constructor.

The PSD form is: N(D) = Nw * f(mu) * (D/D0)**mu * exp(-(3.67+mu)*D/D0) f(mu) = 6/(3.67**4) * (3.67+mu)**(mu+4)/Gamma(mu+4)

D0

the median volume diameter.

Nw

the intercept parameter.

mu

the shape parameter.

D_max

the maximum diameter to consider (defaults to 3*D0 when if None)

Args (call):
D: the particle diameter.
Returns (call):
The PSD value for the given diameter. Returns 0 for all diameters larger than D_max.
class snowScatt.instrumentSimulator.PSD.UnnormalizedGammaPSD(N0=1.0, Lambda=1.0, mu=0.0, D_max=None)[source]

Gamma particle size distribution (PSD).

Callable class to provide an gamma PSD with the given parameters. The attributes can also be given as arguments to the constructor.

The PSD form is: N(D) = N0 * D**mu * exp(-Lambda*D)

N0

the intercept parameter.

Lambda

the inverse scale parameter

mu

the shape parameter

D_max

the maximum diameter to consider (defaults to 11/Lambda, i.e. approx. 3*D0, if None)

Args (call):
D: the particle diameter.
Returns (call):
The PSD value for the given diameter. Returns 0 for all diameters larger than D_max.