- Timestamp:
- Mar 17, 2009, 12:08:50 PM (17 years ago)
- Location:
- branches/cnb_branches/cnb_branch_20090301
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/cnb_branches/cnb_branch_20090301
-
Property svn:mergeinfo
set to (toggle deleted branches)
/trunk merged eligible /branches/eam_branches/eam_branch_20090303 23158-23228
-
Property svn:mergeinfo
set to (toggle deleted branches)
-
branches/cnb_branches/cnb_branch_20090301/ppSub
-
Property svn:mergeinfo
set to (toggle deleted branches)
/branches/cnb_branches/cnb_branch_20090215/ppSub merged eligible /trunk/ppSub merged eligible /branches/cnb_branch_20090215/ppSub 21495-22685 /branches/eam_branches/eam_branch_20090303/ppSub 23158-23228
-
Property svn:mergeinfo
set to (toggle deleted branches)
-
branches/cnb_branches/cnb_branch_20090301/ppSub/src/ppSubMatchPSFs.c
r21524 r23352 49 49 bool mdok; // Status of MD lookup 50 50 51 // Load pre-calculated kernel, if available 52 pmReadout *kernelRO = pmFPAfileThisReadout(config->files, view, "PPSUB.OUTPUT.KERNEL"); // RO with kernel 53 51 54 // Sources in image, used for stamps: these must be loaded from previous analysis stages 52 pmReadout *sourcesRO = pmFPAfileThisReadout(config->files, view, "PPSUB.SOURCES"); // Readout with sources 53 psArray *sources = NULL; // Sources in image; used for stamps 54 if (sourcesRO) { 55 sources = psMetadataLookupPtr(&mdok, sourcesRO->analysis, "PSPHOT.SOURCES"); 55 psArray *inSources = psMetadataLookupPtr(&mdok, inRO->analysis, "PSPHOT.SOURCES"); // Input source list 56 psArray *refSources = psMetadataLookupPtr(&mdok, refRO->analysis, "PSPHOT.SOURCES"); // Ref source list 57 58 psArray *sources = NULL; // Merged list of sources 59 if (inSources && refSources) { 60 float radius = psMetadataLookupF32(NULL, recipe, "SOURCE.RADIUS"); // Matching radius 61 psArray *lists = psArrayAlloc(2); // Source lists 62 lists->data[0] = psMemIncrRefCounter(inSources); 63 lists->data[1] = psMemIncrRefCounter(refSources); 64 sources = pmSourceMatchMerge(lists, radius); 65 psFree(lists); 66 if (!sources) { 67 psError(PS_ERR_UNKNOWN, false, "Unable to merge source lists"); 68 return false; 69 } 70 } else if (inSources) { 71 sources = psMemIncrRefCounter(inSources); 72 } else if (refSources) { 73 sources = psMemIncrRefCounter(refSources); 56 74 } 75 76 psMetadataAddArray(inConv->analysis, PS_LIST_TAIL, "PSPHOT.SOURCES", PS_META_REPLACE, 77 "Merged source list", sources); 78 psMetadataAddArray(refConv->analysis, PS_LIST_TAIL, "PSPHOT.SOURCES", PS_META_REPLACE, 79 "Merged source list", sources); 80 psFree(sources); // Drop reference 57 81 58 82 int footprint = psMetadataLookupS32(NULL, recipe, "STAMP.FOOTPRINT"); // Stamp half-size … … 113 137 114 138 // Match the PSFs 115 if (!pmSubtractionMatch(inConv, refConv, inRO, refRO, footprint, stride, regionSize, spacing, threshold, 116 sources, stampsName, type, size, order, widths, orders, inner, ringsOrder, 117 binning, penalty, optimum, optWidths, optOrder, optThresh, iter, rej, sys, 118 maskVal, maskBad, maskPoor, poorFrac, badFrac, subMode)) { 119 psError(PS_ERR_UNKNOWN, false, "Unable to match images."); 120 return false; 139 if (kernelRO) { 140 if (!pmSubtractionMatchPrecalc(inConv, refConv, inRO, refRO, kernelRO->analysis, 141 stride, sys, maskVal, maskBad, maskPoor, poorFrac, badFrac)) { 142 psError(PS_ERR_UNKNOWN, false, "Unable to convolve images."); 143 return false; 144 } 145 } else { 146 if (!pmSubtractionMatch(inConv, refConv, inRO, refRO, footprint, stride, regionSize, spacing, 147 threshold, sources, stampsName, type, size, order, widths, orders, inner, 148 ringsOrder, binning, penalty, optimum, optWidths, optOrder, optThresh, iter, 149 rej, sys, maskVal, maskBad, maskPoor, poorFrac, badFrac, subMode)) { 150 psError(PS_ERR_UNKNOWN, false, "Unable to match images."); 151 return false; 152 } 121 153 } 122 154 … … 129 161 130 162 // XXX drop the pixels associated with inRO and refRO (now that we have inConv and refConf) 131 163 #ifdef TESTING 132 164 psphotSaveImage (NULL, inRO->image, "inRO.fits"); 133 165 psphotSaveImage (NULL, refRO->image, "refRO.fits"); 134 166 psphotSaveImage (NULL, inConv->image, "inConv.fits"); 135 167 psphotSaveImage (NULL, refConv->image, "refConv.fits"); 168 #endif 136 169 137 170 return true;
Note:
See TracChangeset
for help on using the changeset viewer.
