CHAP.giwaxs.models

Module Contents

Classes

Detector

Detector class to represent a single detector used in the experiment.

GiwaxsConversionConfig

Class representing metadata required to locate GIWAXS image files for a single scan to convert to q_par/q_perp coordinates.

API

class CHAP.giwaxs.models.Detector

Bases: pydantic.BaseModel

Detector class to represent a single detector used in the experiment.

Parameters:
  • prefix (str) – Prefix of the detector in the SPEC file.

  • poni_file (str) – Path to the poni file.

prefix: constr(strip_whitespace=True, min_length=1)

None

poni_file: pydantic.FilePath

None

classmethod validate_poni_file(poni_file)

Validate the poni file by checking if it’s a valid PONI file.

Parameters:

poni_file (str) – Path to the poni file.

Raises:

ValueError – If poni_file is not a valid PONI file.

Returns:

Absolute path to the poni file.

Return type:

str

class CHAP.giwaxs.models.GiwaxsConversionConfig

Bases: pydantic.BaseModel

Class representing metadata required to locate GIWAXS image files for a single scan to convert to q_par/q_perp coordinates.

Variables:
  • detectors – List of detector configurations.

  • scan_step_indices – Optional scan step indices to convert. If not specified, all images will be converted.

  • save_raw_data – Save the raw data in the NeXus output, default to False.

detectors: conlist(item_type=Detector, min_length=1)

None

scan_step_indices: Optional[conlist(item_type=conint(ge=0), min_length=1)]

None

save_raw_data: Optional[bool]

False

classmethod validate_scan_step_indices(scan_step_indices)

Validate the specified list of scan step indices.

Parameters:

scan_step_indices (list of int) – List of scan numbers.

Raises:

ValueError – If a specified scan number is not found in the SPEC file.

Returns:

List of scan numbers.

Return type:

list of int