Changeset 26691
- Timestamp:
- Jan 27, 2010, 9:17:17 AM (16 years ago)
- Location:
- branches/eam_branches/psphot.stack.20100120/src
- Files:
-
- 27 edited
-
Makefile.am (modified) (4 diffs)
-
psphot.h (modified) (8 diffs)
-
psphotAddNoise.c (modified) (1 diff)
-
psphotApResid.c (modified) (3 diffs)
-
psphotBasicDeblend.c (modified) (3 diffs)
-
psphotBlendFit.c (modified) (1 diff)
-
psphotChoosePSF.c (modified) (4 diffs)
-
psphotDeblendSatstars.c (modified) (4 diffs)
-
psphotEfficiency.c (modified) (5 diffs)
-
psphotExtendedSourceAnalysis.c (modified) (2 diffs)
-
psphotExtendedSourceFits.c (modified) (2 diffs)
-
psphotFindDetections.c (modified) (2 diffs)
-
psphotFitSourcesLinear.c (modified) (2 diffs)
-
psphotGuessModels.c (modified) (2 diffs)
-
psphotImageQuality.c (modified) (2 diffs)
-
psphotLoadPSF.c (modified) (3 diffs)
-
psphotMagnitudes.c (modified) (2 diffs)
-
psphotMaskReadout.c (modified) (1 diff)
-
psphotMergeSources.c (modified) (4 diffs)
-
psphotReadout.c (modified) (2 diffs)
-
psphotReadoutCleanup.c (modified) (3 diffs)
-
psphotReplaceUnfit.c (modified) (1 diff)
-
psphotRoughClass.c (modified) (1 diff)
-
psphotSkyReplace.c (modified) (2 diffs)
-
psphotSourceFreePixels.c (modified) (2 diffs)
-
psphotSourceSize.c (modified) (4 diffs)
-
psphotSourceStats.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/psphot.stack.20100120/src/Makefile.am
r26688 r26691 25 25 libpsphot_la_LDFLAGS = $(PSPHOT_LIBS) $(PSMODULE_LIBS) $(PSLIB_LIBS) 26 26 27 bin_PROGRAMS = psphot psphotForced psphotMakePSF psphotTest psphotMomentsStudy 28 # bin_PROGRAMS = psphotPetrosianStudy 29 # bin_PROGRAMS = psphot 27 bin_PROGRAMS = psphot 28 # bin_PROGRAMS = psphotPetrosianStudy psphotForced psphotMakePSF psphotTest psphotMomentsStudy 30 29 31 30 psphot_CFLAGS = $(PSPHOT_CFLAGS) $(PSMODULE_CFLAGS) $(PSLIB_CFLAGS) … … 113 112 psphotDefineFiles.c \ 114 113 psphotReadout.c \ 115 psphotReadoutFindPSF.c \116 psphotReadoutKnownSources.c \117 psphotReadoutMinimal.c \118 114 psphotModelBackground.c \ 119 115 psphotSubtractBackground.c \ … … 146 142 psphotKernelFromPSF.c \ 147 143 psphotPSFConvModel.c \ 148 psphotModelTest.c \149 144 psphotFitSet.c \ 150 145 psphotSourceFreePixels.c \ … … 175 170 psphotEfficiency.c 176 171 172 # XXX need to fix these for the new apis 173 # psphotReadoutFindPSF.c 174 # psphotReadoutKnownSources.c 175 # psphotReadoutMinimal.c 176 # psphotModelTest.c 177 177 178 # re-instate these 178 179 # psphotIsophotal.c \ -
branches/eam_branches/psphot.stack.20100120/src/psphot.h
r26688 r26691 37 37 bool psphotReadoutMinimal(pmConfig *config, const pmFPAview *view); 38 38 39 bool psphotReadoutCleanup (pmConfig *config, pmReadout *readout, psMetadata *recipe, pmDetections *detections, pmPSF *psf, psArray *sources); 39 bool psphotReadoutCleanup (pmConfig *config, const pmFPAview *view); 40 bool psphotReadoutCleanupReadout (pmConfig *config, const pmFPAview *view, const char *filename, int index, psMetadata *recipe); 41 40 42 bool psphotDefineFiles (pmConfig *config, pmFPAfile *input); 41 43 void psphotFilesActivate(pmConfig *config, bool state); … … 52 54 bool psphotAddPhotcodeReadout (pmConfig *config, const pmFPAview *view, const char *filerule, int index); 53 55 54 bool psphotSetMaskAndVariance (pmConfig *config, const pmFPAview *view , psMetadata *recipe);56 bool psphotSetMaskAndVariance (pmConfig *config, const pmFPAview *view); 55 57 bool psphotSetMaskAndVarianceReadout (pmConfig *config, const pmFPAview *view, const char *filename, int index, psMetadata *recipe); 56 58 … … 71 73 72 74 bool psphotBasicDeblend (pmConfig *config, const pmFPAview *view); 73 bool psphotBasicDeblend (pmConfig *config, const pmFPAview *view, const char *filename, int index);75 bool psphotBasicDeblendReadout (pmConfig *config, const pmFPAview *view, const char *filename, int index); 74 76 75 77 bool psphotRoughClass (pmConfig *config, const pmFPAview *view); … … 90 92 91 93 bool psphotFitSourcesLinear (pmConfig *config, const pmFPAview *view, bool final); 92 bool psphotFitSourcesLinearReadout (pmConfig *config, const pmFPAview *view, const char *filename, int index );94 bool psphotFitSourcesLinearReadout (pmConfig *config, const pmFPAview *view, const char *filename, int index, bool final); 93 95 94 96 bool psphotSourceSize (pmConfig *config, const pmFPAview *view, bool getPSFsize); … … 114 116 115 117 bool psphotApResid (pmConfig *config, const pmFPAview *view); 116 bool psphotApResid (pmConfig *config, const pmFPAview *view, const char *filename, int index, psMetadata *recipe);118 bool psphotApResidReadout (pmConfig *config, const pmFPAview *view, const char *filename, int index, psMetadata *recipe); 117 119 118 120 bool psphotMagnitudes (pmConfig *config, const pmFPAview *view); … … 162 164 bool psphotRemoveAllSources (const psArray *sources, const psMetadata *recipe); 163 165 bool psphotReplaceUnfitSources (psArray *sources, psImageMaskType maskVal); 164 bool psphotReplaceUnfitSources (psArray *sources, psImageMaskType maskVal);165 166 bool psphotReplaceAllSources (psArray *sources, psMetadata *recipe);167 bool psphotRemoveAllSources (const psArray *sources, const psMetadata *recipe);168 166 169 167 // thread-related: … … 186 184 void psphotModelClassInit (void); 187 185 bool psphotGrowthCurve (pmReadout *readout, pmPSF *psf, bool ignore, psImageMaskType maskVal); 188 void psphotSourceFreePixels (psArray *sources);189 186 190 187 // functions to set the correct source pixels … … 226 223 bool psphotFitSummary (void); 227 224 228 pmPSF *psphotLoadPSF (pmConfig *config, const pmFPAview *view, psMetadata *recipe); 225 bool psphotLoadPSF (pmConfig *config, const pmFPAview *view); 226 bool psphotLoadPSFReadout (pmConfig *config, const pmFPAview *view, const char *filename, int index, psMetadata *recipe); 227 229 228 bool psphotSetHeaderNstars (psMetadata *recipe, psArray *sources); 230 bool psphotAddNoise (pmReadout *readout, const psArray *sources, const psMetadata *recipe);231 bool psphotSubNoise (pmReadout *readout, const psArray *sources, const psMetadata *recipe);232 bool psphotAddOrSubNoise (pmReadout *readout, const psArray *sources, const psMetadata *recipe, bool add);233 229 bool psphotRadialPlot (int *kapa, const char *filename, pmSource *source); 234 230 bool psphotSourcePlots (pmReadout *readout, psArray *sources, psMetadata *recipe); -
branches/eam_branches/psphot.stack.20100120/src/psphotAddNoise.c
r26688 r26691 18 18 psAssert (recipe, "missing recipe?"); 19 19 20 int num = psMetadata AddS32 (&status, config->arguments, "PSPHOT.INPUT.NUM");20 int num = psMetadataLookupS32 (&status, config->arguments, "PSPHOT.INPUT.NUM"); 21 21 psAssert (status, "programming error: must define PSPHOT.INPUT.NUM"); 22 22 -
branches/eam_branches/psphot.stack.20100120/src/psphotApResid.c
r26688 r26691 13 13 psAssert (recipe, "missing recipe?"); 14 14 15 int num = psMetadata AddS32 (&status, config->arguments, "PSPHOT.INPUT.NUM");15 int num = psMetadataLookupS32 (&status, config->arguments, "PSPHOT.INPUT.NUM"); 16 16 psAssert (status, "programming error: must define PSPHOT.INPUT.NUM"); 17 17 18 18 // loop over the available readouts 19 19 for (int i = 0; i < num; i++) { 20 if (!psphot tApResidReadout (config, view, "PSPHOT.INPUT", i, recipe)) {20 if (!psphotApResidReadout (config, view, "PSPHOT.INPUT", i, recipe)) { 21 21 psError (PSPHOT_ERR_CONFIG, false, "failed on saturated star deblend analysis for PSPHOT.INPUT entry %d", i); 22 22 return false; … … 26 26 } 27 27 28 bool psphotApResid (pmConfig *config, const pmFPAview *view, const char *filename, int index, psMetadata *recipe)28 bool psphotApResidReadout (pmConfig *config, const pmFPAview *view, const char *filename, int index, psMetadata *recipe) 29 29 { 30 30 int Nfail = 0; … … 39 39 // find the currently selected readout 40 40 pmFPAfile *file = pmFPAfileSelectSingle(config->files, filename, index); // File of interest 41 psAssert ( readout, "missing file?");41 psAssert (file, "missing file?"); 42 42 43 43 pmReadout *readout = pmFPAviewThisReadout(view, file->fpa); -
branches/eam_branches/psphot.stack.20100120/src/psphotBasicDeblend.c
r26688 r26691 6 6 bool status = true; 7 7 8 int num = psMetadata AddS32 (&status, config->arguments, "PSPHOT.INPUT.NUM");8 int num = psMetadataLookupS32 (&status, config->arguments, "PSPHOT.INPUT.NUM"); 9 9 psAssert (status, "programming error: must define PSPHOT.INPUT.NUM"); 10 10 … … 19 19 } 20 20 21 bool psphotBasicDeblend (pmConfig *config, const pmFPAview *view, const char *filename, int index) {21 bool psphotBasicDeblendReadout (pmConfig *config, const pmFPAview *view, const char *filename, int fileIndex) { 22 22 23 23 int N; … … 31 31 32 32 // find the currently selected readout 33 pmFPAfile *file = pmFPAfileSelectSingle(config->files, filename, index); // File of interest33 pmFPAfile *file = pmFPAfileSelectSingle(config->files, filename, fileIndex); // File of interest 34 34 psAssert (file, "missing file?"); 35 35 -
branches/eam_branches/psphot.stack.20100120/src/psphotBlendFit.c
r26688 r26691 10 10 psAssert (recipe, "missing recipe?"); 11 11 12 int num = psMetadata AddS32 (&status, config->arguments, "PSPHOT.INPUT.NUM");12 int num = psMetadataLookupS32 (&status, config->arguments, "PSPHOT.INPUT.NUM"); 13 13 psAssert (status, "programming error: must define PSPHOT.INPUT.NUM"); 14 14 -
branches/eam_branches/psphot.stack.20100120/src/psphotChoosePSF.c
r26688 r26691 10 10 psAssert (recipe, "missing recipe?"); 11 11 12 int num = psMetadata AddS32 (&status, config->arguments, "PSPHOT.INPUT.NUM");12 int num = psMetadataLookupS32 (&status, config->arguments, "PSPHOT.INPUT.NUM"); 13 13 psAssert (status, "programming error: must define PSPHOT.INPUT.NUM"); 14 14 … … 28 28 bool status; 29 29 30 // do not generate a PSF if we already were supplied one31 if (psMetadataLookupPtr (&status, readout->analysis, "PSPHOT.PSF")) {32 psLogMsg ("psphot", PS_LOG_DETAIL, "psf model supplied for input file %d", i);33 return true;34 }35 36 30 psTimerStart ("psphot.choose.psf"); 37 31 … … 42 36 pmReadout *readout = pmFPAviewThisReadout(view, file->fpa); 43 37 psAssert (readout, "missing readout?"); 38 39 // do not generate a PSF if we already were supplied one 40 if (psMetadataLookupPtr (&status, readout->analysis, "PSPHOT.PSF")) { 41 psLogMsg ("psphot", PS_LOG_DETAIL, "psf model supplied for input file %d", index); 42 return true; 43 } 44 44 45 45 pmDetections *detections = psMetadataLookupPtr (&status, readout->analysis, "PSPHOT.DETECTIONS"); … … 350 350 351 351 // save PSF on readout->analysis 352 if (!psMetadataAdd (readout->analysis, PS_LIST_TAIL, "PSPHOT.PSF", PS_DATA_PTR, "psphot psf model", psf)) {352 if (!psMetadataAddPtr (readout->analysis, PS_LIST_TAIL, "PSPHOT.PSF", PS_META_REPLACE | PS_DATA_UNKNOWN, "psphot psf model", psf)) { 353 353 psError (PSPHOT_ERR_UNKNOWN, false, "problem saving sources on readout"); 354 354 return false; -
branches/eam_branches/psphot.stack.20100120/src/psphotDeblendSatstars.c
r26688 r26691 6 6 bool status = true; 7 7 8 int num = psMetadata AddS32 (&status, config->arguments, "PSPHOT.INPUT.NUM");8 int num = psMetadataLookupS32 (&status, config->arguments, "PSPHOT.INPUT.NUM"); 9 9 psAssert (status, "programming error: must define PSPHOT.INPUT.NUM"); 10 10 … … 19 19 } 20 20 21 bool psphotDeblendSatstarsReadout (pmConfig *config, const pmFPAview *view, const char *filename, int index) {21 bool psphotDeblendSatstarsReadout (pmConfig *config, const pmFPAview *view, const char *filename, int fileIndex) { 22 22 23 23 int N; 24 24 pmSource *source; 25 bool status; 25 26 26 27 psTimerStart ("psphot.deblend.sat"); … … 30 31 31 32 // find the currently selected readout 32 pmFPAfile *file = pmFPAfileSelectSingle(config->files, filename, index); // File of interest33 pmFPAfile *file = pmFPAfileSelectSingle(config->files, filename, fileIndex); // File of interest 33 34 psAssert (file, "missing file?"); 34 35 … … 51 52 psAssert (recipe, "missing recipe?"); 52 53 53 bool status;54 54 pmCell *cell = readout->parent; 55 55 float SATURATION = 0.75*psMetadataLookupF32 (&status, cell->concepts, "CELL.SATURATION"); -
branches/eam_branches/psphot.stack.20100120/src/psphotEfficiency.c
r26688 r26691 6 6 //#define TESTING 7 7 8 9 # if 0 8 10 9 11 // Calculate the limiting magnitude for an image … … 148 150 } 149 151 152 # endif 150 153 151 154 bool psphotEfficiency (pmConfig *config, const pmFPAview *view) … … 157 160 psAssert (recipe, "missing recipe?"); 158 161 159 int num = psMetadata AddS32 (&status, config->arguments, "PSPHOT.INPUT.NUM");162 int num = psMetadataLookupS32 (&status, config->arguments, "PSPHOT.INPUT.NUM"); 160 163 psAssert (status, "programming error: must define PSPHOT.INPUT.NUM"); 161 164 162 165 // loop over the available readouts 163 166 for (int i = 0; i < num; i++) { 164 if (!psphot Readout (config, view, "PSPHOT.INPUT", i, recipe)) {167 if (!psphotEfficiencyReadout (config, view, "PSPHOT.INPUT", i, recipe)) { 165 168 psError (PSPHOT_ERR_CONFIG, false, "failed on saturated star deblend analysis for PSPHOT.INPUT entry %d", i); 166 169 return false; … … 173 176 bool psphotEfficiencyReadout(pmConfig *config, const pmFPAview *view, const char *filename, int index, psMetadata *recipe) 174 177 { 178 # if 0 179 bool status = true; 180 175 181 psTimerStart("psphot.fake"); 176 182 177 183 // find the currently selected readout 178 184 pmFPAfile *file = pmFPAfileSelectSingle(config->files, filename, index); // File of interest 179 psAssert ( readout, "missing file?");185 psAssert (file, "missing file?"); 180 186 181 187 pmReadout *readout = pmFPAviewThisReadout(view, file->fpa); … … 512 518 psLogMsg("psphot", PS_LOG_INFO, "Detection efficiency: %lf sec\n", psTimerClear("psphot.fake")); 513 519 520 # endif 514 521 515 522 return true; -
branches/eam_branches/psphot.stack.20100120/src/psphotExtendedSourceAnalysis.c
r26688 r26691 16 16 } 17 17 18 int num = psMetadata AddS32 (&status, config->arguments, "PSPHOT.INPUT.NUM");18 int num = psMetadataLookupS32 (&status, config->arguments, "PSPHOT.INPUT.NUM"); 19 19 psAssert (status, "programming error: must define PSPHOT.INPUT.NUM"); 20 20 … … 41 41 // find the currently selected readout 42 42 pmFPAfile *file = pmFPAfileSelectSingle(config->files, filename, index); // File of interest 43 psAssert ( readout, "missing file?");43 psAssert (file, "missing file?"); 44 44 45 45 pmReadout *readout = pmFPAviewThisReadout(view, file->fpa); -
branches/eam_branches/psphot.stack.20100120/src/psphotExtendedSourceFits.c
r26688 r26691 16 16 } 17 17 18 int num = psMetadata AddS32 (&status, config->arguments, "PSPHOT.INPUT.NUM");18 int num = psMetadataLookupS32 (&status, config->arguments, "PSPHOT.INPUT.NUM"); 19 19 psAssert (status, "programming error: must define PSPHOT.INPUT.NUM"); 20 20 … … 42 42 // find the currently selected readout 43 43 pmFPAfile *file = pmFPAfileSelectSingle(config->files, filename, index); // File of interest 44 psAssert ( readout, "missing file?");44 psAssert (file, "missing file?"); 45 45 46 46 pmReadout *readout = pmFPAviewThisReadout(view, file->fpa); -
branches/eam_branches/psphot.stack.20100120/src/psphotFindDetections.c
r26688 r26691 12 12 psAssert (recipe, "missing recipe?"); 13 13 14 int num = psMetadata AddS32 (&status, config->arguments, "PSPHOT.INPUT.NUM");14 int num = psMetadataLookupS32 (&status, config->arguments, "PSPHOT.INPUT.NUM"); 15 15 psAssert (status, "programming error: must define PSPHOT.INPUT.NUM"); 16 16 … … 54 54 55 55 // save detections on the readout->analysis 56 if (!psMetadataAdd (readout->analysis, PS_LIST_TAIL, "PSPHOT.DETECTIONS", PS_DATA_PTR, "psphot detectinos", detections)) {56 if (!psMetadataAddPtr (readout->analysis, PS_LIST_TAIL, "PSPHOT.DETECTIONS", PS_META_REPLACE | PS_DATA_UNKNOWN, "psphot detectinos", detections)) { 57 57 psError (PSPHOT_ERR_CONFIG, false, "problem saving detections on readout"); 58 58 return false; -
branches/eam_branches/psphot.stack.20100120/src/psphotFitSourcesLinear.c
r26688 r26691 17 17 bool status = true; 18 18 19 int num = psMetadata AddS32 (&status, config->arguments, "PSPHOT.INPUT.NUM");19 int num = psMetadataLookupS32 (&status, config->arguments, "PSPHOT.INPUT.NUM"); 20 20 psAssert (status, "programming error: must define PSPHOT.INPUT.NUM"); 21 21 … … 30 30 } 31 31 32 bool psphotFitSourcesLinearReadout (pmConfig *config, const pmFPAview *view, const char *filename, int index ) {32 bool psphotFitSourcesLinearReadout (pmConfig *config, const pmFPAview *view, const char *filename, int index, bool final) { 33 33 34 34 bool status; -
branches/eam_branches/psphot.stack.20100120/src/psphotGuessModels.c
r26688 r26691 12 12 bool status = true; 13 13 14 int num = psMetadata AddS32 (&status, config->arguments, "PSPHOT.INPUT.NUM");14 int num = psMetadataLookupS32 (&status, config->arguments, "PSPHOT.INPUT.NUM"); 15 15 psAssert (status, "programming error: must define PSPHOT.INPUT.NUM"); 16 16 … … 34 34 // find the currently selected readout 35 35 pmFPAfile *file = pmFPAfileSelectSingle(config->files, filename, index); // File of interest 36 psAssert ( readout, "missing file?");36 psAssert (file, "missing file?"); 37 37 38 38 pmReadout *readout = pmFPAviewThisReadout(view, file->fpa); -
branches/eam_branches/psphot.stack.20100120/src/psphotImageQuality.c
r26688 r26691 13 13 psAssert (recipe, "missing recipe?"); 14 14 15 int num = psMetadata AddS32 (&status, config->arguments, "PSPHOT.INPUT.NUM");15 int num = psMetadataLookupS32 (&status, config->arguments, "PSPHOT.INPUT.NUM"); 16 16 psAssert (status, "programming error: must define PSPHOT.INPUT.NUM"); 17 17 … … 29 29 bool psphotImageQualityReadout(pmConfig *config, const pmFPAview *view, const char *filename, int index, psMetadata *recipe) 30 30 { 31 bool status = true; 32 31 33 // find the currently selected readout 32 34 pmFPAfile *file = pmFPAfileSelectSingle(config->files, filename, index); // File of interest -
branches/eam_branches/psphot.stack.20100120/src/psphotLoadPSF.c
r26681 r26691 2 2 3 3 // load an externally supplied psf model 4 pmPSF *psphotLoadPSFReadout (pmConfig *config, const pmFPAview *view, const char *filename, int index, psMetadata *recipe) { 4 bool psphotLoadPSFReadout (pmConfig *config, const pmFPAview *view, const char *filename, int index, psMetadata *recipe) { 5 6 bool status; 5 7 6 8 // find the currently selected readout 7 9 pmFPAfile *file = pmFPAfileSelectSingle(config->files, filename, index); // File of interest 8 psAssert ( readout, "missing file?");10 psAssert (file, "missing file?"); 9 11 10 12 // find the currently selected chip … … 13 15 14 16 // find the currently selected readout 15 pmReadout *readout = pmFPA fileThisReadout (view, file->fpa);17 pmReadout *readout = pmFPAviewThisReadout (view, file->fpa); 16 18 if (!readout) return false; 17 19 18 20 // check if a PSF model is supplied by the user 19 pmPSF *psf = psMetadataLookupPtr ( NULL, chip->analysis, "PSPHOT.PSF");21 pmPSF *psf = psMetadataLookupPtr (&status, chip->analysis, "PSPHOT.PSF"); 20 22 if (psf == NULL) { 21 23 psLogMsg ("psphot", 3, "no psf supplied for this chip"); … … 30 32 31 33 // save PSF on readout->analysis 32 if (!psMetadataAdd (readout->analysis, PS_LIST_TAIL, "PSPHOT.PSF", PS_DATA_PTR, "psphot psf model", psf)) {34 if (!psMetadataAddPtr (readout->analysis, PS_LIST_TAIL, "PSPHOT.PSF", PS_META_REPLACE | PS_DATA_UNKNOWN, "psphot psf model", psf)) { 33 35 psError (PSPHOT_ERR_UNKNOWN, false, "problem saving sources on readout"); 34 36 return false; -
branches/eam_branches/psphot.stack.20100120/src/psphotMagnitudes.c
r26688 r26691 9 9 psAssert (recipe, "missing recipe?"); 10 10 11 int num = psMetadata AddS32 (&status, config->arguments, "PSPHOT.INPUT.NUM");11 int num = psMetadataLookupS32 (&status, config->arguments, "PSPHOT.INPUT.NUM"); 12 12 psAssert (status, "programming error: must define PSPHOT.INPUT.NUM"); 13 13 … … 31 31 // find the currently selected readout 32 32 pmFPAfile *file = pmFPAfileSelectSingle(config->files, filename, index); // File of interest 33 psAssert ( readout, "missing file?");33 psAssert (file, "missing file?"); 34 34 35 35 pmReadout *readout = pmFPAviewThisReadout(view, file->fpa); -
branches/eam_branches/psphot.stack.20100120/src/psphotMaskReadout.c
r26681 r26691 16 16 17 17 // Generate the mask and weight images, including the user-defined analysis region of interest 18 if (!psphotSetMaskAndVarianceReadout (config, readout, recipe)) {18 if (!psphotSetMaskAndVarianceReadout (config, view, "PSPHOT.INPUT", i, recipe)) { 19 19 psError (PSPHOT_ERR_CONFIG, false, "failed to generate mask for PSPHOT.INPUT entry %d", i); 20 20 return false; 21 21 } 22 23 // display the image, weight, mask (ch 1,2,3)24 psphotVisualShowImage (readout);25 22 } 26 23 return true; -
branches/eam_branches/psphot.stack.20100120/src/psphotMergeSources.c
r26688 r26691 10 10 bool status = true; 11 11 12 int num = psMetadata AddS32 (&status, config->arguments, "PSPHOT.INPUT.NUM");12 int num = psMetadataLookupS32 (&status, config->arguments, "PSPHOT.INPUT.NUM"); 13 13 psAssert (status, "programming error: must define PSPHOT.INPUT.NUM"); 14 14 … … 26 26 bool psphotMergeSourcesReadout (pmConfig *config, const pmFPAview *view, const char *filename, int index) { 27 27 28 bool status; 29 28 30 // find the currently selected readout 29 31 pmFPAfile *file = pmFPAfileSelectSingle(config->files, filename, index); // File of interest … … 80 82 source->modelPSF = NULL; 81 83 } 82 psphotMergeSources (sources, extSourcesCMF);84 // XXX psphotMergeSources (sources, extSourcesCMF); 83 85 } 84 86 } … … 101 103 source->modelPSF = NULL; 102 104 } 103 psphotMergeSources (sources, extSourcesTXT);105 // XXX psphotMergeSources (sources, extSourcesTXT); 104 106 } 105 107 } -
branches/eam_branches/psphot.stack.20100120/src/psphotReadout.c
r26688 r26691 127 127 // merge the newly selected sources into the existing list 128 128 // NOTE: merge OLD and NEW 129 psphotMergeSources (config, view); FIX:129 psphotMergeSources (config, view); 130 130 131 131 // linear PSF fit to source peaks, subtract the models from the image (in PSF mask) … … 186 186 // merge the newly selected sources into the existing list 187 187 // NOTE: merge OLD and NEW 188 psphotMergeSources (config, view); FIX: // (detections->newSources + detections->allSources -> detections->allSources) 188 // XXX check on free of sources... 189 psphotMergeSources (config, view); // (detections->newSources + detections->allSources -> detections->allSources) 189 190 190 191 // NOTE: apply to ALL sources -
branches/eam_branches/psphot.stack.20100120/src/psphotReadoutCleanup.c
r26688 r26691 15 15 } 16 16 17 int num = psMetadataAddS32 (&status, config->arguments, "PSPHOT.INPUT.NUM"); 17 // select the appropriate recipe information 18 psMetadata *recipe = psMetadataLookupPtr (&status, config->recipes, PSPHOT_RECIPE); 19 psAssert (recipe, "missing recipe?"); 20 21 int num = psMetadataLookupS32 (&status, config->arguments, "PSPHOT.INPUT.NUM"); 18 22 psAssert (status, "programming error: must define PSPHOT.INPUT.NUM"); 19 23 20 24 // loop over the available readouts 21 25 for (int i = 0; i < num; i++) { 22 if (!psphotReadoutCleanupReadout (config, view, "PSPHOT.INPUT", i )) {26 if (!psphotReadoutCleanupReadout (config, view, "PSPHOT.INPUT", i, recipe)) { 23 27 psError (PSPHOT_ERR_CONFIG, false, "failed on psphotReadoutCleanup for PSPHOT.INPUT entry %d", i); 24 28 return false; … … 35 39 // not a DATA error, then there was a serious problem. Only in this case, or if the fail 36 40 // on the stats measurement, do we return false 37 bool psphotReadoutCleanupReadout (pmConfig *config, const pmFPAview *view, const char *filename, int index ) {41 bool psphotReadoutCleanupReadout (pmConfig *config, const pmFPAview *view, const char *filename, int index, psMetadata *recipe) { 38 42 39 pmReadout *readout, psMetadata *recipe, pmDetections *detections, pmPSF *psf, psArray *sources; 40 41 // select the appropriate recipe information 42 psMetadata *recipe = psMetadataLookupPtr (&status, config->recipes, PSPHOT_RECIPE); 43 psAssert (recipe, "missing recipe?"); 43 bool status = true; 44 44 45 45 // find the currently selected readout 46 46 pmFPAfile *file = pmFPAfileSelectSingle(config->files, filename, index); // File of interest 47 psAssert ( readout, "missing file?");47 psAssert (file, "missing file?"); 48 48 49 49 pmReadout *readout = pmFPAviewThisReadout(view, file->fpa); … … 51 51 52 52 // when psphotReadoutCleanup is called, these are not necessarily defined 53 pmPSF *psf= psMetadataLookupPtr (&status, readout->analysis, "PSPHOT.PSF");53 pmPSF *psf = psMetadataLookupPtr (&status, readout->analysis, "PSPHOT.PSF"); 54 54 pmDetections *detections = psMetadataLookupPtr (&status, readout->analysis, "PSPHOT.DETECTIONS"); 55 psArray *sources= detections->allSources;55 psArray *sources = detections->allSources; 56 56 // XXX where do we free these, in here (psMetadataRemove?) 57 57 -
branches/eam_branches/psphot.stack.20100120/src/psphotReplaceUnfit.c
r26688 r26691 31 31 psAssert (recipe, "missing recipe?"); 32 32 33 int num = psMetadata AddS32 (&status, config->arguments, "PSPHOT.INPUT.NUM");33 int num = psMetadataLookupS32 (&status, config->arguments, "PSPHOT.INPUT.NUM"); 34 34 psAssert (status, "programming error: must define PSPHOT.INPUT.NUM"); 35 35 -
branches/eam_branches/psphot.stack.20100120/src/psphotRoughClass.c
r26688 r26691 16 16 psAssert (recipe, "missing recipe?"); 17 17 18 int num = psMetadata AddS32 (&status, config->arguments, "PSPHOT.INPUT.NUM");18 int num = psMetadataLookupS32 (&status, config->arguments, "PSPHOT.INPUT.NUM"); 19 19 psAssert (status, "programming error: must define PSPHOT.INPUT.NUM"); 20 20 -
branches/eam_branches/psphot.stack.20100120/src/psphotSkyReplace.c
r26688 r26691 5 5 bool status = true; 6 6 7 int num = psMetadata AddS32 (&status, config->arguments, "PSPHOT.INPUT.NUM");7 int num = psMetadataLookupS32 (&status, config->arguments, "PSPHOT.INPUT.NUM"); 8 8 psAssert (status, "programming error: must define PSPHOT.INPUT.NUM"); 9 9 10 10 // loop over the available readouts 11 11 for (int i = 0; i < num; i++) { 12 if (!psphot Readout (config, view, "PSPHOT.INPUT", i)) {12 if (!psphotSkyReplaceReadout (config, view, "PSPHOT.INPUT", i)) { 13 13 psError (PSPHOT_ERR_CONFIG, false, "failed on saturated star deblend analysis for PSPHOT.INPUT entry %d", i); 14 14 return false; … … 26 26 // find the currently selected readout 27 27 pmFPAfile *file = pmFPAfileSelectSingle(config->files, filename, index); // File of interest 28 psAssert ( readout, "missing file?");28 psAssert (file, "missing file?"); 29 29 30 30 pmReadout *readout = pmFPAviewThisReadout(view, file->fpa); -
branches/eam_branches/psphot.stack.20100120/src/psphotSourceFreePixels.c
r26688 r26691 5 5 bool status = true; 6 6 7 int num = psMetadata AddS32 (&status, config->arguments, "PSPHOT.INPUT.NUM");7 int num = psMetadataLookupS32 (&status, config->arguments, "PSPHOT.INPUT.NUM"); 8 8 psAssert (status, "programming error: must define PSPHOT.INPUT.NUM"); 9 9 … … 20 20 bool psphotSourceFreePixelsReadout(pmConfig *config, const pmFPAview *view, const char *filename, int index) { 21 21 22 bool status; 23 22 24 // find the currently selected readout 23 25 pmFPAfile *file = pmFPAfileSelectSingle(config->files, filename, index); // File of interest 24 psAssert ( readout, "missing file?");26 psAssert (file, "missing file?"); 25 27 26 28 pmReadout *readout = pmFPAviewThisReadout(view, file->fpa); -
branches/eam_branches/psphot.stack.20100120/src/psphotSourceSize.c
r26688 r26691 38 38 psAssert (recipe, "missing recipe?"); 39 39 40 int num = psMetadata AddS32 (&status, config->arguments, "PSPHOT.INPUT.NUM");40 int num = psMetadataLookupS32 (&status, config->arguments, "PSPHOT.INPUT.NUM"); 41 41 psAssert (status, "programming error: must define PSPHOT.INPUT.NUM"); 42 42 … … 61 61 // find the currently selected readout 62 62 pmFPAfile *file = pmFPAfileSelectSingle(config->files, filename, index); // File of interest 63 psAssert ( readout, "missing file?");63 psAssert (file, "missing file?"); 64 64 65 65 pmReadout *readout = pmFPAviewThisReadout(view, file->fpa); … … 131 131 psphotSourceSizeCR (readout, sources, &options); 132 132 133 psLogMsg ("psphot.size", PS_LOG_INFO, "measure source sizes for %ld sources: %f sec\n", sources->n - first, psTimerMark ("psphot.size")); 133 // XXX fix this (was source->n - first) 134 psLogMsg ("psphot.size", PS_LOG_INFO, "measure source sizes for %ld sources: %f sec\n", sources->n, psTimerMark ("psphot.size")); 134 135 135 136 psphotVisualPlotSourceSize (recipe, readout->analysis, sources); … … 633 634 /**** ------ old versions of cosmic ray masking ----- ****/ 634 635 636 bool psphotMaskCosmicRayIsophot (pmSource *source, psImageMaskType maskVal, psImageMaskType crMask); 637 635 638 // This attempt to mask the cosmic rays used the isophotal boundary 636 639 bool psphotMaskCosmicRay_V1 (psImage *mask, pmSource *source, psImageMaskType maskVal, psImageMaskType crMask) { -
branches/eam_branches/psphot.stack.20100120/src/psphotSourceStats.c
r26688 r26691 11 11 psAssert (recipe, "missing recipe?"); 12 12 13 int num = psMetadata AddS32 (&status, config->arguments, "PSPHOT.INPUT.NUM");13 int num = psMetadataLookupS32 (&status, config->arguments, "PSPHOT.INPUT.NUM"); 14 14 psAssert (status, "programming error: must define PSPHOT.INPUT.NUM"); 15 15
Note:
See TracChangeset
for help on using the changeset viewer.
