class documentation
class ScanData(BaseModel): (source)
Data about a scan to be saved to a JSON file in the directory.
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 | set |
Set the final data for the scan, scan duration is automatically calculated. |
| Class Variable | autofocus |
The z range used for autofocus (in steps). |
| Class Variable | autofocus |
Whether autofocus is on. |
| Class Variable | correlation |
The resize factor applied to images when the stitching program is correlating. |
| Class Variable | dx |
The number of steps between adjacent images in x. |
| Class Variable | dy |
The number of steps between adjacent images in y. |
| Class Variable | image |
The number of images taken. |
| Class Variable | max |
The maximum distance the scan could move (in steps) from the starting position. |
| Class Variable | model |
Undocumented |
| Class Variable | overlap |
The overlap between adjacent images as a fraction of the image size. |
| 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 | skip |
Whether automatic background detection is on, skipping locations with no sample. |
| 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. |
| Instance Variable | duration |
The duration of the scan. |
| Instance Variable | scan |
The result of the scan. |
@field_validator( 'duration', mode='before')
@classmethod
def parse_timedelta(cls, value: @classmethod
str | timedelta | None) -> timedelta | None:
(source)
¶
Validate a timedelta that may be a string in Hrs:Min:Sec format or "Unknown".
@field_validator( 'start_time', mode='before')
@classmethod
def parse_timestamp(cls, value: @classmethod
str | datetime) -> datetime:
(source)
¶
Validate a timestamp that may be a string in Year-Month-Day_Hrs:Min:Sec format.
@field_validator( 'scan_result', mode='before')
@classmethod
def parse_unknown_as_none(cls, value: @classmethod
str | int | None) -> str | int | None:
(source)
¶
Validate the string "Unknown" as None.
@field_serializer( 'scan_result')
def serialize_none_as_unknown(self, value: str | int | None) -> str | int:
(source)
¶
Serialise None as "Unknown" for a more human readable result.
@field_serializer( 'duration')
def serialize_timedelta(self, value: timedelta | None) -> str:
(source)
¶
Serialise timedelta to Hrs:Min:Sec (or "Unknown" if None).
Set the final data for the scan, scan duration is automatically calculated.
| Parameters | |
result:str | A string describing the result. |