Source code for pleiades.sammy.parameters.last

#!/usr/bin/env python
"""Parser for SAMMY's Last Card parameters.

Format specification from Table VI B.2:
There are three alternative Last Card formats:

1. Last A: COVAR matrix in binary form
2. Last B: EXPLI (explicit uncertainties and correlations)
3. Last C: RELAT (relative uncertainties)
4. Last D: PRIOR (prior uncertainties in key word format)

Multiple Last Card formats can be used together except for Last A.
"""

from typing import List

from pydantic import BaseModel


[docs] class LastParameters(BaseModel): """Placeholder for Last Card parameters. This class needs to be implemented to handle the various Last Card formats: - Last A: Binary covariance matrix - Last B: Explicit uncertainties and correlations - Last C: Relative uncertainties - Last D: Prior uncertainties in keyword format Note: Last A cannot be combined with other formats. Last B, C, and D can be used together. """
[docs] @classmethod def from_lines(cls, lines: List[str]) -> "LastParameters": """Parse Last Card parameters from input lines. Args: lines: List of input lines Raises: NotImplementedError: This feature needs to be implemented """ # TODO: Implement Last Card parameter parsing raise NotImplementedError("Last Card parsing not yet implemented")
[docs] def to_lines(self) -> List[str]: """Convert parameters to fixed-width format lines. Raises: NotImplementedError: This feature needs to be implemented """ # TODO: Implement Last Card parameter formatting raise NotImplementedError("Last Card formatting not yet implemented")
if __name__ == "__main__": print("This card is not used in PLEIADES at the moment.")