Skip to content

Commit a95b24f

Browse files
authored
Merge pull request #503 from lsst/tickets/DM-49576
DM-49576: Compare DateTimes for straylight
2 parents e06336b + 16c8e40 commit a95b24f

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

python/lsst/obs/subaru/strayLight/yStrayLight.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@
1616

1717
__all__ = ["SubaruStrayLightTask"]
1818

19-
import datetime
2019
from typing import Optional
2120

2221
import numpy
2322
from astropy.io import fits
2423
import scipy.interpolate
2524

25+
from lsst.daf.base import DateTime
2626
from lsst.geom import Angle, degrees
2727
from lsst.daf.butler import DeferredDatasetHandle
2828
from lsst.ip.isr.straylight import StrayLightConfig, StrayLightTask, StrayLightData
@@ -33,6 +33,10 @@
3333

3434
BAD_THRESHOLD = 500 # Threshold for identifying bad pixels in the reconstructed dark image
3535

36+
# LEDs causing the stray light were been covered up by his date.
37+
# We believe there is no remaining stray light.
38+
_STRAY_LIGHT_FIXED_DATE = DateTime("2018-01-01T00:00:00Z", DateTime.UTC)
39+
3640

3741
class SubaruStrayLightTask(StrayLightTask):
3842
"""Remove stray light in the y-band
@@ -61,9 +65,7 @@ def check(self, exposure):
6165
if detId in range(104, 112):
6266
# No correction data: assume it's zero
6367
return False
64-
if exposure.getInfo().getVisitInfo().getDate().toPython() >= datetime.datetime(2018, 1, 1):
65-
# LEDs causing the stray light have been covered up.
66-
# We believe there is no remaining stray light.
68+
if exposure.visitInfo.date >= _STRAY_LIGHT_FIXED_DATE:
6769
return False
6870

6971
return True

0 commit comments

Comments
 (0)