jLM.Analysis#

Simulation analysis mixins for SpatialModel

Classes

H5File

alias of File

LatticeAnalysisMixin()

TrajAnalysisMixin()

class jLM.Analysis.LatticeAnalysisMixin[source]#

Bases: object

particleStatistics(particleLattice=None, siteLattice=None)[source]#

Compute properties of the particle lattice

Dictionary keys

countBySpeciesRegion

Particle counts for each species type for each region.

concBySpeciesRegion

Concentration for each species type for each region.

countByRegion

Total particle counts for each region.

concByRegion

Total concentration for each region.

countBySpecies

Total particle counts for each species.

concBySpecies

Total concentration of each species, averaged over simulation volume

count

Total particle count

conc

Total concentration, averaged over simulation volume

vol

Total simulation volume

siteCount

Total number of subvolumes

regionVol

Volume of each region

regionCounts

Number of subvolumes in each region

Returns:

Particle lattice statistics

Return type:

dict

class jLM.Analysis.TrajAnalysisMixin[source]#

Bases: object

getLatticeHistogram(regex=None, species=None, integrated='xyz', replicate=None, frameStart=None, frameEnd=None, timeStart=None, timeEnd=None)[source]#

Calculate the spatial distribution of particles over an interval

Species can be selected individually with the species key. If a list of species are given instead the sum of the particle numbers for those species types will be returned. A regular expression can also be used to select the species to return. Species types or species names in the form of a string are both acceptible to use in the species key. The regex and species options are mutually exclusive. The interval of time in which the histogram is computed can be selected either through the frame numbers (frameStart, frameEnd) or through the simulation time (timeStart, timeEnd). If the full 3-D lattice is not needed, any of the directions can be integrated out.

Parameters:
  • regex (str) – Regular expression matching species names. Multiple matches will be summed.

  • species ([Species]) – Species

  • integrated (str) – Combination of ‘x’, ‘y’, ‘z’ specifying the directions to integrate out

  • replicate (int) – Replicate to return, default is current replicate.

  • frameStart (int) – Starting frame

  • frameEnd (int) – Ending frame

  • timeStart (int) – Starting time

  • timeEnd (int) – Ending Time

Returns:

The average particle counts

Return type:

ndarray(dtype=float)

Note

Since this calculation requires reading the entire particle lattice trajectory, it can be slow.

getLatticeTrajectory(regex=None, species=None, integrated='', replicate=None, frameStart=None, frameEnd=None, timeStart=None, timeEnd=None)[source]#

Calculate the spatial distribution of particles versus time

Species can be selected individually with the species key. If a list of species are given instead the sum of the particle numbers for those species types will be returned. A regular expression can also be used to select the species to return. Species types or species names in the form of a string are both acceptible to use in the species key. The regex and species options are mutually exclusive. Instead of returning the entire trajectory, a segment can be selected either through the frame numbers (frameStart, frameEnd) or through the simulation time (timeStart, timeEnd). If the full 3-D lattice is not needed, any of the directions can be integrated out.

Parameters:
  • regex (str) – Regular expression matching species names. Multiple matches will be summed.

  • species ([Species]) – Species

  • integrated (str) – Combination of ‘x’, ‘y’, ‘z’ specifying the directions to integrate out

  • replicate (int) – Replicate to return, default is current replicate.

  • frameStart (int) – Starting frame

  • frameEnd (int) – Ending frame

  • timeStart (int) – Starting time

  • timeEnd (int) – Ending Time

Returns:

The evaluation times and particle counts

Return type:

(ndarray(shape=(nt,), dtype=float), ndarray(dtype=float))

Note

Since this calculation requires reading the entire particle lattice trajectory, it can be slow.

getNumberTrajectory(regex=None, species=None, replicate=None, frameStart=None, frameEnd=None, timeStart=None, timeEnd=None)[source]#

Calculate particle number trajectories

The time course of the particle numbers in the simulation can be queried with this function. Species can be selected individually with the species key. If a list of species are given instead the sum of the particle numbers for those species types will be returned. A regular expression can also be used to select the species to return. Species types or species names in the form of a string are both acceptible to use in the species key. The regex and species options are mutually exclusive. Instead of returning the entire trajectory, a segment can be selected either through the frame numbers (frameStart, frameEnd) or through the simulation time (timeStart, timeEnd).

Parameters:
  • regex (str) – Regular expression matching species names. Multiple matches will be summed.

  • species ([Species]) – Species

  • replicate (int) – Replicate to return, default is current replicate.

  • frameStart (int) – Starting frame

  • frameEnd (int) – Ending frame

  • timeStart (int) – Starting time

  • timeEnd (int) – Ending Time

Returns:

The evaluation times and particle counts

Return type:

(ndarray(shape=(nt,), dtype=float), ndarray(shape=(nt,), dtype=float))

getNumberTrajectoryFromRegion(spRegex=None, species=None, regRegex=None, region=None, replicate=None, frameStart=None, frameEnd=None, frameDownScale=None, timeStart=None, timeEnd=None, timeDownScale=None)[source]#

Calculate particle number trajectories for specific regions

The time course of the particle numbers in the simulation within specific regions can be queried with this function. Species can be selected individually with the species key. If a list of species are given instead the sum of the particle numbers for those species types will be returned. A regular expression can also be used to select the species to return. Species types or species names in the form of a string are both acceptible to use in the species key. The spRegex and species options are mutually exclusive. Instead of returning the entire trajectory, a segment can be selected either through the frame numbers (frameStart, frameEnd) or through the simulation time (timeStart, timeEnd).If both given, the frame numbers will be used. The regions to compute particle numbers over are selected similar to the species through the options regRegex and region.

Parameters:
  • spRegex (str) – Regular expression matching species names. Multiple matches will be summed.

  • species ([Species]) – Species

  • regRegex (str) – Regular expression matching region names. Multiple matches will be summed.

  • region ([Region]) – Region

  • replicate (int) – Replicate to return, default is current replicate.

  • frameStart (int) – Starting frame

  • frameEnd (int) – Ending frame

  • timeStart (int) – Starting time

  • timeEnd (int) – Ending Time

Returns:

The evaluation times and particle counts

Return type:

(ndarray(shape=(nt,), dtype=float), ndarray(shape=(nt,), dtype=float))

Note

Since this calculation requires reading the entire particle lattice trajectory, it can be slow.