49 lutFilterNames, tract=None):
50 """
51 Make the FGCM fit cycle configuration dict
52
53 Parameters
54 ----------
55 config: `lsst.fgcmcal.FgcmFitCycleConfig`
56 Configuration object
58 LSST log object
60 Camera from the butler
61 maxIter: `int`
62 Maximum number of iterations
63 resetFitParameters: `bool`
64 Reset fit parameters before fitting?
65 outputZeropoints: `bool`
66 Compute zeropoints for output?
67 lutFilterNames : array-like, `str`
68 Array of physical filter names in the LUT.
69 tract: `int`, optional
70 Tract number for extending the output file name for debugging.
71 Default is None.
72
73 Returns
74 -------
75 configDict: `dict`
76 Configuration dictionary for fgcm
77 """
78
79 notFitBands = [b for b in config.bands if b not in config.fitBands]
80
81
82 starColorCutList = []
83 for ccut in config.starColorCuts:
84 if ccut == 'NO_DATA':
85
86 break
87 parts = ccut.split(',')
88 starColorCutList.append([parts[0], parts[1], float(parts[2]), float(parts[3])])
89
90
91 refStarColorCutList = []
92 for ccut in config.refStarColorCuts:
93 if ccut == 'NO_DATA':
94
95 break
96 parts = ccut.split(',')
97 refStarColorCutList.append([parts[0], parts[1], float(parts[2]), float(parts[3])])
98
99
100
101
102 mirrorArea = np.pi*(camera.telescopeDiameter*100./2.)**2.
103
104
105 gains = [amp.getGain() for detector in camera for amp in detector.getAmplifiers()]
106 cameraGain = float(np.median(gains))
107
108
109 filterToBand = {filterName: config.physicalFilterMap[filterName] for
110 filterName in lutFilterNames}
111
112 if tract is None:
113 outfileBase = config.outfileBase
114 else:
115 outfileBase = '%s-%06d' % (config.outfileBase, tract)
116
117
118 configDict = {'outfileBase': outfileBase,
119 'logger': log,
120 'exposureFile': None,
121 'obsFile': None,
122 'indexFile': None,
123 'lutFile': None,
124 'mirrorArea': mirrorArea,
125 'cameraGain': cameraGain,
126 'ccdStartIndex': camera[0].getId(),
127 'expField': FGCM_EXP_FIELD,
128 'ccdField': FGCM_CCD_FIELD,
129 'seeingField': 'DELTA_APER',
130 'fwhmField': 'PSFSIGMA',
131 'skyBrightnessField': 'SKYBACKGROUND',
132 'deepFlag': 'DEEPFLAG',
133 'bands':
list(config.bands),
134 'fitBands':
list(config.fitBands),
135 'notFitBands': notFitBands,
136 'requiredBands':
list(config.requiredBands),
137 'filterToBand': filterToBand,
138 'logLevel': 'INFO',
139 'nCore': config.nCore,
140 'nStarPerRun': config.nStarPerRun,
141 'nExpPerRun': config.nExpPerRun,
142 'reserveFraction': config.reserveFraction,
143 'freezeStdAtmosphere': config.freezeStdAtmosphere,
144 'precomputeSuperStarInitialCycle': config.precomputeSuperStarInitialCycle,
145 'superStarSubCCDDict': dict(config.superStarSubCcdDict),
146 'superStarSubCCDChebyshevOrder': config.superStarSubCcdChebyshevOrder,
147 'superStarSubCCDTriangular': config.superStarSubCcdTriangular,
148 'superStarSigmaClip': config.superStarSigmaClip,
149 'focalPlaneSigmaClip': config.focalPlaneSigmaClip,
150 'ccdGraySubCCDDict': dict(config.ccdGraySubCcdDict),
151 'ccdGraySubCCDChebyshevOrder': config.ccdGraySubCcdChebyshevOrder,
152 'ccdGraySubCCDTriangular': config.ccdGraySubCcdTriangular,
153 'ccdGrayFocalPlaneDict': dict(config.ccdGrayFocalPlaneDict),
154 'ccdGrayFocalPlaneChebyshevOrder': config.ccdGrayFocalPlaneChebyshevOrder,
155 'ccdGrayFocalPlaneFitMinCcd': config.ccdGrayFocalPlaneFitMinCcd,
156 'cycleNumber': config.cycleNumber,
157 'maxIter': maxIter,
158 'deltaMagBkgOffsetPercentile': config.deltaMagBkgOffsetPercentile,
159 'deltaMagBkgPerCcd': config.deltaMagBkgPerCcd,
160 'UTBoundary': config.utBoundary,
161 'washMJDs': config.washMjds,
162 'epochMJDs': config.epochMjds,
163 'coatingMJDs': config.coatingMjds,
164 'minObsPerBand': config.minObsPerBand,
165 'latitude': config.latitude,
166 'defaultCameraOrientation': config.defaultCameraOrientation,
167 'brightObsGrayMax': config.brightObsGrayMax,
168 'minStarPerCCD': config.minStarPerCcd,
169 'minCCDPerExp': config.minCcdPerExp,
170 'maxCCDGrayErr': config.maxCcdGrayErr,
171 'minStarPerExp': config.minStarPerExp,
172 'minExpPerNight': config.minExpPerNight,
173 'expGrayInitialCut': config.expGrayInitialCut,
174 'expGrayPhotometricCutDict': dict(config.expGrayPhotometricCutDict),
175 'expGrayHighCutDict': dict(config.expGrayHighCutDict),
176 'expGrayRecoverCut': config.expGrayRecoverCut,
177 'expVarGrayPhotometricCutDict': dict(config.expVarGrayPhotometricCutDict),
178 'expGrayErrRecoverCut': config.expGrayErrRecoverCut,
179 'refStarSnMin': config.refStarSnMin,
180 'refStarOutlierNSig': config.refStarOutlierNSig,
181 'applyRefStarColorCuts': config.applyRefStarColorCuts,
182 'useExposureReferenceOffset': config.useExposureReferenceOffset,
183 'illegalValue': FGCM_ILLEGAL_VALUE,
184 'starColorCuts': starColorCutList,
185 'refStarColorCuts': refStarColorCutList,
186 'aperCorrFitNBins': config.aperCorrFitNBins,
187 'aperCorrInputSlopeDict': dict(config.aperCorrInputSlopeDict),
188 'sedBoundaryTermDict': config.sedboundaryterms.toDict()['data'],
189 'sedTermDict': config.sedterms.toDict()['data'],
190 'colorSplitBands':
list(config.colorSplitBands),
191 'sigFgcmMaxErr': config.sigFgcmMaxErr,
192 'sigFgcmMaxEGrayDict': dict(config.sigFgcmMaxEGrayDict),
193 'ccdGrayMaxStarErr': config.ccdGrayMaxStarErr,
194 'approxThroughputDict': dict(config.approxThroughputDict),
195 'sigmaCalRange':
list(config.sigmaCalRange),
196 'sigmaCalFitPercentile':
list(config.sigmaCalFitPercentile),
197 'sigmaCalPlotPercentile':
list(config.sigmaCalPlotPercentile),
198 'sigma0Phot': config.sigma0Phot,
199 'mapLongitudeRef': config.mapLongitudeRef,
200 'mapNSide': config.mapNSide,
201 'varNSig': 100.0,
202 'varMinBand': 2,
203 'useRetrievedPwv': False,
204 'useNightlyRetrievedPwv': False,
205 'pwvRetrievalSmoothBlock': 25,
206 'useQuadraticPwv': config.useQuadraticPwv,
207 'useRetrievedTauInit': False,
208 'tauRetrievalMinCCDPerNight': 500,
209 'modelMagErrors': config.modelMagErrors,
210 'instrumentParsPerBand': config.instrumentParsPerBand,
211 'instrumentSlopeMinDeltaT': config.instrumentSlopeMinDeltaT,
212 'fitMirrorChromaticity': config.fitMirrorChromaticity,
213 'useRepeatabilityForExpGrayCutsDict': dict(config.useRepeatabilityForExpGrayCutsDict),
214 'autoPhotometricCutNSig': config.autoPhotometricCutNSig,
215 'autoHighCutNSig': config.autoHighCutNSig,
216 'deltaAperInnerRadiusArcsec': config.deltaAperInnerRadiusArcsec,
217 'deltaAperOuterRadiusArcsec': config.deltaAperOuterRadiusArcsec,
218 'deltaAperFitMinNgoodObs': config.deltaAperFitMinNgoodObs,
219 'deltaAperFitPerCcdNx': config.deltaAperFitPerCcdNx,
220 'deltaAperFitPerCcdNy': config.deltaAperFitPerCcdNy,
221 'deltaAperFitSpatialNside': config.deltaAperFitSpatialNside,
222 'doComputeDeltaAperExposures': config.doComputeDeltaAperPerVisit,
223 'doComputeDeltaAperStars': config.doComputeDeltaAperPerStar,
224 'doComputeDeltaAperMap': config.doComputeDeltaAperMap,
225 'doComputeDeltaAperPerCcd': config.doComputeDeltaAperPerCcd,
226 'printOnly': False,
227 'quietMode': config.quietMode,
228 'randomSeed': config.randomSeed,
229 'outputStars': False,
230 'outputPath': os.path.abspath('.'),
231 'clobber': True,
232 'useSedLUT': False,
233 'resetParameters': resetFitParameters,
234 'doPlots': config.doPlots,
235 'outputFgcmcalZpts': True,
236 'outputZeropoints': outputZeropoints}
237
238 return configDict
239
240
This static class includes a variety of methods for interacting with the the logging module.
daf::base::PropertyList * list