tardis.io.model.readers.snec.xg_files module

class tardis.io.model.readers.snec.xg_files.XGData(timestamps: astropy.units.quantity.Quantity, data_blocks: list, metadata: dict = <factory>)[source]

Bases: object

data_blocks: list
metadata: dict
timestamps: Quantity
to_xr_dataset()[source]
tardis.io.model.readers.snec.xg_files.read_xg_file(file_path: str, column_names: list, show_progress: bool = True)[source]

Reads the timestamps and corresponding data blocks from an .xg file.

Parameters:
file_path (str): Path to the .xg file.
column_names (list): List of column names for the data blocks.
show_progress (bool): Whether to show a progress bar (default: False).
Returns:
list: A list of timestamps extracted from the file.
list: A list of pandas DataFrames, each containing a data block corresponding to a timestamp.
tardis.io.model.readers.snec.xg_files.xg_block_size(path)[source]

Determines the block size (number of lines) between consecutive lines starting with “Time in an .xg file.

Parameters:
path (str): Path to the .xg file.
Returns:
int: The block size.