Changeset 41414
- Timestamp:
- Sep 17, 2020, 12:19:25 PM (6 years ago)
- Location:
- branches/eam_branches/gDiff.20200202/src
- Files:
-
- 6 edited
-
gDiffCamera.c (modified) (2 diffs)
-
gDiffDefineOutput.c (modified) (1 diff)
-
gDiffExtras.c (modified) (2 diffs)
-
gDiffFiles.c (modified) (1 diff)
-
gDiffLoop.c (modified) (12 diffs)
-
gDiffMakePSF.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/gDiff.20200202/src/gDiffCamera.c
r41413 r41414 475 475 if (data->forcedPhot1) { 476 476 // this pmFPAfile is used to carry sources detected in the positive image #1 477 pmFPAfile *posSources1 = defineOutputFile(config, input, true, "GDIFF.POS1.SOURCES", PM_FPA_FILE_CMF);477 pmFPAfile *posSources1 = defineOutputFile(config, output, true, "GDIFF.POS1.SOURCES", PM_FPA_FILE_CMF); 478 478 if (!posSources1) { 479 479 psError(psErrorCodeLast(), false, "Unable to set up forced source file."); … … 483 483 484 484 // this pmFPAfile is used to carry sources detected in the diff image @ the positions from positive image #1 485 pmFPAfile *frcSources1 = defineOutputFile(config, input, true, "GDIFF.FORCED1.SOURCES", PM_FPA_FILE_CMF);485 pmFPAfile *frcSources1 = defineOutputFile(config, output, true, "GDIFF.FORCED1.SOURCES", PM_FPA_FILE_CMF); 486 486 if (!frcSources1) { 487 487 psError(psErrorCodeLast(), false, "Unable to set up forced source file."); -
branches/eam_branches/gDiff.20200202/src/gDiffDefineOutput.c
r41413 r41414 27 27 28 28 // The output readout may already be present if we read in the convolution kernel 29 // NOTE: pmReadoutAlloc returns a reference and saves one on the supplied cell. The 30 // psMemIncrRefCounter below is needed in the first block so we can free the 31 // reference. (we should code this to drop the returned reference in the second block 29 32 pmReadout *outRO = NULL; // Output readout 30 33 if (outCell->readouts && outCell->readouts->n > 0 && outCell->readouts->data[0]) { -
branches/eam_branches/gDiff.20200202/src/gDiffExtras.c
r41413 r41414 21 21 if (!targetRO) { 22 22 pmCell *targetCell = pmFPAviewThisCell(view, target->fpa); 23 targetRO = pmReadoutAlloc(targetCell); 23 targetRO = pmReadoutAlloc(targetCell); // returns a reference and adds one to the cell 24 24 psAssert(targetRO, "programming error: could not make target readout"); 25 psFree (targetRO); // free the reference 25 26 } 26 27 … … 55 56 if (hdu) { 56 57 psMetadata *header = psMetadataLookupMetadata(NULL, targetRO->analysis, "PSPHOT.HEADER"); // Header 57 hdu->header = psMetadataCopy(hdu->header, header); 58 if (header) { 59 hdu->header = psMetadataCopy(hdu->header, header); 60 } 58 61 } 59 62 -
branches/eam_branches/gDiff.20200202/src/gDiffFiles.c
r41413 r41414 31 31 32 32 // Subtraction photometry 33 static const char *subPhotFiles[] = { "GDIFF.OUTPUT.SOURCES", NULL }; 33 static const char *subPhotFiles[] = { "GDIFF.OUTPUT.SOURCES", 34 "GDIFF.POS1.SOURCES", "GDIFF.FORCED1.SOURCES", 35 "GDIFF.POS2.SOURCES", "GDIFF.FORCED2.SOURCES", NULL }; 34 36 35 37 // Inverse subtraction files -
branches/eam_branches/gDiff.20200202/src/gDiffLoop.c
r41413 r41414 26 26 psAssert(config, "Require configuration."); 27 27 28 HDUCHECK ("0a: start gDiffLoop");29 30 28 psMetadata *recipe = psMetadataLookupMetadata(NULL, config->recipes, GDIFF_RECIPE); // Recipe for ppSim 31 29 psAssert(recipe, "We checked this earlier, so it should be here."); … … 49 47 psTimerStart("GDIFF_MATCH"); 50 48 51 HDUCHECK ("0b: gDiffSetMasks");52 53 49 if (!gDiffSetMasks(config)) { 54 50 psError(psErrorCodeLast(), false, "Unable to set masks."); … … 56 52 } 57 53 58 HDUCHECK ("0b.1: gDiffInputDetections");59 54 if (data->forcedPhot1) { 60 55 bool foundDetections = false; … … 70 65 } 71 66 } 72 HDUCHECK ("0b.2: gDiffInputDetections"); 67 73 68 if (data->forcedPhot2) { 74 69 // XXX why is this only done for Phot2 and not Phot1 ?? … … 110 105 **** This is the core of the PSF-matched image subtraction code. ****/ 111 106 112 HDUCHECK ("1: before gDiffMatchPSFs");113 114 107 if (!gDiffMatchPSFs(data)) { 115 108 psError(psErrorCodeLast(), false, "Unable to match PSFs."); … … 152 145 } 153 146 154 HDUCHECK ("2: after gDiffLowThreshold");155 156 147 // Set up subtraction files 157 148 if (!gDiffFilesIterateDown(config, GDIFF_FILES_SUB)) { … … 166 157 goto ESCAPE; 167 158 } 168 169 HDUCHECK ("2a: gDiffMakePSF");170 159 171 160 // the functions in this block are not critical for initial testing, so block them out for now … … 186 175 } 187 176 188 HDUCHECK ("3: before gDiffReadoutSubtract");189 190 177 if (!gDiffReadoutSubtract(config)) { 191 178 psError(psErrorCodeLast(), false, "Unable to subtract images."); … … 208 195 } 209 196 210 HDUCHECK ("4: before gDiffBackground");211 212 197 // Higher order background subtraction using psphot 213 198 if (!gDiffBackground(config)) { … … 218 203 // dumpout(config, "diff.2b.fits"); 219 204 220 HDUCHECK ("5: before gDiffVarianceRescale");221 222 205 // Perform Variance correction (rescale within a modest range) 223 206 if (!gDiffVarianceRescale(config, data)) { … … 240 223 } 241 224 242 HDUCHECK ("6: before gDiffReadoutPhotometry");243 244 225 if (!data->quality && !gDiffReadoutPhotometry("GDIFF.OUTPUT", data)) { 245 226 psError(psErrorCodeLast(), false, "Unable to perform photometry."); … … 248 229 } 249 230 // dumpout(config, "diff.3.fits"); 250 251 HDUCHECK ("7: before gDiffReadoutForcedPhot (1)");252 231 253 232 // forced photometry for positive image 1 -
branches/eam_branches/gDiff.20200202/src/gDiffMakePSF.c
r41413 r41414 17 17 psAssert(config, "Require configuration"); 18 18 19 if (!data->photometry ) {19 if (!data->photometry && !data->forcedPhot1 && !data->forcedPhot2) { 20 20 return true; 21 21 }
Note:
See TracChangeset
for help on using the changeset viewer.
