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