Skip to content

Commit

Permalink
small tweaks to check physical function + max brightness to fix bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
astjoephysics committed Jan 10, 2025
1 parent 776756d commit c8f5fa8
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions src/sorcha_addons/activity/lsst_comet/lsst_comet_activity.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ def __init__(
super().__init__(required_column_names)

def checkPhysical(self, df : pd.DataFrame):
if df.k > 0:
raise ValueError("k > 0 is not a physical value")
if (df.k > 0).any():
raise ValueError("Check complex parameters file. k > 0 is not a physical value")

def compute(
self,
Expand Down Expand Up @@ -67,7 +67,7 @@ def compute(
"""

self._validate_column_names(df)
self.checkPhysical()
self.checkPhysical(df)

com = Comet(k=df.k, afrho1=df.afrho1)

Expand Down Expand Up @@ -101,15 +101,16 @@ def name_id() -> str:
"""
return "lsst_comet"

def maxBrightness(self,df: pd.DataFrame,
def maxBrightness(self,
df: pd.DataFrame,
observing_filters: List[str],
q: List[float],
delta: List[float],
alpha: List[float],
):

self._validate_column_names(df)
self.checkPhysical()
self.checkPhysical(df)

com = Comet(k=df.k, afrho1=df.afrho1)

Expand All @@ -125,8 +126,8 @@ def maxBrightness(self,df: pd.DataFrame,
except KeyError as err:
self._log_exception(err)

df["trailedSourceMagTrue"] = -2.5 * np.log10(
brightestMag = -2.5 * np.log10(
10 ** (-0.4 * df["coma_magnitude"]) + 10 ** (-0.4 * df["trailedSourceMagTrue"])
)

return df
return brightestMag

0 comments on commit c8f5fa8

Please sign in to comment.