Skip to content

Commit

Permalink
lint fix
Browse files Browse the repository at this point in the history
Update tests


Lint
  • Loading branch information
bsmartradio committed Aug 22, 2023
1 parent e638f3a commit d77698c
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 10 deletions.
3 changes: 1 addition & 2 deletions python/lsst/ap/association/diaPipe.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,7 @@
AssociationTask,
DiaForcedSourceTask,
LoadDiaCatalogsTask,
PackageAlertsTask,
TrailedSourceFilterTask)
PackageAlertsTask,)
from lsst.ap.association.ssoAssociation import SolarSystemAssociationTask


Expand Down
11 changes: 6 additions & 5 deletions python/lsst/ap/association/trailedSourceFilter.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
----------
Expand All @@ -68,20 +68,21 @@ 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(
diaSources=dia_sources[~trail_mask].reset_index(drop=True),
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.
Expand Down
2 changes: 0 additions & 2 deletions tests/test_association_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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)
Expand Down
1 change: 0 additions & 1 deletion tests/test_trailedSourceFilter.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit d77698c

Please sign in to comment.