Skip to content

Commit

Permalink
Update tests to exercise new reference star functionality.
Browse files Browse the repository at this point in the history
  • Loading branch information
erykoff committed May 24, 2022
1 parent a7d031b commit 0f92ee5
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
2 changes: 2 additions & 0 deletions tests/config/fgcmFitCycleHsc.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@
extrapolated=False, constant=0.75)
# Define good stars with an r-i color cut.
config.starColorCuts = ('r,i,-0.50,2.25',)
config.refStarColorCuts = ('r, i, 0.0, 2.0',)
config.useExposureReferenceOffset = True
config.precomputeSuperStarInitialCycle = False
config.superStarSubCcdDict = {'g': True,
'r': True,
Expand Down
16 changes: 9 additions & 7 deletions tests/test_fgcmcal_hsc.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,25 +92,27 @@ def test_fgcmcalPipeline(self):
nOkZp = 27
nBadZp = 1093
nStdStars = 235
nPlots = 43
nPlots = 48

self._testFgcmFitCycle(instName, testName,
0, nZp, nGoodZp, nOkZp, nBadZp, nStdStars, nPlots, skipChecks=True)
self._testFgcmFitCycle(instName, testName,
1, nZp, nGoodZp, nOkZp, nBadZp, nStdStars, nPlots, skipChecks=True)

# We need to create an extra config file to turn on "sub-ccd gray" for testing.
# We also want to exercise the code path setting useExposureReferenceOffset = False.
extraConfigFile = os.path.join(self.testDir, "cycle03_patch_config.py")
with open(extraConfigFile, "w") as f:
f.write("config.isFinalCycle = True\n")
f.write("config.ccdGraySubCcdDict = {'g': True, 'r': True, 'i': True}\n")
f.write("config.useExposureReferenceOffset = False")

self._testFgcmFitCycle(instName, testName,
2, nZp, nGoodZp, nOkZp, nBadZp, nStdStars, nPlots,
extraConfig=extraConfigFile)

zpOffsets = np.array([-0.0008161436999216676,
0.006149172317236662])
zpOffsets = np.array([-0.0008051003096625209,
0.0072303167544305325])

self._testFgcmOutputProducts(instName, testName,
zpOffsets, 36236, 87, 'i', 1)
Expand All @@ -135,8 +137,8 @@ def test_fgcmcalMultipleFitPipeline(self):

# These are slightly different from above due to the configuration change
# mid-way in the separate fits.
zpOffsets = np.array([-0.0007102462113834918,
0.005907602142542601])
zpOffsets = np.array([-0.0006988655077293515,
0.004102597013115883])

self._testFgcmMultiFit(instName, testName,
"physical_filter IN ('HSC-G', 'HSC-R', 'HSC-I')",
Expand All @@ -159,8 +161,8 @@ def test_fgcmcalTractPipeline(self):
nBand, i0Std, i0Recon, i10Std, i10Recon)

rawRepeatability = np.array([0.0,
0.004436014222072738,
0.00451764656339253])
0.0025195920941720683,
0.004095912225403857])
filterNCalibMap = {'HSC-R': 12,
'HSC-I': 15}

Expand Down

0 comments on commit 0f92ee5

Please sign in to comment.