parse_locations_file#
- LOCATIONS_COLUMNS = ['ID', 'TICK', 'CENTER_X', 'CENTER_Y', 'CENTER_Z', 'MIN_X', 'MIN_Y', 'MIN_Z', 'MAX_X', 'MAX_Y', 'MAX_Z']#
Column names for locations data parsed into tidy data format.
- parse_locations_file(tar: tarfile.TarFile, regions: list[str]) pd.DataFrame [source]#
Parse simulation locations data into tidy data format.
- Parameters:
tar – Tar archive containing locations data.
regions – List of regions.
- Returns:
Parsed locations data.
- parse_location_tick(tick: int, location: dict, regions: list[str]) list [source]#
Parse location data for a single simulation tick.
Original data is formatted as:
{ "id": cell_id, "center": [center_x, center_y, center_z], "location": [ { "region": region, "voxels": [ [x, y, z], [x, y, z], ... ] }, { "region": region, "voxels": [ [x, y, z], [x, y, z], ... ] }, ... ] }
Parsed data is formatted as:
[ cell_id, tick, center_x, center_y, center_z, min_x, min_y, min_z, max_x, max_y, max_z ]
When regions are specified, each list also contains centers, minimums, and maximums for the corresponding regions.
- Parameters:
tick – Simulation tick.
location – Original location data.
regions – List of regions.
- Returns:
Parsed location data.