- Timestamp:
- Jul 17, 2014, 12:30:45 PM (12 years ago)
- Location:
- branches/eam_branches/ipp-ops-20130712/psphot
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-ops-20130712/psphot
- Property svn:mergeinfo deleted
-
branches/eam_branches/ipp-ops-20130712/psphot/src
- Property svn:ignore
-
old new 24 24 psphotModelTest 25 25 psphotMinimal 26 psphotFullForce 27 psmakecff 28 psphotFullForceSummary
-
- Property svn:mergeinfo deleted
- Property svn:ignore
-
branches/eam_branches/ipp-ops-20130712/psphot/src/psphotMergeSources.c
r34266 r37066 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 } … … 812 842 // array containing the child sources. XXX currently, this is only used by psphotStackReadout 813 843 // (sources go on allSources so that psphotChoosePSF can be called repeatedly) 814 psArray *psphotSourceChildrenByObject (pmConfig *config, const pmFPAview *view, const char *filerule, psArray *objectsSrc ) {844 psArray *psphotSourceChildrenByObject (pmConfig *config, const pmFPAview *view, const char *filerule, psArray *objectsSrc, bool sourcesSubtracted) { 815 845 816 846 bool status; … … 919 949 // child sources have not been subtracted in this image, but this flag may be raised if 920 950 // they were subtracted in the parent's image 921 sourceOut->tmpFlags &= ~PM_SOURCE_TMPF_SUBTRACTED; 951 // XXX NOTE : in the pre-20130914 version of psphotStack, we carried a copy of the pixels 952 // generated before the subtraction took place (and then we smoothed to match the desired PSF). 953 // in the new version, we copy the image after subtraction; we need to distinguish these cases 954 if (!sourcesSubtracted) { 955 sourceOut->tmpFlags &= ~PM_SOURCE_TMPF_SUBTRACTED; 956 } 922 957 923 958 // set the output detections:
Note:
See TracChangeset
for help on using the changeset viewer.
