- Timestamp:
- Jan 26, 2010, 5:10:34 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/psphot.stack.20100120/src/psphotReplaceUnfit.c
r26681 r26688 53 53 // find the currently selected readout 54 54 pmFPAfile *file = pmFPAfileSelectSingle(config->files, filename, index); // File of interest 55 psAssert ( readout, "missing file?");55 psAssert (file, "missing file?"); 56 56 57 57 pmReadout *readout = pmFPAviewThisReadout(view, file->fpa); 58 58 psAssert (readout, "missing readout?"); 59 59 60 psArray *sources = psMetadataLookupPtr (&status, readout->analysis, "PSPHOT.SOURCES"); 60 pmDetections *detections = psMetadataLookupPtr (&status, readout->analysis, "PSPHOT.DETECTIONS"); 61 psAssert (detections, "missing detections?"); 62 63 psArray *sources = detections->allSources; 61 64 psAssert (sources, "missing sources?"); 62 65 … … 99 102 return true; 100 103 } 101 102 # if (0)103 // add source, if the source has been subtracted; do not modify state104 bool psphotAddWithTest (pmSource *source, bool useState, psImageMaskType maskVal) {105 106 // what is current state? (true : add; false : sub)107 bool state = !(source->tmpFlags & PM_SOURCE_TMPF_SUBTRACTED);108 if (state && useState) return true;109 110 pmSourceAdd (source, PM_MODEL_OP_FULL, maskVal);111 return true;112 }113 114 // sub source, if the source has been added; do not modify state115 bool psphotSubWithTest (pmSource *source, bool useState, psImageMaskType maskVal) {116 117 // what is current state? (true : sub; false : add)118 bool state = (source->tmpFlags & PM_SOURCE_TMPF_SUBTRACTED);119 if (state && useState) return true;120 121 pmSourceSub (source, PM_MODEL_OP_FULL, maskVal);122 return true;123 }124 125 // add or sub source to match recorded state: supply current state as true (add) or false (sub)126 bool psphotSetState (pmSource *source, bool curState, psImageMaskType maskVal) {127 128 // what is desired state? (true : add; false : sub)129 bool newState = !(source->tmpFlags & PM_SOURCE_TMPF_SUBTRACTED);130 if (curState == newState) return true;131 132 if (curState && !newState) {133 pmSourceSub (source, PM_MODEL_OP_FULL, maskVal);134 }135 if (newState && !curState) {136 pmSourceAdd (source, PM_MODEL_OP_FULL, maskVal);137 }138 return true;139 }140 # endif
Note:
See TracChangeset
for help on using the changeset viewer.
