convert_model_units#
- convert_model_units(data: pd.DataFrame, ds: float | None, dt: float | None, regions: list[str] | str | None = None) None[source]#
Convert data from simulation units to true units.
Simulations use spatial unit of voxels and temporal unit of ticks. Spatial resolution (microns/voxel) and temporal resolution (hours/tick) are used to convert data to true units. If spatial or temporal resolution is not given, they will be estimated from the
KEYcolumn of the data.The following columns are added to the data:
Target column
Source column(s)
Conversion
timeTICKdt * TICKvolumeNUM_VOXELSds * ds * ds * NUM_VOXELSheightMAX_ZMIN_Zds * (MAX_Z - MIN_Z + 1)cxCENTER_Xds * CENTER_XcyCENTER_Yds * CENTER_YczCENTER_Zds * CENTER_ZFor each region (other than
DEFAULT), the following columns are added to the data:Target column
Source column(s)
Conversion
volume.REGIONNUM_VOXELS.REGIONds * ds * ds * NUM_VOXELS.REGIONheight.REGIONMAX_Z.REGIONMIN_Z.REGIONds * (MAX_Z.REGION - MIN_Z.REGION + 1)The following property columns are rescaled:
Target column
Source column(s)
Conversion
areaareads * ds * areaperimeterperimeterds * perimeteraxis_major_lengthaxis_major_lengthds * axis_major_lengthaxis_minor_lengthaxis_minor_lengthds * axis_minor_length- Parameters:
data – Simulation data.
ds – Spatial resolution in microns/voxel, use None to estimate from keys.
dt – Temporal resolution in hours/tick, use None to estimate from keys.
regions – List of regions.
- convert_temporal_units(data: pd.DataFrame, dt: float) None[source]#
Convert temporal data from simulation units to true units.
Simulations use temporal unit of ticks. Temporal resolution (hours/tick) is used to convert data to true units.
The following temporal columns are converted:
Target column
Source column(s)
Conversion
timeTICKdt * TICK- Parameters:
data – Simulation data.
dt – Temporal resolution in hours/tick.
- convert_spatial_units(data: pd.DataFrame, ds: float, region: str | None = None) None[source]#
Convert spatial data from simulation units to true units.
Simulations use spatial unit of voxels. Spatial resolution (microns/voxel) is used to convert data to true units.
The following spatial columns are converted:
Target column
Source column(s)
Conversion
volumeNUM_VOXELSds * ds * ds * NUM_VOXELSheightMAX_ZMIN_Zds * (MAX_Z - MIN_Z + 1)cxCENTER_Xds * CENTER_XcyCENTER_Yds * CENTER_YczCENTER_Zds * CENTER_Zareaareads * ds * areaperimeterperimeterds * perimeteraxis_major_lengthaxis_major_lengthds * axis_major_lengthaxis_minor_lengthaxis_minor_lengthds * axis_minor_lengthNote that the centroid columns (
cx,cy, andcz) are only converted for the entire cell (region == None).- Parameters:
data – Simulation data.
ds – Spatial resolution in microns/voxel.
region – Name of region.
- estimate_temporal_resolution(key: str) float[source]#
Estimate temporal resolution based on condition key.
If the key contains
DT##, where##denotes the temporal resolution in minutes/tick, temporal resolution is estimated from##. Otherwise, the default temporal resolution is 1 hours/tick.- Parameters:
key – Condition key.
- Returns:
Temporal resolution (hours/tick).
- estimate_spatial_resolution(key: str) float[source]#
Estimate spatial resolution based on condition key.
If the key contains
DS##, where##denotes the spatial resolution in micron/voxel, spatial resolution is estimated from##. Otherwise, the default spatial resolution is 1 micron/voxel.- Parameters:
key – Condition key.
- Returns:
Spatial resolution (micron/voxel).