Skip to content

Commit

Permalink
Issue #6: Changing default aperture in lsst_comet_activity.py (#7)
Browse files Browse the repository at this point in the history
* Issue #6: changing aperture to 1 arcsec.

* Updating test.

* Satisfying linter.

* Adding comment.
  • Loading branch information
astronomerritt authored Aug 31, 2023
1 parent 2ee9534 commit f695e7c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,9 @@ def compute(
# this calculates the coma magnitude in each filter
try:
for filt in observing_filters:
df.loc[df["optFilter"] == filt, "coma_magnitude"] = com.mag(g, filt, rap=df["seeingFwhmEff"])
# here rap is the aperture width, hardcoded here to 1.0 arcsec
# the code assumes an infinite coma so is thus only accurate for small apertures
df.loc[df["optFilter"] == filt, "coma_magnitude"] = com.mag(g, filt, rap=1.0)
except KeyError as err:
self._log_exception(err)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,17 +46,13 @@ def test_PPCalculateSimpleCometaryMagnitude():
# Updates the dictionary of available subclasses of `AbstractCometaryActivity`
update_activity_subclasses()

# data is for 67P, taken by Colin Snodgrass, and validated against same
# abnormally large seeing is to account for Colin's use of an aperture measured at comet distance

cometary_obs = pd.DataFrame(
{
"optFilter": ["r", "r"],
"TrailedSourceMag": [19.676259, 22.748274],
"H_r": [15.35, 15.35],
"afrho1": [1552, 1552],
"k": [-3.35, -3.35],
"seeingFwhmEff": [8.064748, 3.206723],
}
)

Expand All @@ -66,4 +62,4 @@ def test_PPCalculateSimpleCometaryMagnitude():

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

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

0 comments on commit f695e7c

Please sign in to comment.