Go back to documentation Homepage

3.2.5. ssrga

This module contains two functions that are used to derive SSRGA parameters kappa, beta, gamma, zeta and alpha_eff from a set of particle shapes. Follow the SSRGA example to understand how to use it.

The first function area_function computes the number of mass elements in the shapefile along a specific direction defined by the zenith angle theta. It is assumed that the shapefiles hold measuring units (not normalized). Particles are oriented and assumed to take random orientation along the vertical z axis. If the direction along which the area_function is computed is off the vertical Nphi*sin(theta) number of samples are taken. As an example if theta=0.5pi (horizontal), the area_function is calculated along Nphi (default 32) equally spaced azimuth directions.

The second function fitSSRGA takes an array of normalized area functions calculated by the previous function and fit the SSRGA parameters. Optionally it can also produce the plots of the fits of the mean shape and the power spectrum of the fluctuations around the mean shape. By looking at the plots it is possible to have a qualitative assessment of the goodness of the fits.

snowScatt.ssrga._ssrgaFit.area_function(shape, resolution, Dmax, theta=0.0, Nphi=32)[source]

Calculate unnormalized area functions along the specified sampling directions.

Parameters:
  • shape (array(Nvoxels, 3) - double) – voxelization of the snowflake shape. The shape is not projected onto a regular grid (DDA shapefile). The voxels are spaced by the resolution
  • resolution (scalar - double) – the resolution of the regular grid
  • Dmax (scalar - double) – 3D maximum size of the particle. Dmax/resolution serve the only scope of constraining the size of the area function
  • theta (array-like or scalar) – distribution of polar angle along which the area function is derived. If scalar value the polar angle is considered to be fixed.
  • Nphi (scalar - integer) – maximum number of subdivisions of the azimuth angle (i.e. around theta=0.5pi). This maximum number of subdivisions is scaled by sin(theta) to account for the pole singularity
Returns:

area_func – vector of area functions along the Nsamples direction samples.

Return type:

(Nsamples, Nbins) - integer

snowScatt.ssrga._ssrgaFit.fitSSRGA(A, Dmax, voxel_spacing, max_index_largescale=12, do_plots=False, plots_path=None)[source]

Fit SSRGA parameter kappa, beta, gamma, zeta

Parameters:
  • A (2D array(Nparticles*Nsamples, Nbins) - integer) – List of area functions. Linearized representation of the aggregate mass distribution along the propagation direction. The propagation direction is sampled in Nbins intervals. The array contain the integer number of dipoles belonging to each bin. For each particles there might be multiple samples (orientations when theta!=0). The particle legnth along the propagation direction can be inferred from the length of valid area functions. The bin spacing is first assumed to be equal to the corresponding voxel_spacing.
  • Dmax (array(Nparticles) - double) – List of maximum diameter values, one per particle [meters]
  • voxel_spacing (array(Nparticles) - double) – List or volume element resolutions, one per particle [meters]. Particles might have different resolutions
  • max_index_largescale (scalar double) – Maximum order of the power spectrum taken into account for the fit of gamma and beta parameters
  • do_plots (bool) – If True plots the average shape and the power spectrum fits
  • plots_path (string) – If not None, save the plots at the specified path. Appends a meaningful suffix and uses .png format
Returns:

  • kappa (scalar double) – Kurtosis parameter kappa of the mean shape of the aggregates
  • beta (scalar double) – beta parameter. Intercept of the power spectrum of the deviations from the mean shape as a log power-law fit.
  • gamma (scalar double) – gamma parameter. Average slope of the first portion of the power spectrum of the deviations from the mean shape as a log power-law fit
  • zeta (scalar double) – zeta parameter. Ratio between the actual first element of the power spectrum of the deviations from the mean and the one calculated from the power-law fit
  • alpha_eff (scalar double) – effective aspect ratio of the particle. Scaling between the actual size along the propagation direction and the characteristic size of the snowflake (here assumed to be Dmax). TODO: perhaps it is better to use the nominal size? -> surely not if the parameters are derived for a large population of particles (not binned)
  • volume (scalar double) – mean volume occupied by the particle (mass/ice_density here computed as Nvoxel*voxel_spacing**3)

Raises:

AttributeError : if the list of arguments has some problems