Skip to content

Commit

Permalink
Merge pull request #6 from erykoff/localbkgclean
Browse files Browse the repository at this point in the history
Clean up some local background code.
  • Loading branch information
erykoff committed Aug 12, 2020
2 parents 1cadd0a + 8c59ae9 commit 8f13d65
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 16 deletions.
2 changes: 1 addition & 1 deletion fgcm/_version.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
__version__ = '3.5.0'
__version__ = '3.5.1'

__version_info__ = __version__.split('.')
2 changes: 1 addition & 1 deletion fgcm/fgcmConfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ class FgcmConfig(object):
outfileBase = ConfigField(str, required=True)
maxIter = ConfigField(int, default=50)
deltaMagBkgOffsetPercentile = ConfigField(float, default=0.25)
deltaMagBkgPerCcd = ConfigField(bool, default=True)
deltaMagBkgPerCcd = ConfigField(bool, default=False)
sigFgcmMaxErr = ConfigField(float, default=0.01)
sigFgcmMaxEGrayDict = ConfigField(dict, default={})
ccdGrayMaxStarErr = ConfigField(float, default=0.10)
Expand Down
24 changes: 10 additions & 14 deletions fgcm/fgcmFitCycle.py
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ def run(self):
self.fgcmLog.debug('FitCycle is running selectGoodExposures()')
self.expSelector.selectGoodExposures()

# Add in background offset terms if necessary
# Add in local background offset terms if necessary
if self.fgcmStars.hasDeltaMagBkg:
self.fgcmGray.computeCCDAndExpDeltaMagBkg()

Expand Down Expand Up @@ -418,7 +418,6 @@ def run(self):
self.fgcmLog.debug('FitCycle computing FgcmChisq all + reserve stars')
_ = self.fgcmChisq(self.fgcmPars.getParArray(), includeReserve=True)

# if self.fgcmConfig.maxIter == 0 and self.fgcmStars.hasRefstars:
if self.finalCycle and self.fgcmStars.hasRefstars:
# Redo absolute offset here for total consistency with final
# parameters and values
Expand Down Expand Up @@ -496,40 +495,37 @@ def run(self):
#self.fgcmRetrieveAtmosphere.r0ToNightlyTau(self.fgcmRetrieval)
#self.fgcmRetrieveAtmosphere.expGrayToNightlyTau(self.fgcmGray)


# Compute SuperStar Flats
if not self.finalCycle:
self.fgcmLog.debug('FitCycle computing SuperStarFlats')
superStarFlat = FgcmSuperStarFlat(self.fgcmConfig,self.fgcmPars,self.fgcmStars)
superStarFlat.computeSuperStarFlats()

if not self.quietMode:
self.fgcmLog.info(getMemoryString('After computing superstar flats'))
if not self.quietMode:
self.fgcmLog.info(getMemoryString('After computing superstar flats'))

# Compute Aperture Corrections
if not self.finalCycle:
# Compute Aperture Corrections
self.fgcmLog.debug('FitCycle computing ApertureCorrections')
aperCorr = FgcmApertureCorrection(self.fgcmConfig,self.fgcmPars,self.fgcmGray)
aperCorr.computeApertureCorrections()

if not self.quietMode:
self.fgcmLog.info(getMemoryString('After computing aperture corrections'))

# Compute mirror chromaticity
if not self.finalCycle and self.fgcmConfig.fitMirrorChromaticity:
self.fgcmLog.debug("FitCycle computing mirror chromaticity")
mirChrom = FgcmMirrorChromaticity(self.fgcmConfig, self.fgcmPars, self.fgcmStars, self.fgcmLUT)
mirChrom.computeMirrorChromaticity()
# Compute mirror chromaticity
if self.fgcmConfig.fitMirrorChromaticity:
self.fgcmLog.debug("FitCycle computing mirror chromaticity")
mirChrom = FgcmMirrorChromaticity(self.fgcmConfig, self.fgcmPars, self.fgcmStars, self.fgcmLUT)
mirChrom.computeMirrorChromaticity()

if not self.finalCycle:
# Compute QE sys slope
self.fgcmLog.debug('FitCycle computing qe sys slope')
self.fgcmQeSysSlope.computeQeSysSlope('final')
self.fgcmQeSysSlope.plotQeSysRefStars('final')

if not self.quietMode:
self.fgcmLog.info(getMemoryString('After computing qe sys slope'))

if not self.finalCycle:
# Compute mag error model (if configured)
self.fgcmModelMagErrs.computeMagErrorModel('postfit')

Expand Down

0 comments on commit 8f13d65

Please sign in to comment.