feat(models): fluorescence ingest contract shared with AareDB #19
@@ -239,6 +239,34 @@ class FluorescenceSpectrumOutputModel(BaseModel):
|
||||
average_dead_time: Annotated[float, Field(ge=0, le=1)]
|
||||
|
||||
|
||||
class FluorescenceElementModel(BaseModel):
|
||||
"""One emission line AareDB identified in a stored fluorescence spectrum."""
|
||||
|
||||
symbol: str
|
||||
line: str # "Ka" or "La"
|
||||
energy_ev: float # tabulated line energy
|
||||
peak_energy_ev: float # where the matching peak actually sits
|
||||
counts: float # peak height
|
||||
confidence: float # 1.0 alpha+beta matched, 0.5 alpha only
|
||||
|
||||
|
||||
class FluorescenceScanIngestModel(BaseModel):
|
||||
"""AareDB fluorescence ingest payload: the measured spectrum plus the
|
||||
sample it belongs to (POST /dispatcher/protected_router/fluorescence/ingest)."""
|
||||
|
||||
sample_id: int
|
||||
scan: FluorescenceSpectrumOutputModel
|
||||
comment: str | None = None
|
||||
|
||||
|
||||
class FluorescenceScanIngestResponseModel(BaseModel):
|
||||
"""AareDB's ingest response — the beamline GUI shows the detected elements."""
|
||||
|
||||
id: int
|
||||
sample_event_id: int
|
||||
elements: list[FluorescenceElementModel] = []
|
||||
|
||||
|
||||
class MLBoxType(Enum):
|
||||
LOOP_ALL = 0
|
||||
PIN = 1
|
||||
|
||||
Reference in New Issue
Block a user