169 handleDict = butlerQC.get(inputRefs)
171 self.log.info(
"Running with %d sourceTable_visit handles", (len(handleDict[
'source_catalogs'])))
174 tract = butlerQC.quantum.dataId[
'tract']
178 sourceTableHandles = handleDict[
'source_catalogs']
179 sourceTableHandleDict = {sourceTableHandle.dataId[
'visit']: sourceTableHandle
for
180 sourceTableHandle
in sourceTableHandles}
182 visitSummaryHandles = handleDict[
'visitSummary']
183 visitSummaryHandleDict = {visitSummaryHandle.dataId[
'visit']: visitSummaryHandle
for
184 visitSummaryHandle
in visitSummaryHandles}
186 handleDict[
'sourceTableHandleDict'] = sourceTableHandleDict
187 handleDict[
'visitSummaryHandleDict'] = visitSummaryHandleDict
190 if self.config.fgcmOutputProducts.doZeropointOutput:
191 photoCalibRefDict = {photoCalibRef.dataId[
'visit']:
192 photoCalibRef
for photoCalibRef
in outputRefs.fgcmPhotoCalib}
193 handleDict[
'fgcmPhotoCalibs'] = photoCalibRefDict
195 if self.config.fgcmOutputProducts.doAtmosphereOutput:
196 atmRefDict = {atmRef.dataId[
'visit']: atmRef
for
197 atmRef
in outputRefs.fgcmTransmissionAtmosphere}
198 handleDict[
'fgcmTransmissionAtmospheres'] = atmRefDict
200 if self.config.fgcmBuildStars.doReferenceMatches:
201 refConfig = LoadReferenceObjectsConfig()
202 refConfig.filterMap = self.config.fgcmBuildStars.fgcmLoadReferenceCatalog.filterMap
203 loader = ReferenceObjectLoader(dataIds=[ref.datasetRef.dataId
204 for ref
in inputRefs.refCat],
205 refCats=butlerQC.get(inputRefs.refCat),
206 name=self.config.connections.refCat,
209 buildStarsRefObjLoader = loader
211 buildStarsRefObjLoader =
None
213 if self.config.fgcmOutputProducts.doReferenceCalibration:
214 refConfig = self.config.fgcmOutputProducts.refObjLoader
215 loader = ReferenceObjectLoader(dataIds=[ref.datasetRef.dataId
216 for ref
in inputRefs.refCat],
217 refCats=butlerQC.get(inputRefs.refCat),
218 name=self.config.connections.refCat,
221 self.fgcmOutputProducts.refObjLoader = loader
223 struct = self.
run(handleDict, tract,
224 buildStarsRefObjLoader=buildStarsRefObjLoader)
226 if struct.photoCalibCatalogs
is not None:
227 self.log.info(
"Outputting photoCalib catalogs.")
228 for visit, expCatalog
in struct.photoCalibCatalogs:
229 butlerQC.put(expCatalog, photoCalibRefDict[visit])
230 self.log.info(
"Done outputting photoCalib catalogs.")
232 if struct.atmospheres
is not None:
233 self.log.info(
"Outputting atmosphere transmission files.")
234 for visit, atm
in struct.atmospheres:
235 butlerQC.put(atm, atmRefDict[visit])
236 self.log.info(
"Done outputting atmosphere files.")
239 schema = afwTable.Schema()
240 schema.addField(
'rawRepeatability', type=np.float64,
241 doc=
"Per-band raw repeatability in FGCM calibration.")
242 repeatabilityCat = afwTable.BaseCatalog(schema)
243 repeatabilityCat.resize(len(struct.repeatability))
244 repeatabilityCat[
'rawRepeatability'][:] = struct.repeatability
246 butlerQC.put(repeatabilityCat, outputRefs.fgcmRepeatability)