f4enix.output.rssa.rssa_reader.scan_tracks#
- f4enix.output.rssa.rssa_reader.scan_tracks(path_to_file: Path | str, default_batch_size: int = 100000000) LazyFrame#
Scans the RSSA to return a polars LazyFrame instead of a DataFrame.
- Parameters:
path_to_file (Path | str) – The RSSA file to read.
default_batch_size (int) – The default batch size to use when reading the file in chunks. This is the number of tracks to read at once. The optimal value depends on the size of the file and the available memory, but a good starting point is around 100 million tracks (~8 Gb).
Examples
>>> from f4enix.output.rssa import RSSA >>> from f4enix.output.rssa.rssa_reader import parse_header, scan_tracks >>> parameters = parse_header('small_cyl.w') >>> lazy_tracks = scan_tracks('small_cyl.w') >>> # We will only read the first 20 tracks of the file >>> tracks = lazy_tracks.head(20).collect() >>> rssa = RSSA(parameters, tracks)