Skip to content

Commit

Permalink
Sync up random seed for FringeTask in gen2 & gen3
Browse files Browse the repository at this point in the history
  • Loading branch information
laurenam committed May 3, 2021
1 parent 669e18e commit dffc3e0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
8 changes: 5 additions & 3 deletions python/lsst/ip/isr/fringe.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ class FringeTask(Task):
ConfigClass = FringeConfig
_DefaultName = 'isrFringe'

def readFringes(self, dataRef, assembler=None):
def readFringes(self, dataRef, expId=None, assembler=None):
"""Read the fringe frame(s), and pack data into a Struct
The current implementation assumes only a single fringe frame and
Expand All @@ -93,6 +93,8 @@ def readFringes(self, dataRef, assembler=None):
dataRef : `daf.butler.butlerSubset.ButlerDataRef`
Butler reference for the exposure that will have fringing
removed.
expId : `int`, optional
Exposure id to be fringe corrected, used to set RNG seed.
assembler : `lsst.ip.isr.AssembleCcdTask`, optional
An instance of AssembleCcdTask (for assembling fringe
frames).
Expand All @@ -111,9 +113,9 @@ def readFringes(self, dataRef, assembler=None):
except Exception as e:
raise RuntimeError("Unable to retrieve fringe for %s: %s" % (dataRef.dataId, e))

return self.loadFringes(fringe, assembler)
return self.loadFringes(fringe, expId=expId, assembler=assembler)

def loadFringes(self, fringeExp, expId=0, assembler=None):
def loadFringes(self, fringeExp, expId=None, assembler=None):
"""Pack the fringe data into a Struct.
This method moves the struct parsing code into a butler
Expand Down
3 changes: 2 additions & 1 deletion python/lsst/ip/isr/isrTask.py
Original file line number Diff line number Diff line change
Expand Up @@ -1163,7 +1163,8 @@ def readIsrData(self, dataRef, rawExposure):

defectList = (dataRef.get("defects")
if self.config.doDefect else None)
fringeStruct = (self.fringe.readFringes(dataRef, assembler=self.assembleCcd
expId = rawExposure.getInfo().getVisitInfo().getExposureId()
fringeStruct = (self.fringe.readFringes(dataRef, expId=expId, assembler=self.assembleCcd
if self.config.doAssembleIsrExposures else None)
if self.config.doFringe and self.fringe.checkFilter(rawExposure)
else pipeBase.Struct(fringes=None))
Expand Down

0 comments on commit dffc3e0

Please sign in to comment.