@@ -101,12 +101,50 @@ def testComputeExposureSummary(self):
101101 background .append (backobj )
102102
103103 # Configure and run the task
104+ expSummaryTaskNoUpdates = ComputeExposureSummaryStatsTask ()
104105 expSummaryTask = ComputeExposureSummaryStatsTask ()
105106 # Configure nominal values for effective time calculation
106107 expSummaryTask .config .fiducialZeroPoint = {band : float (zp )}
107108 expSummaryTask .config .fiducialPsfSigma = {band : float (psfSize )}
108109 expSummaryTask .config .fiducialSkyBackground = {band : float (skyMean )}
109- # Run the task
110+
111+ # Run the task with optianal updates turned off
112+ expSummaryTaskNoUpdates .config .doUpdatePsfModelStats = False
113+ expSummaryTaskNoUpdates .config .doUpdateApCorrModelStats = False
114+ expSummaryTaskNoUpdates .config .doUpdateMaxDistToNearestPsfStats = False
115+ expSummaryTaskNoUpdates .config .doUpdateWcsStats = False
116+ expSummaryTaskNoUpdates .config .doUpdatePhotoCalibStats = False
117+ expSummaryTaskNoUpdates .config .doUpdateBackgroundStats = False
118+ expSummaryTaskNoUpdates .config .doUpdateMaskedImageStats = False
119+ expSummaryTaskNoUpdates .config .doUpdateEffectiveTimeStats = False
120+
121+ summary = expSummaryTaskNoUpdates .run (exposure , None , background )
122+ # Test the outputs
123+ self .assertTrue (np .isnan (summary .ra ))
124+ self .assertTrue (np .isnan (summary .dec ))
125+
126+ # The following PSF metrics are always updated
127+ self .assertFloatsAlmostEqual (summary .expTime , expTime )
128+ self .assertFloatsAlmostEqual (summary .psfSigma , psfSize )
129+ self .assertFloatsAlmostEqual (summary .psfIxx , psfSize ** 2. )
130+ self .assertFloatsAlmostEqual (summary .psfIyy , psfSize ** 2. )
131+ self .assertFloatsAlmostEqual (summary .psfIxy , 0.0 )
132+ self .assertFloatsAlmostEqual (summary .psfArea , 23.088975164455444 )
133+
134+ # The following should not have been updated (i.e. set to nan)
135+ self .assertTrue (np .isnan (summary .psfTraceRadiusDelta ))
136+ self .assertTrue (np .isnan (summary .psfApFluxDelta ))
137+ self .assertTrue (np .isnan (summary .psfApCorrSigmaScaledDelta ))
138+ self .assertTrue (np .isnan (summary .maxDistToNearestPsf ))
139+ self .assertTrue (np .isnan (summary .pixelScale ))
140+
141+ self .assertTrue (np .isnan (summary .zenithDistance ))
142+ self .assertTrue (np .isnan (summary .skyBg ))
143+ self .assertTrue (np .isnan (summary .skyNoise ))
144+ self .assertTrue (np .isnan (summary .meanVar ))
145+ self .assertTrue (np .isnan (summary .zeroPoint ))
146+
147+ # Run the task with updates
110148 summary = expSummaryTask .run (exposure , None , background )
111149
112150 # Test the outputs
0 commit comments