Skip to content

Commit

Permalink
Merge pull request #33 from dirac-institute/31-column-name
Browse files Browse the repository at this point in the history
Updating column name
  • Loading branch information
mschwamb authored Nov 11, 2024
2 parents 1501db5 + 24bf7f3 commit 06b23d2
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
" 'k':[-2],\n",
" 'optFilter':'r',\n",
" 'seeingFwhmEff': [1],\n",
" 'TrailedSourceMag': 18}\n",
" 'trailedSourceMagTrue': 18}\n",
"\n",
"test_data = pd.DataFrame(test_dict)\n",
"\n",
Expand Down Expand Up @@ -154,7 +154,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.12"
"version": "3.10.14"
}
},
"nbformat": 4,
Expand Down
6 changes: 3 additions & 3 deletions src/sorcha_addons/activity/lsst_comet/lsst_comet_activity.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class LSSTCometActivity(AbstractCometaryActivity):
"""

def __init__(
self, required_column_names: List[str] = ["k", "afrho1", "optFilter", "TrailedSourceMag"]
self, required_column_names: List[str] = ["k", "afrho1", "optFilter", "trailedSourceMagTrue"]
) -> None:
super().__init__(required_column_names)

Expand Down Expand Up @@ -78,8 +78,8 @@ def compute(
except KeyError as err:
self._log_exception(err)

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

return df
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def test_PPCalculateSimpleCometaryMagnitude():
cometary_obs = pd.DataFrame(
{
"optFilter": ["r", "r"],
"TrailedSourceMag": [19.676259, 22.748274],
"trailedSourceMagTrue": [19.676259, 22.748274],
"H_r": [15.35, 15.35],
"afrho1": [1552, 1552],
"k": [-3.35, -3.35],
Expand All @@ -62,4 +62,4 @@ def test_PPCalculateSimpleCometaryMagnitude():

df_comet = PPCalculateSimpleCometaryMagnitude(cometary_obs, ["r"], rho, delta, alpha, "lsst_comet")

assert_almost_equal(df_comet["TrailedSourceMag"], [15.757, 22.461], decimal=3)
assert_almost_equal(df_comet["trailedSourceMagTrue"], [15.757, 22.461], decimal=3)

0 comments on commit 06b23d2

Please sign in to comment.