sme.SimulationResult.species_concentration
- property SimulationResult.species_concentration
the species concentrations at this timepoint
for each species, the concentrations are provided as a 3d array, where
species_concentration['A'][z][y][x]
is the concentration of species “A” at the point (x,y,z)Examples
do a short simulation and get the species concentrations from the last timepoint:
>>> import sme >>> model = sme.open_example_model() >>> results = model.simulate(10, 1) >>> species_concentration = results[-1].species_concentration
this is a dict with an entry for each species:
>>> type(species_concentration) <class 'dict'> >>> species_concentration.keys() dict_keys(['B_out', 'A_cell', 'B_cell', 'A_nucl', 'B_nucl'])
the concentrations are a 3d ndarray of doubles, one for each pixel in the geometry image:
>>> b_cell = species_concentration['B_cell'] >>> type(b_cell) <class 'numpy.ndarray'> >>> b_cell.dtype dtype('float64') >>> b_cell.shape (1, 100, 100)
the concentrations can be displayed using matplotlib:
>>> import matplotlib.pyplot as plt >>> imgplot = plt.imshow(b_cell[0])
- Type:
Dict[str, numpy.ndarray]