extract_tick_json#

extract_tick_json(tar: tarfile.TarFile, key: str, tick: float, extension: str | None = None, field: str | None = None) list[source]#

Extract json for specified tick from tar archive.

For v3 simulations, each tick is saved as a separate json file in the archive. The file names are formatted as <key>_<tick>.json or <key>_<tick>.<extension>.json where tick is padded to six digits. Use an integer tick to extract the desired tick from the archive.

For v2 simulations, all ticks are saved to the same file in the archive. The file name is given as <key>.json or <key>.<extension>.json. Use a float tick and field to extract the desired tick from the archive.

{
    "timepoints": [
        {
            "time": <time>, "field": <field>, ...
        }
    ]
}
Parameters:
  • tar – Tar archive.

  • key – Simulation key.

  • tick – Tick to extract.

  • extension – Additional extension in file name.

  • field – Field in json to extract (only used with float ticks).

Returns:

Archive contents for specified tick.