vdmtools.io.read_scan_conditions
- vdmtools.io.read_scan_conditions(path: Path) ScanConditions
Read the scan conditions from the conditions file in the given path.
- Parameters:
path (Path) – The path to the scan results directory.
- Returns:
The scan conditions.
- Return type:
ScanConditions
- Raises:
FileNotFoundError – If the conditions file is not found.
KeyError – If the conditions file is missing any keys.
ValueError – If the fill number cannot be parsed from the path.
Example
>>> from pathlib import Path >>> from vdmtools.io import read_scan_conditions >>> path = Path("/eos/user/v/vdmdata/vdmoutput/www/analysed_data/8999_28Jun23_222504_28Jun23_223127") >>> read_scan_conditions(path) ScanConditions: Fill: 8999 Run: (369802, 369802) Scan names: ('X1', 'Y1') Scan types: ('NormalX', 'NormalY') Scan time windows: First Scan: 2023-06-28 22:25:04 - 2023-06-28 22:29:56 Second Scan: 2023-06-28 22:31:27 - 2023-06-28 22:36:22 Beta star: 19.2 Angle: 0.0 Offset: [0.0, 0.0] Particle type B1: proton Particle type B2: proton COM energy B1 (GeV): 6799 COM energy B2 (GeV): 6799