Changeset 36375 for trunk/psphot/src/psphotMergeSources.c
- Timestamp:
- Dec 10, 2013, 2:55:11 PM (13 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
-
. (modified) (1 prop)
-
psphot (modified) (1 prop)
-
psphot/src (modified) (2 props)
-
psphot/src/psphotMergeSources.c (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk
-
trunk/psphot
- Property svn:mergeinfo changed
-
trunk/psphot/src
- Property svn:ignore
-
old new 24 24 psphotModelTest 25 25 psphotMinimal 26 psphotFullForce 27 psmakecff
-
- Property svn:mergeinfo changed
- Property svn:ignore
-
trunk/psphot/src/psphotMergeSources.c
r36117 r36375 39 39 psAssert (newSources, "missing sources?"); 40 40 41 // XXX TEST:42 if (detections->allSources) {43 psphotMaskCosmicRayFootprintCheck(detections->allSources);44 }45 if (detections->newSources) {46 psphotMaskCosmicRayFootprintCheck(detections->newSources);47 }48 49 41 if (!detections->allSources) { 50 42 detections->allSources = psArrayAllocEmpty(newSources->n); … … 65 57 // Merge the externally supplied sources with the existing sources. Mark them as having mode 66 58 // PM_SOURCE_MODE_EXTERNAL. 59 60 // XXX this function needs to be updated slightly for psphotFullForce: 61 // * load the additional parameters to guide the new concepts 67 62 68 63 // XXX This function needs to be updated to loop over set of input files. At the moment, we … … 73 68 bool status; 74 69 pmDetections *extCMF = NULL; 70 pmDetections *extCFF = NULL; 75 71 psArray *extSourcesTXT = NULL; 76 72 int index = 0; … … 102 98 { 103 99 pmReadout *readoutCMF = pmFPAfileThisReadout (config->files, view, "PSPHOT.INPUT.CMF"); 104 if (!readoutCMF) goto load TXT;100 if (!readoutCMF) goto loadCFF; 105 101 106 102 extCMF = psMetadataLookupPtr (NULL, readoutCMF->analysis, "PSPHOT.DETECTIONS"); … … 125 121 } 126 122 123 loadCFF: 124 // load data from input CFF file: 125 { 126 pmReadout *readoutCFF = pmFPAfileThisReadout (config->files, view, "PSPHOT.INPUT.CFF"); 127 if (!readoutCFF) goto loadTXT; 128 129 extCFF = psMetadataLookupPtr (NULL, readoutCFF->analysis, "PSPHOT.DETECTIONS"); 130 if (extCFF) { 131 psF32 exptime = psMetadataLookupF32(NULL, readout->parent->concepts, "CELL.EXPOSURE"); 132 for (int i = 0; i < extCFF->allSources->n; i++) { 133 pmSource *source = extCFF->allSources->data[i]; 134 135 // setting this bit not only tracks the inputs, it makes pmSourceMoments 136 // keep the Mx,My values for the centroid. 137 source->mode |= PM_SOURCE_MODE_EXTERNAL; 138 139 // source->peak->detValue,rawFlux,smoothFlux all set to input flux value which is scaled 140 // to 1 second exposure time. Scale to this image's exposure. 141 source->peak->rawFlux *= exptime; 142 source->peak->smoothFlux *= exptime; 143 source->peak->detValue *= exptime; 144 // source->peak->xf,yf, moments->Mx,My all set to input position 145 146 // drop the loaded source modelPSF 147 psFree (source->modelPSF); 148 source->modelPSF = NULL; 149 source->imageID = index; 150 151 psArrayAdd (detections->newSources, 100, source); 152 } 153 } 154 } 155 127 156 loadTXT: 128 157 … … 157 186 psFree (detections); 158 187 159 if (! extCMF && !extSourcesTXT) {188 if (!(extCMF || extCFF || extSourcesTXT)) { 160 189 psLogMsg ("psphot", 3, "no external sources for this readout"); 161 190 return true; … … 163 192 164 193 int nCMF = extCMF ? extCMF->allSources->n : 0; 165 int nTXT = extSourcesTXT ? extSourcesTXT->n : 0; 166 167 psLogMsg ("psphot", 3, "%d external sources (%d cmf, %d text) merged to yield %ld total sources", 168 nCMF + nTXT, nCMF, nTXT, sources->n); 194 int nCFF = extCFF ? extCFF->allSources->n : 0; 195 int nTXT = extSourcesTXT ? extSourcesTXT->n : 0; 196 197 psLogMsg ("psphot", 3, "%d external sources (%d cmf, %d cff, %d text) merged to yield %ld total sources", 198 nCMF + nCFF + nTXT, nCMF, nCFF, nTXT, sources->n); 169 199 return true; 170 200 }
Note:
See TracChangeset
for help on using the changeset viewer.
