diff --git a/pipeline/detection.py b/pipeline/detection.py index e00183aa..a93f8950 100644 --- a/pipeline/detection.py +++ b/pipeline/detection.py @@ -912,7 +912,8 @@ def extract_sources_filter(self, image): # TODO: we should check if we still need this after b/g subtraction on the input images mu, sigma = sigma_clipping(score) score = (score - mu) / sigma - det_map = abs(score) > self.pars.threshold # catch negative peaks too (can get rid of them later) + # det_map = abs(score) > self.pars.threshold # catch negative peaks too (can get rid of them later) + det_map = score > self.pars.threshold # dilate the map to merge nearby peaks struc = np.zeros((3, 3), dtype=bool) diff --git a/tests/models/test_x.py b/tests/models/test_x.py index 70e973e5..c40bddb8 100644 --- a/tests/models/test_x.py +++ b/tests/models/test_x.py @@ -10,6 +10,9 @@ from models.cutouts import Cutouts from models.measurements import Measurements +import pdb +import matplotlib.pyplot as plt + def test_filtering_measurements(ptf_datastore): # printout the list of relevant environmental variables: @@ -44,6 +47,7 @@ def test_filtering_measurements(ptf_datastore): m = measurements[0] # grab the first one as an example + # pdb.set_trace() # test that we can filter on some measurements properties with SmartSession() as session: ms = session.scalars(sa.select(Measurements).where(Measurements.flux_apertures[0] > 0)).all()