Skip to content

scans#

Work with multiple scans simultaneously for analysis.

The working set (scans.selected) is normally chosen from the UI; code may also enumerate (scans.find / scans.projects) and load (scans.load) scans directly. The active acquisition scan is scans.current and stays separate from the analysis set.

Example
# iterate the UI-selected scans and build a cross-scan series
xs, ys = [], []
for s in scans:
    xs.append(s.metadata.temperature)
    ys.append(s.peaks[0].normalized_area)

# or pull a known scan in by id
ref = scans.load(some_id)
print(scans)  # shows what's loaded

current #

current() -> Scan | None

The active acquisition scan (mirrors state.current_scan).

Never part of, and never disturbed by, the analysis working set.

loaded #

loaded() -> list[Scan]

Subset of the working set currently materialized in memory.

selected #

selected() -> list[Scan]

The analysis working set as proxies (data loads lazily).

apply_graph #

apply_graph(
    graph: str | list[PostprocessingNode] | None = None,
) -> dict[str, GraphResult]

Run a processing graph over every scan in the working set.

Parameters:

Name Type Description Default
graph str | list[PostprocessingNode] | None

Which graph to run — None for the project's current graph, a saved processor name, or an explicit list of nodes (see Scan.process).

None

Returns:

Type Description
dict[str, GraphResult]

A mapping of each scan's label (or id) to its GraphResult.

find #

find(
    project: str | None = None, group: str | None = None
) -> list[Scan]

List scans in a project (default: the current project) as lazy proxies.

Parameters:

Name Type Description Default
project str | None

Project name; defaults to the current project.

None
group str | None

Optional group/folder filter.

None

load #

load(
    scan_id: str,
    project: str | None = None,
    label: str | None = None,
    analyze: bool = False,
) -> Scan

Add a scan to the analysis working set and materialize it in memory.

Loads the scan as stored — no preprocessing or peak detection is applied. Call Scan.preprocess / Scan.perform_analysis / Scan.analyze explicitly to process it.

Parameters:

Name Type Description Default
scan_id str

The scan id (UUID).

required
project str | None

Project name; defaults to the current project.

None
label str | None

Optional label for referring to the scan later.

None
analyze bool

Opt in to running preprocessing + peak detection on load (Scan.analyze). Default False.

False

Returns:

Type Description
Scan

The Scan proxy for the loaded scan.

projects #

projects() -> list[str]

List project names that contain scans.

release #

release(scan_id: str | None = None) -> None

Remove a scan from the working set, or clear the whole set if None.

summary #

summary() -> str

Human-readable summary of the working set and what's loaded.

__getitem__ #

__getitem__(key: Any) -> Any

__iter__ #

__iter__() -> Iterator[Any]

__len__ #

__len__() -> int