pleiades.sammy.parameters.data_reduction module
Data class for card 08::data reduction parameters.
- class pleiades.sammy.parameters.data_reduction.DataReductionParameter(*, name: Annotated[str, MaxLen(max_length=5)], value: float, flag: VaryFlag = VaryFlag.NO, uncertainty: float | None = None, derivative_value: float | None = None)[source]
Bases:
BaseModelContainer for a single data reduction parameter entry.
Each parameter has: - A name (5-char alphanumeric) - A value - A flag indicating whether it should be varied - Optional uncertainty - Optional derivative value
- validate_name() DataReductionParameter[source]
Validate name field is not empty and fits format.
- classmethod from_line(line: str) DataReductionParameter[source]
Parse parameter from a fixed-width format line.
- Parameters:
line – Input line
- Returns:
Parsed parameter
- Return type:
- Raises:
ValueError – If line is invalid or required data missing
- to_line() str[source]
Convert the parameter to a fixed-width format line.
- Returns:
Formatted line
- Return type:
- model_config = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class pleiades.sammy.parameters.data_reduction.DataReductionCard(*, parameters: List[DataReductionParameter])[source]
Bases:
BaseModelContainer for a complete data reduction parameter card set (Card Set 8).
This class handles: - Header line - Multiple parameter entries - Trailing blank line
- parameters: List[DataReductionParameter]
- classmethod from_lines(lines: List[str]) DataReductionCard[source]
Parse a complete data reduction card set from lines.
- Parameters:
lines – List of input lines including header
- Returns:
Parsed card set
- Return type:
- Raises:
ValueError – If no valid header found or invalid format
- to_lines() List[str][source]
Convert the card set to a list of lines.
- Returns:
Lines including header and parameters
- Return type:
List[str]
- model_config = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].