calamari.catalog.summarise#
- calamari.catalog.summarise(path, root=None, *, group_fn=None)#
Build a one-row inventory summary dict for a single measurement file.
- Parameters:
path (
Path|str) – Path to the measurement file to summarise.root (
Path|str|None) – Root directory used to computerelative_path(and, ifgroup_fnis given, the value passed to it). Defaults topath’s parent if not given.group_fn (
Callable[[Path],str] |None) – A function mapping the file’s path relative toroot(or the absolute path, ifpathis not underroot) to a group label string. If not given, no'group'key is included in the returned dict at all – this is the standalone-call default;build_catalog()always supplies one (see there) so that its output DataFrame is consistently groupable/sortable.
- Return type:
- Returns:
dict– Summary row with keys:relative_path,group(only ifgroup_fnwas given),filename,data_format,measurement_type,file_role,sample_name,sample_mass_mg,date,n_points,n_measurements,T_min,T_max,H_min_Oe,H_max_Oe,H_min_T,H_max_T,ac_frequencies_Hz,scan_kind,comment.- Raises:
UnsupportedFileError – If
pathis not a recognised magnetometry file – propagated fromcalamari.io.load()(IO-5). A caller summarising an arbitrary path should gate oncalamari.io.is_supported_file()first.build_catalog()does not need to: it only ever passes paths thatfind_files()already vetted, and catches any residual per-file failure intodf.attrs['parse_errors'].OSError – If
pathcannot be read.