diff --git a/python/lsst/ap/association/diaPipe.py b/python/lsst/ap/association/diaPipe.py index e6d5bc0b..daae6dd0 100644 --- a/python/lsst/ap/association/diaPipe.py +++ b/python/lsst/ap/association/diaPipe.py @@ -45,8 +45,7 @@ AssociationTask, DiaForcedSourceTask, LoadDiaCatalogsTask, - PackageAlertsTask, - TrailedSourceFilterTask) + PackageAlertsTask,) from lsst.ap.association.ssoAssociation import SolarSystemAssociationTask diff --git a/python/lsst/ap/association/trailedSourceFilter.py b/python/lsst/ap/association/trailedSourceFilter.py index 00a63335..049ff812 100644 --- a/python/lsst/ap/association/trailedSourceFilter.py +++ b/python/lsst/ap/association/trailedSourceFilter.py @@ -52,8 +52,8 @@ class TrailedSourceFilterTask(pipeBase.Task): @timeMethod def run(self, dia_sources, diffIm): - """Find trailed sources which have not been filtered out and will - not be included in the diaSource catalog. + """Find trailed sources which do not meet requirements and + will not be included in the diaSource catalog. Parameters ---------- @@ -68,12 +68,13 @@ def run(self, dia_sources, diffIm): result : `lsst.pipe.base.Struct` Results struct with components. - - ``"dia_sources"`` : DiaSource table that is free from unwanted + - ``dia_sources`` : DiaSource table that is free from unwanted trailed sources (`pandas.DataFrame`) - - ``"trailed_dia_sources"`` : DiaSources that have trailed more + - ``trailed_dia_sources`` : DiaSources that have trailed more than 0.416 arcseconds/second*exposure_time(`pandas.DataFrame`) """ + trail_mask = self.check_dia_source_trail(dia_sources, diffIm) return pipeBase.Struct( @@ -81,7 +82,7 @@ def run(self, dia_sources, diffIm): trailedDiaSources=dia_sources[trail_mask].reset_index(drop=True)) def check_dia_source_trail(self, dia_sources, diffIm): - """Check that all DiaSources have trails. + """Find DiaSources that have trails. Creates a mask for sources with lengths greater than 0.416 arcseconds/second times the exposure time. diff --git a/tests/test_association_task.py b/tests/test_association_task.py index f7a0c607..a5c18aa8 100644 --- a/tests/test_association_task.py +++ b/tests/test_association_task.py @@ -23,7 +23,6 @@ import pandas as pd import unittest import lsst.afw.image as afwImage -from lsst.afw.coord import Weather import lsst.geom as geom import lsst.utils.tests @@ -55,7 +54,6 @@ def setUp(self): "diaSourceId": idx + 1 + self.nObjects, "diaObjectId": 0, "trailLength": 5.5*idx} for idx in range(self.nSources)]) visitInfo = afwImage.VisitInfo(exposureTime=30.0, - weather=Weather(1.1, 2.2, 34.5), ) exposureInfo = afwImage.ExposureInfo() exposureInfo.setVisitInfo(visitInfo) diff --git a/tests/test_trailedSourceFilter.py b/tests/test_trailedSourceFilter.py index 1e33ff7c..c946a03b 100644 --- a/tests/test_trailedSourceFilter.py +++ b/tests/test_trailedSourceFilter.py @@ -21,7 +21,6 @@ def setUp(self): "diaSourceId": idx, "diaObjectId": 0, "trailLength": 5.5*idx} for idx in range(self.nSources)]) visitInfo = afwImage.VisitInfo(exposureTime=30.0, - weather=Weather(1.1, 2.2, 34.5), ) exposureInfo = afwImage.ExposureInfo() exposureInfo.setVisitInfo(visitInfo)