Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DM-40507: Cleanup DipoleFitTask #199

Merged
merged 2 commits into from
Mar 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
35 changes: 19 additions & 16 deletions data/DiaSource.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -126,41 +126,44 @@ funcs:
dipoleMeanFlux:
functor: LocalDipoleMeanFlux
args:
- ip_diffim_NaiveDipoleFlux_pos_instFlux
- ip_diffim_NaiveDipoleFlux_neg_instFlux
- ip_diffim_NaiveDipoleFlux_pos_instFluxErr
- ip_diffim_NaiveDipoleFlux_neg_instFluxErr
- ip_diffim_DipoleFit_pos_instFlux
- ip_diffim_DipoleFit_neg_instFlux
- ip_diffim_DipoleFit_pos_instFluxErr
- ip_diffim_DipoleFit_neg_instFluxErr
- base_LocalPhotoCalib
- base_LocalPhotoCalibErr
dipoleMeanFluxErr:
functor: LocalDipoleMeanFluxErr
args:
- ip_diffim_NaiveDipoleFlux_pos_instFlux
- ip_diffim_NaiveDipoleFlux_neg_instFlux
- ip_diffim_NaiveDipoleFlux_pos_instFluxErr
- ip_diffim_NaiveDipoleFlux_neg_instFluxErr
- ip_diffim_DipoleFit_pos_instFlux
- ip_diffim_DipoleFit_neg_instFlux
- ip_diffim_DipoleFit_pos_instFluxErr
- ip_diffim_DipoleFit_neg_instFluxErr
- base_LocalPhotoCalib
- base_LocalPhotoCalibErr
dipoleFluxDiff:
functor: LocalDipoleDiffFlux
args:
- ip_diffim_NaiveDipoleFlux_pos_instFlux
- ip_diffim_NaiveDipoleFlux_neg_instFlux
- ip_diffim_NaiveDipoleFlux_pos_instFluxErr
- ip_diffim_NaiveDipoleFlux_neg_instFluxErr
- ip_diffim_DipoleFit_pos_instFlux
- ip_diffim_DipoleFit_neg_instFlux
- ip_diffim_DipoleFit_pos_instFluxErr
- ip_diffim_DipoleFit_neg_instFluxErr
- base_LocalPhotoCalib
- base_LocalPhotoCalibErr
dipoleFluxDiffErr:
functor: LocalDipoleDiffFluxErr
args:
- ip_diffim_NaiveDipoleFlux_pos_instFlux
- ip_diffim_NaiveDipoleFlux_neg_instFlux
- ip_diffim_NaiveDipoleFlux_pos_instFluxErr
- ip_diffim_NaiveDipoleFlux_neg_instFluxErr
- ip_diffim_DipoleFit_pos_instFlux
- ip_diffim_DipoleFit_neg_instFlux
- ip_diffim_DipoleFit_pos_instFluxErr
- ip_diffim_DipoleFit_neg_instFluxErr
- base_LocalPhotoCalib
- base_LocalPhotoCalibErr
# dipoleRa not implemented
# dipoleDec not implemented
# TODO: the below statement is false! Previously, position was from the
# NaiveDipoleCentroid, which defaulted to NaiveCentroid for sources without
# a positive/negaive double peak.
# (this may be redundant with RA/DEC as the default centroid is the
# dip model, defaulting to SdssCentroid on Dip-Fit failure.)
dipoleLength:
Expand Down
6 changes: 0 additions & 6 deletions data/association-flag-map.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,6 @@ columns:
- name: slot_Centroid_flag
bit: 12
doc: general failure flag, set if anything went wrong
- name: slot_Centroid_pos_flag
bit: 13
doc: failure flag for positive, set if anything went wrong
- name: slot_Centroid_neg_flag
bit: 14
doc: failure flag for negative, set if anything went wrong
- name: slot_ApFlux_flag
bit: 15
doc: General Failure Flag
Expand Down
9 changes: 6 additions & 3 deletions tests/test_trailedSourceFilter.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,11 @@ def setUp(self):
"flags": 0}
for idx in range(self.nSources)])

self.edgeDiaSources.loc[[1, 4], 'flags'] = np.power(2, 27)
flagMap = os.path.join(utils.getPackageDir("ap_association"), "data/association-flag-map.yaml")
unpacker = UnpackApdbFlags(flagMap, "DiaSource")
bitMask = unpacker.makeFlagBitMask(["ext_trailedSources_Naive_flag_edge"])
# Flag two sources as "trailed on the edge".
self.edgeDiaSources.loc[[1, 4], "flags"] |= bitMask

def test_run(self):
"""Run trailedSourceFilterTask with the default max distance.
Expand Down Expand Up @@ -111,8 +115,7 @@ def test_run_no_trails(self):
np.testing.assert_array_equal(results.longTrailedDiaSources["diaSourceId"].values, [])

def test_run_edge(self):
"""Run trailedSourceFilterTask with the default max distance.
filtered out of the final results and put into results.trailedSources.
"""Run trailedSourceFilterTask on a source on the edge.
"""
trailedSourceFilterTask = TrailedSourceFilterTask()

Expand Down