ipas.lab module

Utilities for running ice particle simulations.

class ipas.lab.IceClusterBatch(clusters, length, width, plates=None)

Bases: object

A collection of IceCluster objects.

calc_aspect_ratios()

Calculate the aspect ratios of the clusters using ellipses fitted to the 2D cluster projections from the x-, y-, and z-axis perspectives.

plot_aspect_ratios(**kwargs)

Plot a histogram of cluster aspect ratios, sending extra arguments to matplotlib.pyplot.hist.

ipas.lab.sim_clusters(length, width, nclusters, ncrystals, reorient='random', rotations=50, speedy=False, lodge=0)

Simulate crystal aggregates.

Parameters:
  • length (float) – The column length of the crystals.
  • width (float) – The width of the hexagonal faces of the crystals.
  • nclusters (int) – The number of clusters to simulate.
  • ncrystals (int) – The number of crystals in each cluster.
  • reorient (str) – The method to use for reorienting crystals and clusters. ‘random’ chooses rotations at random and selects the area-maximizing rotation. ‘IDL’ exactly reproduces the IPAS IDL code. Default is ‘random’.
  • rotations (int) – The number of rotations to use to reorient crystals and clusters. Default is 50.
  • speedy (bool) – If true, choose an optimal rotation for single crystals instead of reorienting them. Default is false.
  • lodge (float) – The vertical distance that crystals lodge into each other when added from above. Useful for matching the output of IPAS IDL code, which uses 0.5. Default is zero.
Returns:

An IceClusterBatch object containing the simulated clusters.