class BaseScanData(BaseModel): (source)
Known subclasses: openflexure_microscope_server.scan_directories.HistoricScanData, openflexure_microscope_server.things.smart_scan.ActiveScanData
Data about a scan not including workflow specific data.
For including workflow specific data see also:
- ActiveScanData which subclasses this including the BaseModel used by the
- ScanWorkflow
- HistoricScanData which has the workflow specific data loaded as a dictionary.
Separating historic and active data allows workflows to use any BaseModel for its settings, but for the data to be reloaded even if that model has updated or is not available. Historic scan data loaded from disk is used for stitching and for creating a ScanInfo object for communicating with the UI. These uses are clearly typed by this model.
This serialises into a human readable format where possible with
timestamps in %Y-%m-%d_%H:%M:%S format timedeltas in %H:%M:%S format
Properties that are not known until the end have None serialised as "Unknown"
| Class Method | parse |
Validate a timedelta that may be a string in Hrs:Min:Sec format or "Unknown". |
| Class Method | parse |
Validate a timestamp that may be a string in Year-Month-Day_Hrs:Min:Sec format. |
| Class Method | parse |
Validate the string "Unknown" as None. |
| Method | serialize |
Serialise None as "Unknown" for a more human readable result. |
| Method | serialize |
Serialise timedelta to Hrs:Min:Sec (or "Unknown" if None). |
| Method | serialize |
Serialise timestamp to Year-Month-Day_Hrs:Min:Sec format. |
| Method | validate |
Validate the schema version is as the current one. |
| Class Variable | duration |
The duration of the scan. |
| Class Variable | image |
The number of images taken. |
| Class Variable | model |
Undocumented |
| Class Variable | save |
The resolution that scan images are saved at. |
| Class Variable | scan |
The name of the scan i.e. scan_0001 |
| Class Variable | scan |
The result of the scan. |
| Class Variable | start |
The time the scan started. |
| Class Variable | starting |
The starting position in dictionary format. |
| Class Variable | stitch |
Whether the scan is set to automatically stitch when complete. |
| Class Variable | stitching |
The data needed to stitch a scan. |
| Class Variable | workflow |
The class name of the workflow Thing. |
@classmethod
str | timedelta | None) -> timedelta | None:
(source)
¶
Validate a timedelta that may be a string in Hrs:Min:Sec format or "Unknown".
@classmethod
str | datetime) -> datetime:
(source)
¶
Validate a timestamp that may be a string in Year-Month-Day_Hrs:Min:Sec format.
@classmethod
str | int | None) -> str | int | None:
(source)
¶
Validate the string "Unknown" as None.
str | int | None) -> str | int:
(source)
¶
Serialise None as "Unknown" for a more human readable result.
timedelta | None) -> str:
(source)
¶
Serialise timedelta to Hrs:Min:Sec (or "Unknown" if None).