autoemx.config.schema_models.standards module
- class autoemx.config.schema_models.standards.StandardMeanZ(*, Statham2016: float, Markowicz1984: float, mass_averaged: float, atomic_averaged: float)[source]
Bases:
BaseModelMean atomic number metrics stored for one standard measurement.
- statham2016: float
- markowicz1984: float
- mass_averaged: float
- atomic_averaged: float
- model_config = {'extra': 'forbid', 'populate_by_name': True, 'validate_by_alias': True, 'validate_by_name': True}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class autoemx.config.schema_models.standards.StandardPbSummary(*, Corrected_PB: float, rel_stdev_pb_percent: float, Measured_PB: float | None = None, Stdev_PB: float)[source]
Bases:
BaseModelShared PB summary fields used by fit results and persisted entries.
- corrected_pb: float
- rel_stdev_pb_percent: float
- measured_pb: float | None
- stdev_pb: float
- model_config = {'extra': 'forbid', 'populate_by_name': True, 'validate_by_alias': True, 'validate_by_name': True}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class autoemx.config.schema_models.standards.StandardEntry(*, Corrected_PB: float, rel_stdev_pb_percent: float, Measured_PB: float | None = None, Stdev_PB: float, ID: str, datetime: str, Formula: str | None = None, Std_type: str | None = None, Use_for_mean_calc: bool | None = False, Mean_Z: StandardMeanZ | None = None)[source]
Bases:
StandardPbSummarySingle standards-library entry for one element reference line.
- standard_id: str
- datetime: str
- formula: str | None
- std_type: str | None
- use_for_mean_calc: bool | None
- mean_z: StandardMeanZ | None
- model_config = {'extra': 'forbid', 'populate_by_name': True, 'validate_by_alias': True, 'validate_by_name': True}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class autoemx.config.schema_models.standards.ReferenceMean(*, Corrected_PB: float, rel_stdev_pb_percent: float, Measured_PB: float | None = None, Stdev_PB: float, datetime: str | None = None)[source]
Bases:
StandardPbSummaryDedicated reference-mean values for one element reference line.
- datetime: str | None
- model_config = {'extra': 'forbid', 'populate_by_name': True, 'validate_by_alias': True, 'validate_by_name': True}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class autoemx.config.schema_models.standards.StandardLine(*, entries: List[StandardEntry] = <factory>, reference_mean: ReferenceMean | None = None)[source]
Bases:
BaseModelStructured standards payload for one element reference line.
- entries: List[StandardEntry]
- reference_mean: ReferenceMean | None
- model_config = {'extra': 'forbid', 'populate_by_name': True, 'validate_by_alias': True, 'validate_by_name': True}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- compute_reference_mean(datetime: str | None) ReferenceMean | None[source]
Reference mean of the corrected P/B ratios of the entries used for the mean (None if there are none).
- class autoemx.config.schema_models.standards.StandardFitLineResult(*, Corrected_PB: float, rel_stdev_pb_percent: float, Measured_PB: float | None = None, Stdev_PB: float, pb_ratios: List[float], peak_theoretical_energy_keV: float, n_spectra_used: int)[source]
Bases:
StandardPbSummaryComputed standards-fit metrics for one element reference line.
- pb_ratios: List[float]
- peak_theoretical_energy_keV: float
- n_spectra_used: int
- model_config = {'extra': 'forbid', 'populate_by_name': True, 'validate_by_alias': True, 'validate_by_name': True}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- to_standard_entry(*, standard_id: str, datetime: str, formula: str | None = None, std_type: str | None = None, use_for_mean_calc: bool | None = False, mean_z: StandardMeanZ | None = None) StandardEntry[source]
- class autoemx.config.schema_models.standards.StandardsFitResults(*, lines: Dict[str, ~autoemx.config.schema_models.standards.StandardFitLineResult]=<factory>, mean_z: StandardMeanZ | None = None)[source]
Bases:
BaseModelAggregate standards-fit output used for persistence and library updates.
- lines: Dict[str, StandardFitLineResult]
- mean_z: StandardMeanZ | None
- model_config = {'extra': 'forbid'}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class autoemx.config.schema_models.standards.EDSStandardsFile(*, schema_version: int = 1, measurement_type: str, beam_energy_keV: int, standards_by_mode: Dict[str, ~typing.Dict[str, ~autoemx.config.schema_models.standards.StandardLine]]=<factory>)[source]
Bases:
BaseModelSchema-backed representation of an EDS standards file for one beam energy.
- schema_version: int
- measurement_type: str
- beam_energy_keV: int
- standards_by_mode: Dict[str, Dict[str, StandardLine]]
- model_config = {'extra': 'forbid'}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- classmethod from_payload(payload: Dict[str, Any], meas_type: str, beam_energy_keV: int) EDSStandardsFile[source]
- classmethod from_standards_dict(standards_by_mode: Dict[str, Dict[str, List[Dict[str, Any]]]], meas_type: str, beam_energy_keV: int) EDSStandardsFile[source]
- classmethod from_json_file(file_path: str | Path, meas_type: str, beam_energy_keV: int) EDSStandardsFile[source]