Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

45 Commits

Repository files navigation

ipas

Build StatusDocumentation Status

A Python implementation of the Ice Particle Aggregate Simulator

Installation

pip install git+https://github.com/ASRCsoft/ipas.git

Crystals (monomers)

importnumpyasnpimportipas.crystalsascrys# create a hexagonal crystal centered at (1,0,0)crystal=crys.IceCrystal(length=4, width=6, center=[1, 0, 0])
crystal.points# get a numpy array containing the crystal vertices# rotate the crystal 45 degrees around the y-axis and 90 degrees# around the z-axiscrystal.rotate_to([0,np.pi/4,np.pi/2])
# return a shapely MultiLineString representing the crystal edges,# which plots automatically in a jupyter notebookcrystal.plot()

crystal

# project the crystal onto the xy plane, returning a shapely Polygoncrystal.projectxy()

crystal_projection

Clusters (aggregates)

# use the crystal to start a clustercluster=crys.IceCluster(crystal)
# add a new crystal to the clustercrystal2=crys.IceCrystal(length=4, width=6)
cluster.add_crystal_from_above(crystal2)
cluster.plot() # same as IceCrystal.plot()

cluster

# plot the 2D projection of the cluster along with an ellipse fit to# the area of the projectioncluster.plot_ellipse()

cluster_ellipse

Simulations

importipas.labaslab# create 100 clusters of 2 crystals each with a simulation similar to# the IDL IPAS codebatch=lab.sim_clusters(length=4, width=6, nclusters=100, ncrystals=2)
# get more information about the available options for simulating ice# clustershelp(lab.sim_clusters)
# fit ellipses to the x-, y-, and z-axis views of the cluster and use# them to calculate aspect ratiosbatch.calc_aspect_ratios()
batch.ratios# return a list of the aspect ratios# plot a histogram of the aspect ratios, passing arguments to# matplotlib.pyplot.hist()batch.plot_aspect_ratios(bins=20)

aspect_ratios

# view the first cluster in the batchcluster=batch.clusters[0]
cluster.plot()

cluster0

About

A Python implementation of the Ice Particle Aggregate Simulator

Topics

Resources

Stars

0 stars

Watchers

2 watching

Forks

Releases

Packages

Used by

Contributors

Languages