calamari.catalog#
Discovery and cataloguing of magnetometry measurement files.
Provides find_files() to walk a directory tree and identify files
recognised by any registered calamari.io loader, summarise()
to build a one-row inventory summary of a single file, logbook_line()
/ logbook() to render those summaries as human-readable logbook
entries, and build_catalog() to assemble the whole tree’s inventory
as a Catalog – the rows plus the root they resolve against, with
chainable selection (where/of_type/at/drop/sort_by), a
repr that is the logbook, and iteration as file paths so the plot helpers
consume one directly. deduplicated() and
select_representative() (also exposed as Catalog methods) reduce
an inventory by removing verified byte-identical cross-group copies and
choosing one representative sweep per nominal setpoint respectively.
This module makes no assumption about why a tree is organised into
subfolders – a real project typically mirrors several data sources
(a collaborator’s beamtime export, a working copy of the same data, runs
grouped by sample revision, …) under one root, and wants an inventory
that reflects that structure. Rather than hardcoding folder-name markers,
grouping and duplicate detection are exposed as caller-supplied
parameters (group_fn and dedup_between) – see build_catalog().
Functions
Build a |
|
Return a de-duplicated view of a catalog DataFrame. |
|
Walk |
|
Logbook lines for every recognised file under |
|
One tab-separated logbook entry for a loaded measurement. |
|
Thin a catalog DataFrame to one representative row per nominal setpoint. |
|
Build a one-row inventory summary dict for a single measurement file. |
Classes
A directory's recognised measurement files: the inventory rows plus the root they resolve against. |