Data Models#

ScanRecord#

class grad300_client.ScanRecord[source]#

Bases: object

Structured scan record returned by the backend API.

__init__(id, scan_type, file_name, file_path, size, source, ra, dec, date, date_obs, date_end, gain, comment, metadata=<factory>)#
Parameters:
Return type:

None

comment: str | None#
date: datetime#
date_end: datetime | None#
date_obs: datetime | None#
dec: float#
file_name: str#
file_path: str#
classmethod from_api(scan_type, payload)[source]#

Build a ScanRecord from a raw API response dict.

Parameters:
  • scan_type (ScanType) – Type of the record.

  • payload (dict[str, Any]) – One scan object as returned by the backend API.

Returns:

Populated record instance.

Return type:

ScanRecord

Raises:

ValueError – If required fields are missing or have unexpected types.

gain: int | None#
id: int#
metadata: dict[str, Any]#
ra: float#
scan_type: ScanType#
size: int#
source: str#

ScanType#

class grad300_client.ScanType[source]#

Bases: str, Enum

Enumeration of supported scan types.

Each member is also a plain str so it can be used directly as an API parameter value (e.g. "TPI").

IMAGES = 'Images'#

On-the-fly imaging scans.

ONOFF = 'OnOff'#

On-Off switching scans.

SPECTRUM = 'Spectrum'#

Spectral-line scans.

TPI = 'TPI'#

Total-power integration scans.

__new__(value)#