Changeset 34492
- Timestamp:
- Oct 2, 2012, 11:18:35 AM (14 years ago)
- Location:
- trunk/psphot/src
- Files:
-
- 4 edited
-
psphotAddNoise.c (modified) (3 diffs)
-
psphotDeblendSatstars.c (modified) (3 diffs)
-
psphotFindDetections.c (modified) (2 diffs)
-
psphotReplaceUnfit.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psphot/src/psphotAddNoise.c
r34418 r34492 34 34 static int Nmasked = 0; 35 35 36 // the return state indicates if any sources were actually replaced 36 37 bool psphotAddOrSubNoiseReadout (pmConfig *config, const pmFPAview *view, const char *filerule, int index, psMetadata *recipe, bool add) { 37 38 … … 51 52 52 53 psArray *sources = detections->allSources; 53 //psAssert (sources, "missing sources?"); 54 // if no work, should just return true 55 if (!sources) return true; 54 // if no work to do, should just return true 55 if (!sources) return false; 56 56 57 57 psTimerStart ("psphot.noise"); … … 74 74 75 75 if (SIZE <= 0) { 76 return true;76 return false; 77 77 } 78 78 -
trunk/psphot/src/psphotDeblendSatstars.c
r34418 r34492 1048 1048 } 1049 1049 1050 // the return state indicates if any sources were actually subtracted 1050 1051 bool psphotAddOrSubSatstarsReadout (pmConfig *config, const pmFPAview *view, const char *filerule, int fileIndex, psMetadata *recipe, bool add) { 1051 1052 1052 1053 bool status; 1054 bool modified = false; 1053 1055 1054 1056 psTimerStart ("psphot.deblend.sat"); … … 1065 1067 1066 1068 psArray *sources = detections->allSources; 1067 psAssert (sources, "missing sources?"); 1069 // if no work to do, should just return false 1070 if (!sources) return false; 1068 1071 1069 1072 if (!sources->n) { 1070 1073 psLogMsg ("psphot", PS_LOG_INFO, "no sources, skipping satstar blend"); 1071 return true;1074 return false; 1072 1075 } 1073 1076 … … 1082 1085 if (!(source->mode2 & PM_SOURCE_MODE2_SATSTAR_PROFILE)) continue; 1083 1086 1087 // tell the calling function that we modified the image 1088 modified = true; 1089 1084 1090 if (!psphotSatstarProfileOp (source, maskVal, 1.0, 0, add)) continue; 1085 1091 } 1086 1092 1087 1093 psLogMsg ("psphot", PS_LOG_DETAIL, "satstar op: %f sec\n", psTimerMark ("psphot.deblend.sat")); 1088 return true;1094 return modified; 1089 1095 } 1090 1096 -
trunk/psphot/src/psphotFindDetections.c
r34418 r34492 71 71 } 72 72 73 // first pass vs other: if this is the first pass, the code will use PEAKS_NSIGMA_LIMIT and 74 // only attempt to detect PEAKS_NMAX entries. If 'firstPass' is false, the code will 75 // attempt to replace the subtracted sources in order to measure the footprints. After 76 // replacement, it is necessary to regenerate the significance image. If no sources are 77 // available, the code will skip the significance image regeneration step. 78 73 79 bool replaceSourcesForFootprints = false; 74 80 if (firstPass) { … … 126 132 if (useFootprints) { 127 133 if (replaceSourcesForFootprints) { 134 bool modified = false; 128 135 // subtract the noise for all sources including satstars 129 psphotAddOrSubNoiseReadout(config, view, filerule, index, recipe, false);130 psphotReplaceAllSourcesReadout (config, view, filerule, index, recipe, false);136 modified |= psphotAddOrSubNoiseReadout(config, view, filerule, index, recipe, false); 137 modified | psphotReplaceAllSourcesReadout (config, view, filerule, index, recipe, false); 131 138 132 139 // add in the satstars 133 psphotAddOrSubSatstarsReadout (config, view, filerule, index, recipe, true);140 modified |= psphotAddOrSubSatstarsReadout (config, view, filerule, index, recipe, true); 134 141 135 psFree (significance); 136 significance = psphotSignificanceImage (readout, recipe, maskVal); 142 if (modified) { 143 psFree (significance); 144 significance = psphotSignificanceImage (readout, recipe, maskVal); 145 } 137 146 138 147 // display the significance image -
trunk/psphot/src/psphotReplaceUnfit.c
r34136 r34492 43 43 } 44 44 45 // the return state indicates if any sources were actually replaced 45 46 bool psphotReplaceAllSourcesReadout (pmConfig *config, const pmFPAview *view, const char *filename, int index, psMetadata *recipe, bool ignoreState) { 46 47 … … 58 59 if (psMetadataLookupBool (&status, readout->analysis, "PSPHOT.SKIP.INPUT")) { 59 60 psLogMsg ("psphot", PS_LOG_DETAIL, "skipping replace all sources for input file %d", index); 60 return true;61 return false; 61 62 } 62 63 … … 65 66 66 67 psArray *sources = detections->allSources; 67 // psAssert (sources, "missing sources?");68 if (!sources) return true;68 // if no work to do, should just return false 69 if (!sources) return false; 69 70 70 71 // user-defined masks to test for good/bad pixels (build from recipe list if not yet set)
Note:
See TracChangeset
for help on using the changeset viewer.
