Skip to content

Commit

Permalink
Write Cloud Model Simulation configuration choices into FITS header
Browse files Browse the repository at this point in the history
  • Loading branch information
Areustle committed Aug 16, 2023
1 parent 1a0280d commit b3dde41
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/nuspacesim/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,7 @@ def __call__(self) -> dict[str, tuple[Union[int, float, str], str]]:
}

d.update(self.spectrum())
d.update(self.cloud_model())

return d

Expand Down
19 changes: 18 additions & 1 deletion src/nuspacesim/types/cloud_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,21 @@

@dataclass
class NoCloud:
pass
def __call__(self) -> dict:
return {"cloudmdl": ("NoCloud", "Simulation: No Cloud Model")}


@dataclass
class MonoCloud:
altitude: float = -np.inf
"""Altitude of monoheight cloud."""

def __call__(self) -> dict:
return {
"cloudmdl": ("MonoCloud", "Simulation: Uniform Height Cloud Model"),
"cloudtop": (self.altitude, "Simulation: Uniform Cloud Top Height"),
}


@dataclass
class PressureMapCloud:
Expand All @@ -60,6 +67,16 @@ class PressureMapCloud:
version: str = "0"
"""Cloud Map File Version."""

def __call__(self) -> dict:
return {
"cloudmdl": (
"PressureMapCloud",
"Simulation: Builtin PressureMap Cloud Model",
),
"cloudMth": (self.month, "Simulation: Month of Model"),
"cloudver": (self.version, "Simulation: Version of Model"),
}


def parse_month(date: str | int | datetime) -> int:
if isinstance(date, datetime):
Expand Down

0 comments on commit b3dde41

Please sign in to comment.