Changeset 29904
- Timestamp:
- Dec 3, 2010, 2:28:34 AM (15 years ago)
- Location:
- branches/eam_branches/ipp-20101103/psphot/src
- Files:
-
- 6 deleted
- 46 edited
-
Makefile.am (modified) (1 diff)
-
psphot.h (modified) (3 diffs)
-
psphotAddNoise.c (modified) (1 diff)
-
psphotApResid.c (modified) (4 diffs)
-
psphotBasicDeblend.c (modified) (1 diff)
-
psphotBlendFit.c (modified) (1 diff)
-
psphotChoosePSF.c (modified) (1 diff)
-
psphotDeblendSatstars.c (modified) (1 diff)
-
psphotDetect.c (deleted)
-
psphotDetect.h (deleted)
-
psphotDetectArguments.c (deleted)
-
psphotDetectImageLoop.c (deleted)
-
psphotDetectParseCamera.c (deleted)
-
psphotDetectReadout.c (deleted)
-
psphotEfficiency.c (modified) (1 diff)
-
psphotExtendedSourceAnalysis.c (modified) (1 diff)
-
psphotExtendedSourceAnalysisByObject.c (modified) (1 diff)
-
psphotExtendedSourceFits.c (modified) (1 diff)
-
psphotFindDetections.c (modified) (1 diff)
-
psphotFitSourcesLinear.c (modified) (1 diff)
-
psphotForcedImageLoop.c (modified) (1 diff)
-
psphotForcedReadout.c (modified) (5 diffs)
-
psphotGuessModels.c (modified) (1 diff)
-
psphotImageLoop.c (modified) (1 diff)
-
psphotImageQuality.c (modified) (1 diff)
-
psphotLoadPSF.c (modified) (3 diffs)
-
psphotMagnitudes.c (modified) (1 diff)
-
psphotMakePSFImageLoop.c (modified) (1 diff)
-
psphotMakePSFReadout.c (modified) (4 diffs)
-
psphotMaskReadout.c (modified) (2 diffs)
-
psphotMergeSources.c (modified) (3 diffs)
-
psphotModelBackground.c (modified) (1 diff)
-
psphotOutput.c (modified) (2 diffs)
-
psphotRadialApertures.c (modified) (1 diff)
-
psphotRadialAperturesByObject.c (modified) (1 diff)
-
psphotReadout.c (modified) (8 diffs)
-
psphotReadoutCleanup.c (modified) (1 diff)
-
psphotReadoutFindPSF.c (modified) (5 diffs)
-
psphotReadoutKnownSources.c (modified) (5 diffs)
-
psphotReadoutMinimal.c (modified) (4 diffs)
-
psphotReplaceUnfit.c (modified) (1 diff)
-
psphotRoughClass.c (modified) (1 diff)
-
psphotSkyReplace.c (modified) (1 diff)
-
psphotSourceFreePixels.c (modified) (1 diff)
-
psphotSourceMatch.c (modified) (2 diffs)
-
psphotSourceSize.c (modified) (2 diffs)
-
psphotSourceStats.c (modified) (1 diff)
-
psphotStackChisqImage.c (modified) (4 diffs)
-
psphotStackImageLoop.c (modified) (3 diffs)
-
psphotStackMatchPSFs.c (modified) (1 diff)
-
psphotStackReadout.c (modified) (1 diff)
-
psphotSubtractBackground.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20101103/psphot/src/Makefile.am
r29004 r29904 102 102 psphotStackPSF.c \ 103 103 psphotCleanup.c 104 105 106 107 # # psphot analysis of the detectability of specified positions108 # psphotDetect_SOURCES = \109 # psphotDetect.c \110 # psphotDetectArguments.c \111 # psphotDetectParseCamera.c \112 # psphotDetectImageLoop.c \113 # psphotDetectReadout.c \114 # psphotMosaicChip.c \115 # psphotCleanup.c116 104 117 105 # psphotTest_SOURCES = \ -
branches/eam_branches/ipp-20101103/psphot/src/psphot.h
r29608 r29904 24 24 bool psphotModelTest (pmConfig *config, const pmFPAview *view, psMetadata *recipe); 25 25 bool psphotInit (void); 26 bool psphotReadout (pmConfig *config, const pmFPAview *view );27 bool psphotReadoutFindPSF(pmConfig *config, const pmFPAview *view, psArray *inSources);28 bool psphotReadoutKnownSources(pmConfig *config, const pmFPAview *view, psArray *inSources);29 bool psphotReadoutMinimal(pmConfig *config, const pmFPAview *view );26 bool psphotReadout (pmConfig *config, const pmFPAview *view, const char *filerule); 27 bool psphotReadoutFindPSF(pmConfig *config, const pmFPAview *view, const char *filerule, psArray *inSources); 28 bool psphotReadoutKnownSources(pmConfig *config, const pmFPAview *view, const char *filerule, psArray *inSources); 29 bool psphotReadoutMinimal(pmConfig *config, const pmFPAview *view, const char *filerule); 30 30 31 31 bool psphotReadoutCleanup (pmConfig *config, const pmFPAview *view, const char *filerule); … … 219 219 bool psphotFitSummary (void); 220 220 221 bool psphotLoadPSF (pmConfig *config, const pmFPAview *view );221 bool psphotLoadPSF (pmConfig *config, const pmFPAview *view, const char *filerule); 222 222 bool psphotLoadPSFReadout (pmConfig *config, const pmFPAview *view, const char *outFilename, const char *inFilename, int index); 223 223 … … 304 304 pmConfig *psphotForcedArguments(int argc, char **argv); 305 305 bool psphotForcedImageLoop (pmConfig *config); 306 bool psphotForcedReadout(pmConfig *config, const pmFPAview *view );306 bool psphotForcedReadout(pmConfig *config, const pmFPAview *view, const char *filerule); 307 307 308 308 pmConfig *psphotMakePSFArguments(int argc, char **argv); 309 309 bool psphotMakePSFImageLoop (pmConfig *config); 310 bool psphotMakePSFReadout(pmConfig *config, const pmFPAview *view); 310 bool psphotMakePSFReadout(pmConfig *config, const pmFPAview *view, const char *filerule); 311 312 int psphotFileruleCount(const pmConfig *config, const char *filerule); 311 313 312 314 /**** psphotStack prototypes ****/ -
branches/eam_branches/ipp-20101103/psphot/src/psphotAddNoise.c
r29004 r29904 18 18 psAssert (recipe, "missing recipe?"); 19 19 20 int num = psMetadataLookupS32 (&status, config->arguments, "PSPHOT.INPUT.NUM"); 21 psAssert (status, "programming error: must define PSPHOT.INPUT.NUM"); 20 int num = psphotFileruleCount(config, filerule); 22 21 23 22 // loop over the available readouts -
branches/eam_branches/ipp-20101103/psphot/src/psphotApResid.c
r29548 r29904 13 13 psAssert (recipe, "missing recipe?"); 14 14 15 int num = psMetadataLookupS32 (&status, config->arguments, "PSPHOT.INPUT.NUM"); 16 psAssert (status, "programming error: must define PSPHOT.INPUT.NUM"); 15 int num = psphotFileruleCount(config, filerule); 17 16 18 17 // skip the chisq image (optionally?) … … 72 71 if (!measureAptrend) { 73 72 // save nan values since these were not calculated 74 psMetadataAdd (readout->analysis, PS_LIST_TAIL, "APMIFIT", PS_DATA_F32 |PS_META_REPLACE, "aperture residual", NAN);75 psMetadataAdd (readout->analysis, PS_LIST_TAIL, "DAPMIFIT", PS_DATA_F32 |PS_META_REPLACE, "ap residual scatter", NAN);76 psMetadataAdd (readout->analysis, PS_LIST_TAIL, "NAPMIFIT", PS_DATA_S32 |PS_META_REPLACE, "number of apresid stars", 0);77 psMetadataAdd (readout->analysis, PS_LIST_TAIL, "APLOSS", PS_DATA_F32 |PS_META_REPLACE, "aperture loss (mag)", NAN);73 psMetadataAddF32 (readout->analysis, PS_LIST_TAIL, "APMIFIT", PS_META_REPLACE, "aperture residual", NAN); 74 psMetadataAddF32 (readout->analysis, PS_LIST_TAIL, "DAPMIFIT", PS_META_REPLACE, "ap residual scatter", NAN); 75 psMetadataAddS32 (readout->analysis, PS_LIST_TAIL, "NAPMIFIT", PS_META_REPLACE, "number of apresid stars", 0); 76 psMetadataAddF32 (readout->analysis, PS_LIST_TAIL, "APLOSS", PS_META_REPLACE, "aperture loss (mag)", NAN); 78 77 return true; 79 78 } … … 325 324 326 325 // save results for later output 327 psMetadataAdd (readout->analysis, PS_LIST_TAIL, "APMIFIT", PS_DATA_F32 |PS_META_REPLACE, "aperture residual", psf->ApResid);328 psMetadataAdd (readout->analysis, PS_LIST_TAIL, "DAPMIFIT", PS_DATA_F32 |PS_META_REPLACE, "ap residual scatter", psf->dApResid);329 psMetadataAdd (readout->analysis, PS_LIST_TAIL, "NAPMIFIT", PS_DATA_S32 |PS_META_REPLACE, "number of apresid stars", psf->nApResid);330 psMetadataAdd (readout->analysis, PS_LIST_TAIL, "APLOSS", PS_DATA_F32 |PS_META_REPLACE, "aperture loss (mag)", psf->growth ? psf->growth->apLoss : NAN);326 psMetadataAddF32 (readout->analysis, PS_LIST_TAIL, "APMIFIT", PS_META_REPLACE, "aperture residual", psf->ApResid); 327 psMetadataAddF32 (readout->analysis, PS_LIST_TAIL, "DAPMIFIT", PS_META_REPLACE, "ap residual scatter", psf->dApResid); 328 psMetadataAddS32 (readout->analysis, PS_LIST_TAIL, "NAPMIFIT", PS_META_REPLACE, "number of apresid stars", psf->nApResid); 329 psMetadataAddF32 (readout->analysis, PS_LIST_TAIL, "APLOSS", PS_META_REPLACE, "aperture loss (mag)", psf->growth ? psf->growth->apLoss : NAN); 331 330 332 331 psLogMsg ("psphot.apresid", PS_LOG_DETAIL, "aperture residual: %f +/- %f\n", psf->ApResid, psf->dApResid); … … 345 344 escape: 346 345 // save nan values since these were not calculated 347 psMetadataAdd (readout->analysis, PS_LIST_TAIL, "APMIFIT", PS_DATA_F32 |PS_META_REPLACE, "aperture residual", NAN);348 psMetadataAdd (readout->analysis, PS_LIST_TAIL, "DAPMIFIT", PS_DATA_F32 |PS_META_REPLACE, "ap residual scatter", NAN);349 psMetadataAdd (readout->analysis, PS_LIST_TAIL, "NAPMIFIT", PS_DATA_S32 |PS_META_REPLACE, "number of apresid stars", 0);350 psMetadataAdd (readout->analysis, PS_LIST_TAIL, "APLOSS", PS_DATA_F32 |PS_META_REPLACE, "aperture loss (mag)", NAN);346 psMetadataAddF32 (readout->analysis, PS_LIST_TAIL, "APMIFIT", PS_META_REPLACE, "aperture residual", NAN); 347 psMetadataAddF32 (readout->analysis, PS_LIST_TAIL, "DAPMIFIT", PS_META_REPLACE, "ap residual scatter", NAN); 348 psMetadataAddS32 (readout->analysis, PS_LIST_TAIL, "NAPMIFIT", PS_META_REPLACE, "number of apresid stars", 0); 349 psMetadataAddF32 (readout->analysis, PS_LIST_TAIL, "APLOSS", PS_META_REPLACE, "aperture loss (mag)", NAN); 351 350 352 351 psFree (xPos); -
branches/eam_branches/ipp-20101103/psphot/src/psphotBasicDeblend.c
r28013 r29904 4 4 bool psphotBasicDeblend (pmConfig *config, const pmFPAview *view, const char *filerule) 5 5 { 6 bool status = true; 7 8 int num = psMetadataLookupS32 (&status, config->arguments, "PSPHOT.INPUT.NUM"); 9 psAssert (status, "programming error: must define PSPHOT.INPUT.NUM"); 6 int num = psphotFileruleCount(config, filerule); 10 7 11 8 // loop over the available readouts -
branches/eam_branches/ipp-20101103/psphot/src/psphotBlendFit.c
r29017 r29904 10 10 psAssert (recipe, "missing recipe?"); 11 11 12 int num = psMetadataLookupS32 (&status, config->arguments, "PSPHOT.INPUT.NUM"); 13 psAssert (status, "programming error: must define PSPHOT.INPUT.NUM"); 12 int num = psphotFileruleCount(config, filerule); 14 13 15 14 // loop over the available readouts -
branches/eam_branches/ipp-20101103/psphot/src/psphotChoosePSF.c
r29004 r29904 10 10 psAssert (recipe, "missing recipe?"); 11 11 12 int num = psMetadataLookupS32 (&status, config->arguments, "PSPHOT.INPUT.NUM"); 13 psAssert (status, "programming error: must define PSPHOT.INPUT.NUM"); 12 int num = psphotFileruleCount(config, filerule); 14 13 15 14 // skip the chisq image (optionally?) -
branches/eam_branches/ipp-20101103/psphot/src/psphotDeblendSatstars.c
r29606 r29904 4 4 bool psphotDeblendSatstars (pmConfig *config, const pmFPAview *view, const char *filerule) 5 5 { 6 bool status = true; 7 8 int num = psMetadataLookupS32 (&status, config->arguments, "PSPHOT.INPUT.NUM"); 9 psAssert (status, "programming error: must define PSPHOT.INPUT.NUM"); 6 int num = psphotFileruleCount(config, filerule); 10 7 11 8 // loop over the available readouts -
branches/eam_branches/ipp-20101103/psphot/src/psphotEfficiency.c
r28013 r29904 164 164 psAssert (recipe, "missing recipe?"); 165 165 166 int num = psMetadataLookupS32 (&status, config->arguments, "PSPHOT.INPUT.NUM"); 167 psAssert (status, "programming error: must define PSPHOT.INPUT.NUM"); 166 int num = psphotFileruleCount(config, filerule); 168 167 169 168 // skip the chisq image (optionally?) -
branches/eam_branches/ipp-20101103/psphot/src/psphotExtendedSourceAnalysis.c
r29027 r29904 22 22 } 23 23 24 int num = psMetadataLookupS32 (&status, config->arguments, "PSPHOT.INPUT.NUM"); 25 psAssert (status, "programming error: must define PSPHOT.INPUT.NUM"); 24 int num = psphotFileruleCount(config, filerule); 26 25 27 26 // loop over the available readouts -
branches/eam_branches/ipp-20101103/psphot/src/psphotExtendedSourceAnalysisByObject.c
r29548 r29904 41 41 42 42 // number of images used to define sources 43 int nImages = psMetadataLookupS32 (&status, config->arguments, "PSPHOT.INPUT.NUM"); 44 psAssert (status, "programming error: must define PSPHOT.INPUT.NUM"); 43 int nImages = psphotFileruleCount(config, filerule); 45 44 46 45 // generate look-up arrays for readouts -
branches/eam_branches/ipp-20101103/psphot/src/psphotExtendedSourceFits.c
r29548 r29904 16 16 } 17 17 18 int num = psMetadataLookupS32 (&status, config->arguments, "PSPHOT.INPUT.NUM"); 19 psAssert (status, "programming error: must define PSPHOT.INPUT.NUM"); 18 int num = psphotFileruleCount(config, filerule); 20 19 21 20 // loop over the available readouts -
branches/eam_branches/ipp-20101103/psphot/src/psphotFindDetections.c
r29548 r29904 12 12 psAssert (recipe, "missing recipe?"); 13 13 14 int num = psMetadataLookupS32 (&status, config->arguments, "PSPHOT.INPUT.NUM"); 15 psAssert (status, "programming error: must define PSPHOT.INPUT.NUM"); 14 int num = psphotFileruleCount(config, filerule); 16 15 17 16 // loop over the available readouts -
branches/eam_branches/ipp-20101103/psphot/src/psphotFitSourcesLinear.c
r29548 r29904 21 21 assert (recipe); 22 22 23 int num = psMetadataLookupS32 (&status, config->arguments, "PSPHOT.INPUT.NUM"); 24 psAssert (status, "programming error: must define PSPHOT.INPUT.NUM"); 23 int num = psphotFileruleCount(config, filerule); 25 24 26 25 // loop over the available readouts -
branches/eam_branches/ipp-20101103/psphot/src/psphotForcedImageLoop.c
r25981 r29904 84 84 85 85 // run the actual photometry analysis on this chip/cell/readout 86 if (!psphotForcedReadout (config, view )) {86 if (!psphotForcedReadout (config, view, "PSPHOT.INPUT")) { 87 87 psError(psErrorCodeLast(), false, "failure in psphotReadout for chip %d, cell %d, readout %d\n", view->chip, view->cell, view->readout); 88 88 psFree (view); -
branches/eam_branches/ipp-20101103/psphot/src/psphotForcedReadout.c
r28013 r29904 1 1 # include "psphotInternal.h" 2 2 3 bool psphotForcedReadout(pmConfig *config, const pmFPAview *view ) {3 bool psphotForcedReadout(pmConfig *config, const pmFPAview *view, const char *filerule) { 4 4 5 5 // measure the total elapsed time in psphotReadout. XXX the current threading plan … … 20 20 21 21 // set the photcode for this image 22 if (!psphotAddPhotcode (config, view, "PSPHOT.INPUT")) {22 if (!psphotAddPhotcode (config, view, filerule)) { 23 23 psError (PSPHOT_ERR_CONFIG, false, "trouble defining the photcode"); 24 24 return false; … … 30 30 31 31 // Generate the mask and weight images, including the user-defined analysis region of interest 32 psphotSetMaskAndVariance (config, view, "PSPHOT.INPUT");32 psphotSetMaskAndVariance (config, view, filerule); 33 33 if (!strcasecmp (breakPt, "NOTHING")) { 34 return psphotReadoutCleanup (config, view, "PSPHOT.INPUT");34 return psphotReadoutCleanup (config, view, filerule); 35 35 } 36 36 37 37 // generate a background model (median, smoothed image) 38 if (!psphotModelBackground (config, view, "PSPHOT.INPUT")) {39 return psphotReadoutCleanup (config, view, "PSPHOT.INPUT");38 if (!psphotModelBackground (config, view, filerule)) { 39 return psphotReadoutCleanup (config, view, filerule); 40 40 } 41 if (!psphotSubtractBackground (config, view, "PSPHOT.INPUT")) {42 return psphotReadoutCleanup (config, view, "PSPHOT.INPUT");41 if (!psphotSubtractBackground (config, view, filerule)) { 42 return psphotReadoutCleanup (config, view, filerule); 43 43 } 44 44 if (!strcasecmp (breakPt, "BACKMDL")) { 45 return psphotReadoutCleanup (config, view, "PSPHOT.INPUT");45 return psphotReadoutCleanup (config, view, filerule); 46 46 } 47 47 48 if (!psphotLoadPSF (config, view )) {48 if (!psphotLoadPSF (config, view, filerule)) { 49 49 // this only happens if we had a programming error in psphotLoadPSF 50 50 psError (PSPHOT_ERR_UNKNOWN, false, "error loading psf model"); 51 return psphotReadoutCleanup (config, view, "PSPHOT.INPUT");51 return psphotReadoutCleanup (config, view, filerule); 52 52 } 53 53 54 54 // include externally-supplied sources 55 psphotLoadExtSources (config, view, "PSPHOT.INPUT");55 psphotLoadExtSources (config, view, filerule); 56 56 57 57 // construct an initial model for each object, set the radius to fitRadius, set circular fit mask 58 psphotGuessModels (config, view, "PSPHOT.INPUT");58 psphotGuessModels (config, view, filerule); 59 59 60 60 // merge the newly selected sources into the existing list 61 61 // NOTE: merge OLD and NEW 62 psphotMergeSources (config, view, "PSPHOT.INPUT");62 psphotMergeSources (config, view, filerule); 63 63 64 64 // linear PSF fit to source peaks, subtract the models from the image (in PSF mask) 65 psphotFitSourcesLinear (config, view, "PSPHOT.INPUT", false);65 psphotFitSourcesLinear (config, view, filerule, false); 66 66 67 67 // identify CRs and extended sources … … 71 71 72 72 // calculate source magnitudes 73 psphotMagnitudes(config, view, "PSPHOT.INPUT");73 psphotMagnitudes(config, view, filerule); 74 74 75 75 // XXX do I want to do this? … … 80 80 81 81 // replace background in residual image 82 psphotSkyReplace (config, view, "PSPHOT.INPUT");82 psphotSkyReplace (config, view, filerule); 83 83 84 84 // drop the references to the image pixels held by each source 85 psphotSourceFreePixels (config, view, "PSPHOT.INPUT");85 psphotSourceFreePixels (config, view, filerule); 86 86 87 87 // create the exported-metadata and free local data 88 return psphotReadoutCleanup (config, view, "PSPHOT.INPUT");88 return psphotReadoutCleanup (config, view, filerule); 89 89 } -
branches/eam_branches/ipp-20101103/psphot/src/psphotGuessModels.c
r29605 r29904 12 12 bool status = true; 13 13 14 int num = psMetadataLookupS32 (&status, config->arguments, "PSPHOT.INPUT.NUM"); 15 psAssert (status, "programming error: must define PSPHOT.INPUT.NUM"); 14 int num = psphotFileruleCount(config, filerule); 16 15 17 16 // skip the chisq image (optionally?) -
branches/eam_branches/ipp-20101103/psphot/src/psphotImageLoop.c
r29548 r29904 109 109 110 110 // run the actual photometry analysis on this chip/cell/readout 111 if (!psphotReadout (config, view )) {111 if (!psphotReadout (config, view, "PSPHOT.INPUT")) { 112 112 psError(psErrorCodeLast(), false, "failure in psphotReadout for chip %d, cell %d, readout %d\n", view->chip, view->cell, view->readout); 113 113 psFree (view); -
branches/eam_branches/ipp-20101103/psphot/src/psphotImageQuality.c
r29660 r29904 13 13 psAssert (recipe, "missing recipe?"); 14 14 15 int num = psMetadataLookupS32 (&status, config->arguments, "PSPHOT.INPUT.NUM"); 16 psAssert (status, "programming error: must define PSPHOT.INPUT.NUM"); 15 int num = psphotFileruleCount(config, filerule); 17 16 18 17 // skip the chisq image (optionally?) -
branches/eam_branches/ipp-20101103/psphot/src/psphotLoadPSF.c
r26894 r29904 6 6 7 7 // XXX for now (2010.01.27), the supporting programs do not define multiple PSPHOT.PSF.LOAD 8 // files to go with multiple PSPHOT.INPUTfiles. as a result, the implementation below is8 // files to go with multiple input files. as a result, the implementation below is 9 9 // currently going to work for the case of a single input file, but will fail if we try with a 10 10 // stack of images. … … 59 59 } 60 60 61 bool psphotLoadPSF (pmConfig *config, const pmFPAview *view) { 61 // PSPHOT.PSF.LOAD vs input file -- see note at top 62 bool psphotLoadPSF (pmConfig *config, const pmFPAview *view, const char *filerule) { 62 63 63 bool status = false; 64 65 // XXX PSPHOT.PSF.LOAD vs PSPHOT.INPUT -- see note at top 66 int num = psMetadataLookupS32 (&status, config->arguments, "PSPHOT.INPUT.NUM"); 67 psAssert (status, "programming error: must define PSPHOT.INPUT.NUM"); 64 int num = psphotFileruleCount(config, filerule); 68 65 69 66 // loop over the available readouts … … 71 68 72 69 // Generate the mask and weight images, including the user-defined analysis region of interest 73 if (!psphotLoadPSFReadout (config, view, "PSPHOT.INPUT", "PSPHOT.PSF.LOAD", i)) {70 if (!psphotLoadPSFReadout (config, view, filerule, "PSPHOT.PSF.LOAD", i)) { 74 71 psError (PSPHOT_ERR_CONFIG, false, "failed to load PSF model for PSPHOT.PSF.LOAD entry %d", i); 75 72 return false; -
branches/eam_branches/ipp-20101103/psphot/src/psphotMagnitudes.c
r29004 r29904 9 9 psAssert (recipe, "missing recipe?"); 10 10 11 int num = psMetadataLookupS32 (&status, config->arguments, "PSPHOT.INPUT.NUM"); 12 psAssert (status, "programming error: must define PSPHOT.INPUT.NUM"); 11 int num = psphotFileruleCount(config, filerule); 13 12 14 13 // skip the chisq image (optionally?) -
branches/eam_branches/ipp-20101103/psphot/src/psphotMakePSFImageLoop.c
r25982 r29904 84 84 85 85 // run the actual photometry analysis on this chip/cell/readout 86 if (!psphotMakePSFReadout (config, view )) {86 if (!psphotMakePSFReadout (config, view, "PSPHOT.INPUT")) { 87 87 psError(psErrorCodeLast(), false, "failure in psphotReadout for chip %d, cell %d, readout %d\n", view->chip, view->cell, view->readout); 88 88 psFree (view); -
branches/eam_branches/ipp-20101103/psphot/src/psphotMakePSFReadout.c
r28013 r29904 1 1 # include "psphotInternal.h" 2 2 3 bool psphotMakePSFReadout(pmConfig *config, const pmFPAview *view ) {3 bool psphotMakePSFReadout(pmConfig *config, const pmFPAview *view, const char *filerule) { 4 4 5 5 // measure the total elapsed time in psphotReadout. XXX the current threading plan … … 19 19 20 20 // set the photcode for this image 21 if (!psphotAddPhotcode (config, view, "PSPHOT.INPUT")) {21 if (!psphotAddPhotcode (config, view, filerule)) { 22 22 psError (PSPHOT_ERR_CONFIG, false, "trouble defining the photcode"); 23 23 return false; … … 29 29 30 30 // Generate the mask and weight images, including the user-defined analysis region of interest 31 psphotSetMaskAndVariance (config, view, "PSPHOT.INPUT");31 psphotSetMaskAndVariance (config, view, filerule); 32 32 if (!strcasecmp (breakPt, "NOTHING")) { 33 return psphotReadoutCleanup (config, view, "PSPHOT.INPUT");33 return psphotReadoutCleanup (config, view, filerule); 34 34 } 35 35 36 36 // generate a background model (median, smoothed image) 37 if (!psphotModelBackground (config, view, "PSPHOT.INPUT")) {38 return psphotReadoutCleanup (config, view, "PSPHOT.INPUT");37 if (!psphotModelBackground (config, view, filerule)) { 38 return psphotReadoutCleanup (config, view, filerule); 39 39 } 40 if (!psphotSubtractBackground (config, view, "PSPHOT.INPUT")) {41 return psphotReadoutCleanup (config, view, "PSPHOT.INPUT");40 if (!psphotSubtractBackground (config, view, filerule)) { 41 return psphotReadoutCleanup (config, view, filerule); 42 42 } 43 43 if (!strcasecmp (breakPt, "BACKMDL")) { 44 return psphotReadoutCleanup (config, view, "PSPHOT.INPUT");44 return psphotReadoutCleanup (config, view, filerule); 45 45 } 46 46 47 psphotLoadExtSources (config, view, "PSPHOT.INPUT");47 psphotLoadExtSources (config, view, filerule); 48 48 49 49 // If sources have been supplied, then these should be used to measure the PSF include … … 53 53 // a text file have no valid SN values, but psphotChoosePSF needs to select the top 54 54 // PSF_MAX_NSTARS to generate the PSF. 55 if (!psphotCheckExtSources (config, view, "PSPHOT.INPUT")) {55 if (!psphotCheckExtSources (config, view, filerule)) { 56 56 psLogMsg ("psphot", 3, "failure to select possible PSF sources (external or internal)"); 57 return psphotReadoutCleanup (config, view, "PSPHOT.INPUT");57 return psphotReadoutCleanup (config, view, filerule); 58 58 } 59 59 60 60 // Use bright stellar objects to measure PSF. If we do not have enough stars to generate 61 61 // the PSF, build one from the SEEING guess and model class 62 if (!psphotChoosePSF (config, view, "PSPHOT.INPUT")) {62 if (!psphotChoosePSF (config, view, filerule)) { 63 63 psLogMsg ("psphot", 3, "failure to construct a psf model"); 64 return psphotReadoutCleanup (config, view, "PSPHOT.INPUT");64 return psphotReadoutCleanup (config, view, filerule); 65 65 } 66 66 67 67 // measure aperture photometry corrections 68 68 # if 0 69 if (!psphotApResid (config, view, "PSPHOT.INPUT")) {69 if (!psphotApResid (config, view, filerule)) { 70 70 psLogMsg ("psphot", 3, "failed on psphotApResid"); 71 return psphotReadoutCleanup (config, view, "PSPHOT.INPUT");71 return psphotReadoutCleanup (config, view, filerule); 72 72 } 73 73 # endif 74 74 75 return psphotReadoutCleanup (config, view, "PSPHOT.INPUT");75 return psphotReadoutCleanup (config, view, filerule); 76 76 } -
branches/eam_branches/ipp-20101103/psphot/src/psphotMaskReadout.c
r28013 r29904 9 9 psAssert (recipe, "missing recipe?"); 10 10 11 int num = psMetadataLookupS32 (&status, config->arguments, "PSPHOT.INPUT.NUM"); 12 psAssert (status, "programming error: must define PSPHOT.INPUT.NUM"); 11 int num = psphotFileruleCount(config, filerule); 13 12 14 13 // loop over the available readouts … … 17 16 // Generate the mask and weight images, including the user-defined analysis region of interest 18 17 if (!psphotSetMaskAndVarianceReadout (config, view, filerule, i, recipe)) { 19 psError (PSPHOT_ERR_CONFIG, false, "failed to generate mask for PSPHOT.INPUT entry %d", i);18 psError (PSPHOT_ERR_CONFIG, false, "failed to generate mask for %s entry %d", filerule, i); 20 19 return false; 21 20 } -
branches/eam_branches/ipp-20101103/psphot/src/psphotMergeSources.c
r28013 r29904 8 8 bool psphotMergeSources (pmConfig *config, const pmFPAview *view, const char *filerule) 9 9 { 10 bool status = true; 11 12 int num = psMetadataLookupS32 (&status, config->arguments, "PSPHOT.INPUT.NUM"); 13 psAssert (status, "programming error: must define PSPHOT.INPUT.NUM"); 10 int num = psphotFileruleCount(config, filerule); 14 11 15 12 // loop over the available readouts … … 70 67 // XXX This function needs to be updated to loop over set of input files. At the moment, we 71 68 // only expect a single entry for PSPHOT.INPUT.CMF and PSPHOT.SOURCES.TEXT, so we can only 72 // associate input sources with a single entry for PSPHOT.INPUT69 // associate input sources with a single entry for the filerule 73 70 bool psphotLoadExtSources (pmConfig *config, const pmFPAview *view, const char *filerule) { 74 71 … … 405 402 bool status = true; 406 403 407 int num = psMetadataLookupS32 (&status, config->arguments, "PSPHOT.INPUT.NUM"); 408 psAssert (status, "programming error: must define PSPHOT.INPUT.NUM"); 404 int num = psphotFileruleCount(config, ruleSrc); 409 405 410 406 // skip the chisq image because it is a duplicate of the detection version -
branches/eam_branches/ipp-20101103/psphot/src/psphotModelBackground.c
r28013 r29904 383 383 } 384 384 385 // XXX supply filename or keep PSPHOT.INPUT fixed?386 385 bool psphotModelBackground (pmConfig *config, const pmFPAview *view, const char *filerule) 387 386 { 388 bool status = false; 389 390 int num = psMetadataLookupS32 (&status, config->arguments, "PSPHOT.INPUT.NUM"); 391 psAssert (status, "programming error: must define PSPHOT.INPUT.NUM"); 387 int num = psphotFileruleCount(config, filerule); 392 388 393 389 // loop over the available readouts 394 390 for (int i = 0; i < num; i++) { 395 391 if (!psphotModelBackgroundReadoutFileIndex(config, view, filerule, i)) { 396 psError (PSPHOT_ERR_CONFIG, false, "failed to model background for PSPHOT.INPUT entry %d", i);392 psError (PSPHOT_ERR_CONFIG, false, "failed to model background for %s entry %d", filerule, i); 397 393 return false; 398 394 } -
branches/eam_branches/ipp-20101103/psphot/src/psphotOutput.c
r29824 r29904 1 1 # include "psphotInternal.h" 2 3 // convert filerule to filerule.NUM and look up in the config->arguments metadata 4 int psphotFileruleCount(const pmConfig *config, const char *filerule) { 5 6 bool status = false; 7 8 psString name = NULL; 9 psStringAppend(&name, "%s.NUM", filerule); 10 int num = psMetadataLookupS32 (&status, config->arguments, name); 11 psAssert (status, "programming error: must define %s", name); 12 psFree (name); 13 return num; 14 } 2 15 3 16 pmReadout *psphotSelectBackground (pmConfig *config, … … 117 130 bool psphotAddPhotcode (pmConfig *config, const pmFPAview *view, const char *filerule) { 118 131 119 bool status = false; 120 121 int num = psMetadataLookupS32 (&status, config->arguments, "PSPHOT.INPUT.NUM"); 122 psAssert (status, "programming error: must define PSPHOT.INPUT.NUM"); 132 int num = psphotFileruleCount(config, filerule); 123 133 124 134 // loop over the available readouts 125 135 for (int i = 0; i < num; i++) { 126 136 if (!psphotAddPhotcodeReadout (config, view, filerule, i)) { 127 psError (PSPHOT_ERR_CONFIG, false, "failed to add photcode to PSPHOT.INPUT entry %d", i);137 psError (PSPHOT_ERR_CONFIG, false, "failed to add photcode to %s entry %d", filerule, i); 128 138 return false; 129 139 } -
branches/eam_branches/ipp-20101103/psphot/src/psphotRadialApertures.c
r28013 r29904 18 18 } 19 19 20 int num = psMetadataLookupS32 (&status, config->arguments, "PSPHOT.INPUT.NUM"); 21 psAssert (status, "programming error: must define PSPHOT.INPUT.NUM"); 20 int num = psphotFileruleCount(config, filerule); 22 21 23 22 // loop over the available readouts -
branches/eam_branches/ipp-20101103/psphot/src/psphotRadialAperturesByObject.c
r28013 r29904 21 21 22 22 // number of images used to define sources 23 int nImages = psMetadataLookupS32 (&status, config->arguments, "PSPHOT.INPUT.NUM"); 24 psAssert (status, "programming error: must define PSPHOT.INPUT.NUM"); 23 int nImages = psphotFileruleCount(config, filerule); 25 24 26 25 // radMax stores the upper bounds of the annuli -
branches/eam_branches/ipp-20101103/psphot/src/psphotReadout.c
r29004 r29904 9 9 } 10 10 11 bool psphotReadout(pmConfig *config, const pmFPAview *view ) {11 bool psphotReadout(pmConfig *config, const pmFPAview *view, const char *filerule) { 12 12 13 13 // measure the total elapsed time in psphotReadout. dtime is the elapsed time used jointly … … 28 28 29 29 // set the photcode for this image 30 if (!psphotAddPhotcode (config, view, "PSPHOT.INPUT")) {30 if (!psphotAddPhotcode (config, view, filerule)) { 31 31 psError (PSPHOT_ERR_CONFIG, false, "trouble defining the photcode"); 32 32 return false; … … 34 34 35 35 // Generate the mask and weight images, including the user-defined analysis region of interest 36 if (!psphotSetMaskAndVariance (config, view, "PSPHOT.INPUT")) {37 return psphotReadoutCleanup(config, view, "PSPHOT.INPUT");36 if (!psphotSetMaskAndVariance (config, view, filerule)) { 37 return psphotReadoutCleanup(config, view, filerule); 38 38 } 39 39 if (!strcasecmp (breakPt, "NOTHING")) { 40 return psphotReadoutCleanup (config, view, "PSPHOT.INPUT");40 return psphotReadoutCleanup (config, view, filerule); 41 41 } 42 42 43 43 // generate a background model (median, smoothed image) 44 if (!psphotModelBackground (config, view, "PSPHOT.INPUT")) {45 return psphotReadoutCleanup (config, view, "PSPHOT.INPUT");46 } 47 48 if (!psphotSubtractBackground (config, view, "PSPHOT.INPUT")) {49 return psphotReadoutCleanup (config, view, "PSPHOT.INPUT");44 if (!psphotModelBackground (config, view, filerule)) { 45 return psphotReadoutCleanup (config, view, filerule); 46 } 47 48 if (!psphotSubtractBackground (config, view, filerule)) { 49 return psphotReadoutCleanup (config, view, filerule); 50 50 } 51 51 if (!strcasecmp (breakPt, "BACKMDL")) { 52 return psphotReadoutCleanup (config, view, "PSPHOT.INPUT");52 return psphotReadoutCleanup (config, view, filerule); 53 53 } 54 54 55 55 // load the psf model, if suppled. FWHM_MAJ,FWHM_MIN,etc are determined and saved on 56 // readout->analysis. XXX Note: this function currently only works with a single 57 // PSPHOT.INPUT 58 if (!psphotLoadPSF (config, view)) { // ??? need to supply 2 ? 56 // readout->analysis. NOTE: this function currently only loads from PSPHOT.PSF.LOAD 57 if (!psphotLoadPSF (config, view, filerule)) { // ??? need to supply 2 ? 59 58 psError (PSPHOT_ERR_UNKNOWN, false, "error loading psf model"); 60 return psphotReadoutCleanup (config, view, "PSPHOT.INPUT");59 return psphotReadoutCleanup (config, view, filerule); 61 60 } 62 61 63 62 // find the detections (by peak and/or footprint) in the image. 64 if (!psphotFindDetections (config, view, "PSPHOT.INPUT", true)) { // pass 163 if (!psphotFindDetections (config, view, filerule, true)) { // pass 1 65 64 // this only happens if we had an error in psphotFindDetections 66 65 psError (PSPHOT_ERR_UNKNOWN, false, "failure in peak analysis"); 67 return psphotReadoutCleanup (config, view, "PSPHOT.INPUT");66 return psphotReadoutCleanup (config, view, filerule); 68 67 } 69 68 70 69 // construct sources and measure basic stats (saved on detections->newSources) 71 if (!psphotSourceStats (config, view, "PSPHOT.INPUT", true)) { // pass 170 if (!psphotSourceStats (config, view, filerule, true)) { // pass 1 72 71 psError(PSPHOT_ERR_UNKNOWN, false, "failure to generate sources"); 73 return psphotReadoutCleanup (config, view, "PSPHOT.INPUT");72 return psphotReadoutCleanup (config, view, filerule); 74 73 } 75 74 if (!strcasecmp (breakPt, "PEAKS")) { 76 return psphotReadoutCleanup (config, view, "PSPHOT.INPUT");75 return psphotReadoutCleanup (config, view, filerule); 77 76 } 78 77 79 78 // find blended neighbors of very saturated stars (detections->newSources) 80 if (!psphotDeblendSatstars (config, view, "PSPHOT.INPUT")) {79 if (!psphotDeblendSatstars (config, view, filerule)) { 81 80 psError (PSPHOT_ERR_UNKNOWN, false, "failed on satstar deblend analysis"); 82 return psphotReadoutCleanup (config, view, "PSPHOT.INPUT");81 return psphotReadoutCleanup (config, view, filerule); 83 82 } 84 83 85 84 // mark blended peaks PS_SOURCE_BLEND (detections->newSources) 86 if (!psphotBasicDeblend (config, view, "PSPHOT.INPUT")) {85 if (!psphotBasicDeblend (config, view, filerule)) { 87 86 psError (PSPHOT_ERR_UNKNOWN, false, "failed on deblend analysis"); 88 return psphotReadoutCleanup (config, view, "PSPHOT.INPUT");87 return psphotReadoutCleanup (config, view, filerule); 89 88 } 90 89 91 90 // classify sources based on moments, brightness. if a PSF model has been loaded, the PSF 92 91 // clump defined for it is used not measured (detections->newSources) 93 if (!psphotRoughClass (config, view, "PSPHOT.INPUT")) { // pass 192 if (!psphotRoughClass (config, view, filerule)) { // pass 1 94 93 psError (PSPHOT_ERR_UNKNOWN, false, "failed to determine rough classifications"); 95 return psphotReadoutCleanup (config, view, "PSPHOT.INPUT");94 return psphotReadoutCleanup (config, view, filerule); 96 95 } 97 96 98 97 // if we were not supplied a PSF model, determine the IQ stats here (detections->newSources) 99 if (!psphotImageQuality (config, view, "PSPHOT.INPUT")) { // pass 198 if (!psphotImageQuality (config, view, filerule)) { // pass 1 100 99 psError (PSPHOT_ERR_UNKNOWN, false, "failed to measure image quality"); 101 return psphotReadoutCleanup (config, view, "PSPHOT.INPUT");100 return psphotReadoutCleanup (config, view, filerule); 102 101 } 103 102 if (!strcasecmp (breakPt, "MOMENTS")) { 104 return psphotReadoutCleanup (config, view, "PSPHOT.INPUT");103 return psphotReadoutCleanup (config, view, filerule); 105 104 } 106 105 107 106 // use bright stellar objects to measure PSF if we were supplied a PSF for any input file, 108 107 // this step is skipped 109 if (!psphotChoosePSF (config, view, "PSPHOT.INPUT")) { // pass 1108 if (!psphotChoosePSF (config, view, filerule)) { // pass 1 110 109 psLogMsg ("psphot", 3, "failure to construct a psf model"); 111 return psphotReadoutCleanup (config, view, "PSPHOT.INPUT");110 return psphotReadoutCleanup (config, view, filerule); 112 111 } 113 112 if (!strcasecmp (breakPt, "PSFMODEL")) { 114 return psphotReadoutCleanup (config, view, "PSPHOT.INPUT");113 return psphotReadoutCleanup (config, view, filerule); 115 114 } 116 115 117 116 // include externally-supplied sources 118 117 // XXX fix this in the new multi-input context 119 // psphotLoadExtSources (config, view, "PSPHOT.INPUT"); // pass 1118 // psphotLoadExtSources (config, view, filerule); // pass 1 120 119 121 120 // construct an initial model for each object, set the radius to fitRadius, set circular 122 121 // fit mask (detections->newSources) 123 psphotGuessModels (config, view, "PSPHOT.INPUT"); // pass 1122 psphotGuessModels (config, view, filerule); // pass 1 124 123 125 124 // merge the newly selected sources into the existing list 126 125 // NOTE: merge OLD and NEW 127 psphotMergeSources (config, view, "PSPHOT.INPUT");126 psphotMergeSources (config, view, filerule); 128 127 129 128 // linear PSF fit to source peaks, subtract the models from the image (in PSF mask) 130 psphotFitSourcesLinear (config, view, "PSPHOT.INPUT", false); // pass 1 (detections->allSources)129 psphotFitSourcesLinear (config, view, filerule, false); // pass 1 (detections->allSources) 131 130 132 131 // identify CRs and extended sources (only unmeasured sources are measured) 133 psphotSourceSize (config, view, "PSPHOT.INPUT", true); // pass 1 (detections->allSources)132 psphotSourceSize (config, view, filerule, true); // pass 1 (detections->allSources) 134 133 if (!strcasecmp (breakPt, "ENSEMBLE")) { 135 134 goto finish; … … 138 137 // non-linear PSF and EXT fit to brighter sources 139 138 // replace model flux, adjust mask as needed, fit, subtract the models (full stamp) 140 psphotBlendFit (config, view, "PSPHOT.INPUT"); // pass 1 (detections->allSources)139 psphotBlendFit (config, view, filerule); // pass 1 (detections->allSources) 141 140 142 141 // replace all sources 143 psphotReplaceAllSources (config, view, "PSPHOT.INPUT"); // pass 1 (detections->allSources)142 psphotReplaceAllSources (config, view, filerule); // pass 1 (detections->allSources) 144 143 145 144 // linear fit to include all sources (subtract again) 146 145 // NOTE : apply to ALL sources (extended + psf) 147 psphotFitSourcesLinear (config, view, "PSPHOT.INPUT", true); // pass 2 (detections->allSources)146 psphotFitSourcesLinear (config, view, filerule, true); // pass 2 (detections->allSources) 148 147 149 148 // if we only do one pass, skip to extended source analysis … … 153 152 154 153 // add noise for subtracted objects 155 psphotAddNoise (config, view, "PSPHOT.INPUT"); // pass 1 (detections->allSources)154 psphotAddNoise (config, view, filerule); // pass 1 (detections->allSources) 156 155 157 156 // find fainter sources 158 157 // NOTE: finds new peaks and new footprints, OLD and FULL set are saved on detections 159 psphotFindDetections (config, view, "PSPHOT.INPUT", false); // pass 2 (detections->peaks, detections->footprints)158 psphotFindDetections (config, view, filerule, false); // pass 2 (detections->peaks, detections->footprints) 160 159 161 160 // remove noise for subtracted objects (ie, return to normal noise level) 162 161 // NOTE: this needs to operate only on the OLD sources 163 psphotSubNoise (config, view, "PSPHOT.INPUT"); // pass 1 (detections->allSources)162 psphotSubNoise (config, view, filerule); // pass 1 (detections->allSources) 164 163 165 164 // define new sources based on only the new peaks 166 165 // NOTE: new sources are saved on detections->newSources 167 psphotSourceStats (config, view, "PSPHOT.INPUT", false); // pass 2 (detections->newSources)166 psphotSourceStats (config, view, filerule, false); // pass 2 (detections->newSources) 168 167 169 168 // set source type 170 169 // NOTE: apply only to detections->newSources 171 if (!psphotRoughClass (config, view, "PSPHOT.INPUT")) { // pass 2 (detections->newSources)170 if (!psphotRoughClass (config, view, filerule)) { // pass 2 (detections->newSources) 172 171 psLogMsg ("psphot", 3, "failed to find a valid PSF clump for image"); 173 return psphotReadoutCleanup (config, view, "PSPHOT.INPUT");172 return psphotReadoutCleanup (config, view, filerule); 174 173 } 175 174 176 175 // create full input models, set the radius to fitRadius, set circular fit mask 177 176 // NOTE: apply only to detections->newSources 178 psphotGuessModels (config, view, "PSPHOT.INPUT"); // pass 2 (detections->newSources)177 psphotGuessModels (config, view, filerule); // pass 2 (detections->newSources) 179 178 180 179 // replace all sources so fit below applies to all at once 181 180 // NOTE: apply only to OLD sources (which have been subtracted) 182 psphotReplaceAllSources (config, view, "PSPHOT.INPUT"); // pass 2181 psphotReplaceAllSources (config, view, filerule); // pass 2 183 182 184 183 // merge the newly selected sources into the existing list 185 184 // NOTE: merge OLD and NEW 186 185 // XXX check on free of sources... 187 psphotMergeSources (config, view, "PSPHOT.INPUT"); // (detections->newSources + detections->allSources -> detections->allSources)186 psphotMergeSources (config, view, filerule); // (detections->newSources + detections->allSources -> detections->allSources) 188 187 189 188 // NOTE: apply to ALL sources 190 psphotFitSourcesLinear (config, view, "PSPHOT.INPUT", true); // pass 3 (detections->allSources)189 psphotFitSourcesLinear (config, view, filerule, true); // pass 3 (detections->allSources) 191 190 192 191 pass1finish: … … 194 193 // measure source size for the remaining sources 195 194 // NOTE: applies only to NEW (unmeasured) sources 196 psphotSourceSize (config, view, "PSPHOT.INPUT", false); // pass 2 (detections->allSources)197 198 psphotExtendedSourceAnalysis (config, view, "PSPHOT.INPUT"); // pass 1 (detections->allSources)199 psphotExtendedSourceFits (config, view, "PSPHOT.INPUT"); // pass 1 (detections->allSources)195 psphotSourceSize (config, view, filerule, false); // pass 2 (detections->allSources) 196 197 psphotExtendedSourceAnalysis (config, view, filerule); // pass 1 (detections->allSources) 198 psphotExtendedSourceFits (config, view, filerule); // pass 1 (detections->allSources) 200 199 201 200 finish: … … 205 204 206 205 // measure aperture photometry corrections 207 if (!psphotApResid (config, view, "PSPHOT.INPUT")) { // pass 1 (detections->allSources)206 if (!psphotApResid (config, view, filerule)) { // pass 1 (detections->allSources) 208 207 psLogMsg ("psphot", 3, "failed on psphotApResid"); 209 return psphotReadoutCleanup (config, view, "PSPHOT.INPUT");208 return psphotReadoutCleanup (config, view, filerule); 210 209 } 211 210 212 211 // calculate source magnitudes 213 if (!psphotMagnitudes(config, view, "PSPHOT.INPUT")) { // pass 1 (detections->allSources)212 if (!psphotMagnitudes(config, view, filerule)) { // pass 1 (detections->allSources) 214 213 psErrorStackPrint(stderr, "Unable to do magnitudes."); 215 214 psErrorClear(); 216 215 } 217 if (!psphotEfficiency(config, view, "PSPHOT.INPUT")) { // pass 1216 if (!psphotEfficiency(config, view, filerule)) { // pass 1 218 217 psErrorStackPrint(stderr, "Unable to determine detection efficiencies from fake sources"); 219 218 psErrorClear(); … … 224 223 225 224 // replace background in residual image 226 if (!psphotSkyReplace (config, view, "PSPHOT.INPUT")) { // pass 1225 if (!psphotSkyReplace (config, view, filerule)) { // pass 1 227 226 psErrorStackPrint(stderr, "Unable to replace sky"); 228 227 psErrorClear(); 229 228 230 229 /* psLogMsg("psphot", 3, "failed on psphotSkyReplace"); */ 231 /* return(psphotReadoutCleanup(config, view, "PSPHOT.INPUT")); */230 /* return(psphotReadoutCleanup(config, view, filerule)); */ 232 231 } 233 232 // drop the references to the image pixels held by each source 234 if (!psphotSourceFreePixels (config, view, "PSPHOT.INPUT")) { // pass 1233 if (!psphotSourceFreePixels (config, view, filerule)) { // pass 1 235 234 psErrorStackPrint(stderr, "Unable to free source pixels"); 236 235 psErrorClear(); 237 236 238 237 /* psLogMsg ("psphot", 3, "failed on psphotSourceFreePixels"); */ 239 /* return(psphotReadoutCleanup(config, view, "PSPHOT.INPUT")); */238 /* return(psphotReadoutCleanup(config, view, filerule)); */ 240 239 } 241 240 // create the exported-metadata and free local data 242 return psphotReadoutCleanup(config, view, "PSPHOT.INPUT");241 return psphotReadoutCleanup(config, view, filerule); 243 242 } -
branches/eam_branches/ipp-20101103/psphot/src/psphotReadoutCleanup.c
r28013 r29904 19 19 psAssert (recipe, "missing recipe?"); 20 20 21 int num = psMetadataLookupS32 (&status, config->arguments, "PSPHOT.INPUT.NUM"); 22 psAssert (status, "programming error: must define PSPHOT.INPUT.NUM"); 21 int num = psphotFileruleCount(config, filerule); 23 22 24 23 // loop over the available readouts -
branches/eam_branches/ipp-20101103/psphot/src/psphotReadoutFindPSF.c
r28013 r29904 3 3 // in this psphotReadout-variant, we are only trying to determine the PSF given an existing set 4 4 // of input source positions to use as initial PSF stars. 5 bool psphotReadoutFindPSF(pmConfig *config, const pmFPAview *view, psArray *inSources) {5 bool psphotReadoutFindPSF(pmConfig *config, const pmFPAview *view, const char *filerule, psArray *inSources) { 6 6 7 7 psTimerStart ("psphotReadout"); 8 8 9 // set the photcode for the PSPHOT.INPUT10 if (!psphotAddPhotcode(config, view, "PSPHOT.INPUT")) {9 // set the photcode for the input 10 if (!psphotAddPhotcode(config, view, filerule)) { 11 11 psError(PSPHOT_ERR_CONFIG, false, "trouble defining the photcode"); 12 12 return false; … … 14 14 15 15 // Generate the mask and variance images, including the user-defined analysis region of interest 16 psphotSetMaskAndVariance (config, view, "PSPHOT.INPUT");16 psphotSetMaskAndVariance (config, view, filerule); 17 17 18 18 // Note that in this implementation, we do NOT model the background and we do not 19 19 // attempt to detect the sources in the image 20 20 21 // include externally-supplied sources (supplied as PSPHOT.INPUT.CMF)22 // XXX we assume a single set of input sources is supplied23 if (!psphotDetectionsFromSources (config, view, "PSPHOT.INPUT", inSources)) {21 // include the externally-supplied sources (inSources) 22 // (we assume a single set of input sources is supplied) 23 if (!psphotDetectionsFromSources (config, view, filerule, inSources)) { 24 24 psError(PSPHOT_ERR_ARGUMENTS, true, "Can't find PSF stars"); 25 return psphotReadoutCleanup (config, view, "PSPHOT.INPUT");25 return psphotReadoutCleanup (config, view, filerule); 26 26 } 27 27 28 28 // construct detections->newSources and measure basic stats (moments, local sky) 29 if (!psphotSourceStats(config, view, "PSPHOT.INPUT", true)) {29 if (!psphotSourceStats(config, view, filerule, true)) { 30 30 psError(PSPHOT_ERR_UNKNOWN, false, "failure to generate sources"); 31 31 return false; … … 33 33 34 34 // peak flux is wrong : use the peak measured in the moments analysis: 35 if (!psphotRepairLoadedSources(config, view, "PSPHOT.INPUT")) {35 if (!psphotRepairLoadedSources(config, view, filerule)) { 36 36 psError(PSPHOT_ERR_UNKNOWN, false, "failure to repair sources"); 37 37 return false; … … 39 39 40 40 // classify sources based on moments, brightness (psf is not known) 41 if (!psphotRoughClass (config, view, "PSPHOT.INPUT")) {41 if (!psphotRoughClass (config, view, filerule)) { 42 42 psError (PSPHOT_ERR_UNKNOWN, false, "failed to determine rough source class"); 43 return psphotReadoutCleanup (config, view, "PSPHOT.INPUT");43 return psphotReadoutCleanup (config, view, filerule); 44 44 } 45 45 46 if (!psphotImageQuality (config, view, "PSPHOT.INPUT")) {46 if (!psphotImageQuality (config, view, filerule)) { 47 47 psError (PSPHOT_ERR_UNKNOWN, false, "failed to measure image quality"); 48 return psphotReadoutCleanup (config, view, "PSPHOT.INPUT");48 return psphotReadoutCleanup (config, view, filerule); 49 49 } 50 50 51 if (!psphotChoosePSF(config, view, "PSPHOT.INPUT")) {51 if (!psphotChoosePSF(config, view, filerule)) { 52 52 psError(PSPHOT_ERR_PSF, false, "Failed to construct a psf model"); 53 return psphotReadoutCleanup (config, view, "PSPHOT.INPUT");53 return psphotReadoutCleanup (config, view, filerule); 54 54 } 55 55 … … 59 59 // fits from that analysis, or run the linear PSF fit for all objects currently in hand 60 60 // construct an initial model for each object, set the radius to fitRadius, set circular fit mask 61 psphotGuessModels (config, view, "PSPHOT.INPUT");61 psphotGuessModels (config, view, filerule); 62 62 # endif 63 63 64 64 // merge the newly selected sources into the existing list 65 65 // NOTE: merge OLD and NEW 66 psphotMergeSources (config, view, "PSPHOT.INPUT");66 psphotMergeSources (config, view, filerule); 67 67 68 68 # if 0 69 69 // measure aperture photometry corrections 70 if (!psphotApResid (config, view, "PSPHOT.INPUT")) {70 if (!psphotApResid (config, view, filerule)) { 71 71 psLogMsg ("psphot", 3, "failed on psphotApResid"); 72 return psphotReadoutCleanup (config, view, "PSPHOT.INPUT");72 return psphotReadoutCleanup (config, view, filerule); 73 73 } 74 74 # endif 75 75 76 76 // drop the references to the image pixels held by each source 77 psphotSourceFreePixels(config, view, "PSPHOT.INPUT");77 psphotSourceFreePixels(config, view, filerule); 78 78 79 79 // create the exported-metadata and free local data 80 return psphotReadoutCleanup (config, view, "PSPHOT.INPUT");80 return psphotReadoutCleanup (config, view, filerule); 81 81 } -
branches/eam_branches/ipp-20101103/psphot/src/psphotReadoutKnownSources.c
r28013 r29904 3 3 // in this psphotReadout-variant, we are only measuring the photometry for known sources, using 4 4 // a PSF generated for this observation from those sources 5 bool psphotReadoutKnownSources(pmConfig *config, const pmFPAview *view, psArray *inSources) {5 bool psphotReadoutKnownSources(pmConfig *config, const pmFPAview *view, const char *filerule, psArray *inSources) { 6 6 7 7 psTimerStart ("psphotReadout"); 8 8 9 9 // set the photcode for this image 10 if (!psphotAddPhotcode(config, view, "PSPHOT.INPUT")) {10 if (!psphotAddPhotcode(config, view, filerule)) { 11 11 psError(PSPHOT_ERR_CONFIG, false, "trouble defining the photcode"); 12 12 return false; … … 14 14 15 15 // Generate the mask and weight images, including the user-defined analysis region of interest 16 psphotSetMaskAndVariance (config, view, "PSPHOT.INPUT");16 psphotSetMaskAndVariance (config, view, filerule); 17 17 18 18 // Note that in this implementation, we do NOT model the background and we do not … … 20 20 21 21 // include externally-supplied sources (supplied as PSPHOT.INPUT.CMF) 22 if (!psphotDetectionsFromSources (config, view, "PSPHOT.INPUT", inSources)) {22 if (!psphotDetectionsFromSources (config, view, filerule, inSources)) { 23 23 psError(PSPHOT_ERR_ARGUMENTS, true, "Can't find PSF stars"); 24 return psphotReadoutCleanup (config, view, "PSPHOT.INPUT");24 return psphotReadoutCleanup (config, view, filerule); 25 25 } 26 26 27 27 // construct sources and measure basic stats 28 if (!psphotSourceStats (config, view, "PSPHOT.INPUT", true)) {28 if (!psphotSourceStats (config, view, filerule, true)) { 29 29 psError(PSPHOT_ERR_UNKNOWN, false, "failure to generate sources"); 30 30 return false; … … 32 32 33 33 // peak flux is wrong : use the peak measured in the moments analysis: 34 if (!psphotRepairLoadedSources(config, view, "PSPHOT.INPUT")) {34 if (!psphotRepairLoadedSources(config, view, filerule)) { 35 35 psError(PSPHOT_ERR_UNKNOWN, false, "failure to repair sources"); 36 36 return false; … … 38 38 39 39 // classify sources based on moments, brightness (psf is not known) 40 if (!psphotRoughClass (config, view, "PSPHOT.INPUT")) {40 if (!psphotRoughClass (config, view, filerule)) { 41 41 psError (PSPHOT_ERR_UNKNOWN, false, "failed to determine rough source class"); 42 return psphotReadoutCleanup (config, view, "PSPHOT.INPUT");42 return psphotReadoutCleanup (config, view, filerule); 43 43 } 44 44 45 if (!psphotChoosePSF (config, view, "PSPHOT.INPUT")) {45 if (!psphotChoosePSF (config, view, filerule)) { 46 46 psError(PSPHOT_ERR_PSF, false, "Failed to construct a psf model"); 47 return psphotReadoutCleanup (config, view, "PSPHOT.INPUT");47 return psphotReadoutCleanup (config, view, filerule); 48 48 } 49 49 50 50 // construct an initial model for each object 51 psphotGuessModels (config, view, "PSPHOT.INPUT");51 psphotGuessModels (config, view, filerule); 52 52 53 53 // merge the newly selected sources into the existing list 54 54 // NOTE: merge OLD and NEW 55 psphotMergeSources (config, view, "PSPHOT.INPUT");55 psphotMergeSources (config, view, filerule); 56 56 57 57 // linear PSF fit to source peaks 58 psphotFitSourcesLinear (config, view, "PSPHOT.INPUT", false);58 psphotFitSourcesLinear (config, view, filerule, false); 59 59 60 60 // measure aperture photometry corrections 61 if (!psphotApResid (config, view, "PSPHOT.INPUT")) {61 if (!psphotApResid (config, view, filerule)) { 62 62 psLogMsg ("psphot", 3, "failed on psphotApResid"); 63 return psphotReadoutCleanup (config, view, "PSPHOT.INPUT");63 return psphotReadoutCleanup (config, view, filerule); 64 64 } 65 65 66 66 // calculate source magnitudes 67 psphotMagnitudes(config, view, "PSPHOT.INPUT");67 psphotMagnitudes(config, view, filerule); 68 68 69 69 // drop the references to the image pixels held by each source 70 psphotSourceFreePixels (config, view, "PSPHOT.INPUT");70 psphotSourceFreePixels (config, view, filerule); 71 71 72 72 // create the exported-metadata and free local data 73 return psphotReadoutCleanup (config, view, "PSPHOT.INPUT");73 return psphotReadoutCleanup (config, view, filerule); 74 74 } -
branches/eam_branches/ipp-20101103/psphot/src/psphotReadoutMinimal.c
r28013 r29904 7 7 // NOTE: ppSub needs to perform extended source analysis for comets and trails. 8 8 9 bool psphotReadoutMinimal(pmConfig *config, const pmFPAview *view ) {9 bool psphotReadoutMinimal(pmConfig *config, const pmFPAview *view, const char *filerule) { 10 10 11 11 // measure the total elapsed time in psphotReadout. XXX the current threading plan … … 18 18 19 19 // set the photcode for this image 20 if (!psphotAddPhotcode(config, view, "PSPHOT.INPUT")) {20 if (!psphotAddPhotcode(config, view, filerule)) { 21 21 psError(PSPHOT_ERR_CONFIG, false, "trouble defining the photcode"); 22 22 return false; … … 24 24 25 25 // Generate the mask and weight images, including the user-defined analysis region of interest 26 psphotSetMaskAndVariance (config, view, "PSPHOT.INPUT");26 psphotSetMaskAndVariance (config, view, filerule); 27 27 28 28 // load the psf model, if suppled. FWHM_X,FWHM_Y,etc are saved on readout->analysis 29 if (!psphotLoadPSF (config, view )) {29 if (!psphotLoadPSF (config, view, filerule)) { 30 30 psError (PSPHOT_ERR_CONFIG, false, "missing psf model"); 31 return psphotReadoutCleanup (config, view, "PSPHOT.INPUT");31 return psphotReadoutCleanup (config, view, filerule); 32 32 } 33 33 34 34 // find the detections (by peak and/or footprint) in the image. (final pass) 35 if (!psphotFindDetections(config, view, "PSPHOT.INPUT", false)) {35 if (!psphotFindDetections(config, view, filerule, false)) { 36 36 psError (PSPHOT_ERR_UNKNOWN, false, "failure in peak analysis"); 37 return psphotReadoutCleanup (config, view, "PSPHOT.INPUT");37 return psphotReadoutCleanup (config, view, filerule); 38 38 } 39 39 40 40 // construct sources and measure basic stats (saved on detections->newSources) 41 if (!psphotSourceStats (config, view, "PSPHOT.INPUT", false)) { // pass 141 if (!psphotSourceStats (config, view, filerule, false)) { // pass 1 42 42 psError(PSPHOT_ERR_UNKNOWN, false, "failure to generate sources"); 43 return psphotReadoutCleanup (config, view, "PSPHOT.INPUT");43 return psphotReadoutCleanup (config, view, filerule); 44 44 } 45 45 46 46 // find blended neighbors of very saturated stars 47 psphotDeblendSatstars (config, view, "PSPHOT.INPUT");47 psphotDeblendSatstars (config, view, filerule); 48 48 49 49 // mark blended peaks PS_SOURCE_BLEND 50 if (!psphotBasicDeblend (config, view, "PSPHOT.INPUT")) {50 if (!psphotBasicDeblend (config, view, filerule)) { 51 51 psLogMsg ("psphot", 3, "failed on deblend analysis"); 52 return psphotReadoutCleanup (config, view, "PSPHOT.INPUT");52 return psphotReadoutCleanup (config, view, filerule); 53 53 } 54 54 55 55 // classify sources based on moments, brightness (use supplied psf shape parameters) 56 if (!psphotRoughClass (config, view, "PSPHOT.INPUT")) {56 if (!psphotRoughClass (config, view, filerule)) { 57 57 psLogMsg ("psphot", 3, "failed to find a valid PSF clump for image"); 58 return psphotReadoutCleanup (config, view, "PSPHOT.INPUT");58 return psphotReadoutCleanup (config, view, filerule); 59 59 } 60 60 61 61 // construct an initial model for each object 62 psphotGuessModels (config, view, "PSPHOT.INPUT");62 psphotGuessModels (config, view, filerule); 63 63 64 64 // merge the newly selected sources into the existing list 65 psphotMergeSources (config, view, "PSPHOT.INPUT");65 psphotMergeSources (config, view, filerule); 66 66 67 67 // linear PSF fit to source peaks 68 psphotFitSourcesLinear (config, view, "PSPHOT.INPUT", false);68 psphotFitSourcesLinear (config, view, filerule, false); 69 69 70 70 // XXX eventually, add the extended source fits here 71 71 # if (0) 72 72 // measure source size for the remaining sources 73 psphotSourceSize (config, view, "PSPHOT.INPUT");73 psphotSourceSize (config, view, filerule); 74 74 75 psphotExtendedSourceAnalysis (config, view, "PSPHOT.INPUT");75 psphotExtendedSourceAnalysis (config, view, filerule); 76 76 77 psphotExtendedSourceFits (config, view, "PSPHOT.INPUT");77 psphotExtendedSourceFits (config, view, filerule); 78 78 # endif 79 79 80 80 // calculate source magnitudes 81 psphotMagnitudes(config, view, "PSPHOT.INPUT");81 psphotMagnitudes(config, view, filerule); 82 82 83 83 // XXX ensure this is measured if the analysis succeeds (even if quality is low) 84 if (!psphotEfficiency(config, view, "PSPHOT.INPUT")) {84 if (!psphotEfficiency(config, view, filerule)) { 85 85 psErrorStackPrint(stderr, "Unable to determine detection efficiencies from fake sources"); 86 86 psErrorClear(); … … 88 88 89 89 // drop the references to the image pixels held by each source 90 psphotSourceFreePixels (config, view, "PSPHOT.INPUT");90 psphotSourceFreePixels (config, view, filerule); 91 91 92 92 // create the exported-metadata and free local data 93 return psphotReadoutCleanup (config, view, "PSPHOT.INPUT");93 return psphotReadoutCleanup (config, view, filerule); 94 94 } -
branches/eam_branches/ipp-20101103/psphot/src/psphotReplaceUnfit.c
r28013 r29904 31 31 psAssert (recipe, "missing recipe?"); 32 32 33 int num = psMetadataLookupS32 (&status, config->arguments, "PSPHOT.INPUT.NUM"); 34 psAssert (status, "programming error: must define PSPHOT.INPUT.NUM"); 33 int num = psphotFileruleCount(config, filerule); 35 34 36 35 // loop over the available readouts 37 36 for (int i = 0; i < num; i++) { 38 37 if (!psphotReplaceAllSourcesReadout (config, view, filerule, i, recipe)) { 39 psError (PSPHOT_ERR_CONFIG, false, "failed to replace all sources for PSPHOT.INPUT entry %d", i);38 psError (PSPHOT_ERR_CONFIG, false, "failed to replace all sources for %s entry %d", filerule, i); 40 39 return false; 41 40 } -
branches/eam_branches/ipp-20101103/psphot/src/psphotRoughClass.c
r28425 r29904 16 16 psAssert (recipe, "missing recipe?"); 17 17 18 int num = psMetadataLookupS32 (&status, config->arguments, "PSPHOT.INPUT.NUM"); 19 psAssert (status, "programming error: must define PSPHOT.INPUT.NUM"); 18 int num = psphotFileruleCount(config, filerule); 20 19 21 20 // skip the chisq image (optionally?) -
branches/eam_branches/ipp-20101103/psphot/src/psphotSkyReplace.c
r28013 r29904 5 5 bool status = true; 6 6 7 int num = psMetadataLookupS32 (&status, config->arguments, "PSPHOT.INPUT.NUM"); 8 psAssert (status, "programming error: must define PSPHOT.INPUT.NUM"); 7 int num = psphotFileruleCount(config, filerule); 9 8 10 9 // skip the chisq image (optionally?) -
branches/eam_branches/ipp-20101103/psphot/src/psphotSourceFreePixels.c
r28013 r29904 3 3 bool psphotSourceFreePixels (pmConfig *config, const pmFPAview *view, const char *filerule) 4 4 { 5 bool status = true; 6 7 int num = psMetadataLookupS32 (&status, config->arguments, "PSPHOT.INPUT.NUM"); 8 psAssert (status, "programming error: must define PSPHOT.INPUT.NUM"); 5 int num = psphotFileruleCount(config, filerule); 9 6 10 7 // loop over the available readouts -
branches/eam_branches/ipp-20101103/psphot/src/psphotSourceMatch.c
r29548 r29904 6 6 psArray *psphotMatchSources (pmConfig *config, const pmFPAview *view, const char *filerule) 7 7 { 8 bool status = true;9 10 8 psArray *objects = psArrayAllocEmpty(100); 11 9 12 int num = psMetadataLookupS32 (&status, config->arguments, "PSPHOT.INPUT.NUM"); 13 psAssert (status, "programming error: must define PSPHOT.INPUT.NUM"); 10 int num = psphotFileruleCount(config, filerule); 14 11 15 12 // loop over the available readouts 16 13 for (int i = 0; i < num; i++) { 17 14 if (!psphotMatchSourcesReadout (objects, config, view, filerule, i)) { 18 psError (PSPHOT_ERR_CONFIG, false, "failed to merge sources for PSPHOT.INPUT entry %d", i);15 psError (PSPHOT_ERR_CONFIG, false, "failed to merge sources for %s entry %d", filerule, i); 19 16 psFree (objects); 20 17 return NULL; … … 162 159 psAssert (status, "missing SKY_OUTER_RADIUS in recipe?"); 163 160 164 int nImages = psMetadataLookupS32 (&status, config->arguments, "PSPHOT.INPUT.NUM"); 165 psAssert (status, "programming error: must define PSPHOT.INPUT.NUM"); 161 int nImages = psphotFileruleCount(config, filerule); 166 162 167 163 // generate look-up arrays for detections and readouts -
branches/eam_branches/ipp-20101103/psphot/src/psphotSourceSize.c
r29610 r29904 49 49 psAssert (recipe, "missing recipe?"); 50 50 51 int num = psMetadataLookupS32 (&status, config->arguments, "PSPHOT.INPUT.NUM"); 52 psAssert (status, "programming error: must define PSPHOT.INPUT.NUM"); 51 int num = psphotFileruleCount(config, filerule); 53 52 54 53 // skip the chisq image (optionally?) … … 60 59 if (i == chisqNum) continue; // skip chisq image 61 60 if (!psphotSourceSizeReadout (config, view, filerule, i, recipe, getPSFsize)) { 62 psError (PSPHOT_ERR_CONFIG, false, "failed on source size analysis for PSPHOT.INPUT entry %d", i);61 psError (PSPHOT_ERR_CONFIG, false, "failed on source size analysis for %s entry %d", filerule, i); 63 62 return false; 64 63 } -
branches/eam_branches/ipp-20101103/psphot/src/psphotSourceStats.c
r29604 r29904 14 14 psAssert (recipe, "missing recipe?"); 15 15 16 int num = psMetadataLookupS32 (&status, config->arguments, "PSPHOT.INPUT.NUM"); 17 psAssert (status, "programming error: must define PSPHOT.INPUT.NUM"); 16 int num = psphotFileruleCount(config, filerule); 18 17 19 18 // skip the chisq image (optionally?) -
branches/eam_branches/ipp-20101103/psphot/src/psphotStackChisqImage.c
r28013 r29904 8 8 bool psphotStackChisqImage (pmConfig *config, const pmFPAview *view, const char *ruleDet, const char *ruleCnv) 9 9 { 10 bool status = false;11 12 10 psTimerStart ("psphot.chisq.image"); 13 11 … … 17 15 pmReadout *chiReadout = NULL; 18 16 19 int num = psMetadataLookupS32 (&status, config->arguments, "PSPHOT.INPUT.NUM"); 20 psAssert (status, "programming error: must define PSPHOT.INPUT.NUM"); 17 int num = psphotFileruleCount(config, "PSPHOT.INPUT"); 21 18 22 19 // loop over the available readouts … … 28 25 } 29 26 } 30 31 num = psMetadataLookupS32 (&status, config->arguments, "PSPHOT.INPUT.NUM");32 psAssert (status, "programming error: must define PSPHOT.INPUT.NUM");33 27 34 28 psMetadataAddS32(config->arguments, PS_LIST_TAIL, "PSPHOT.CHISQ.NUM", PS_META_REPLACE, "", num); … … 125 119 psAssert (status, "programming error: must define PSPHOT.CHISQ.NUM"); 126 120 127 int inputNum = psMetadataLookupS32 (&status, config->arguments, "PSPHOT.INPUT.NUM"); 128 psAssert (status, "programming error: must define PSPHOT.INPUT.NUM"); 121 int inputNum = psphotFileruleCount(config, "PSPHOT.INPUT"); 129 122 130 123 pmFPAfileRemoveSingle (config->files, filerule, chisqNum); -
branches/eam_branches/ipp-20101103/psphot/src/psphotStackImageLoop.c
r28013 r29904 105 105 bool GetAstrometryFPA (pmConfig *config, pmFPAview *view) { 106 106 107 bool status = false;108 109 107 bool foundAstrometry = false; 110 108 bool bilevelAstrometry = false; 111 109 112 int num = psMetadataLookupS32 (&status, config->arguments, "PSPHOT.INPUT.NUM"); 113 psAssert (status, "programming error: must define PSPHOT.INPUT.NUM"); 110 int num = psphotFileruleCount(config, "PSPHOT.INPUT"); 114 111 115 112 // loop over the available readouts … … 158 155 bool GetAstrometryChip (pmConfig *config, pmFPAview *view, bool bilevelAstrometry) { 159 156 160 bool status = false; 161 162 int num = psMetadataLookupS32 (&status, config->arguments, "PSPHOT.INPUT.NUM"); 163 psAssert (status, "programming error: must define PSPHOT.INPUT.NUM"); 157 int num = psphotFileruleCount(config, "PSPHOT.INPUT"); 164 158 165 159 // loop over the available readouts … … 220 214 bool SetAstrometryFPA (pmConfig *config, pmFPAview *view, bool bilevelAstrometry) { 221 215 222 bool status = false;223 224 216 if (!bilevelAstrometry) return true; 225 217 226 int num = psMetadataLookupS32 (&status, config->arguments, "PSPHOT.INPUT.NUM"); 227 psAssert (status, "programming error: must define PSPHOT.INPUT.NUM"); 218 int num = psphotFileruleCount(config, "PSPHOT.INPUT"); 228 219 229 220 // loop over the available readouts -
branches/eam_branches/ipp-20101103/psphot/src/psphotStackMatchPSFs.c
r29548 r29904 8 8 psAssert(recipe, "We've thrown an error on this before."); 9 9 10 int num = psMetadataLookupS32 (&status, config->arguments, "PSPHOT.INPUT.NUM"); 11 psAssert (status, "programming error: must define PSPHOT.INPUT.NUM"); 10 int num = psphotFileruleCount(config, "PSPHOT.INPUT"); 12 11 13 12 // 'options' carries info needed to perform the stack matching -
branches/eam_branches/ipp-20101103/psphot/src/psphotStackReadout.c
r29548 r29904 52 52 // load the psf model, if suppled. FWHM_X,FWHM_Y,etc are determined and saved on 53 53 // readout->analysis XXX this function currently only works with a single PSPHOT.INPUT 54 if (!psphotLoadPSF (config, view )) {54 if (!psphotLoadPSF (config, view, STACK_RAW)) { 55 55 psError (PSPHOT_ERR_UNKNOWN, false, "error loading psf model"); 56 56 return psphotReadoutCleanup (config, view, STACK_OUT); -
branches/eam_branches/ipp-20101103/psphot/src/psphotSubtractBackground.c
r28013 r29904 132 132 psAssert (recipe, "missing recipe?"); 133 133 134 int num = psMetadataLookupS32 (&status, config->arguments, "PSPHOT.INPUT.NUM"); 135 psAssert (status, "programming error: must define PSPHOT.INPUT.NUM"); 134 int num = psphotFileruleCount(config, filerule); 136 135 137 136 // loop over the available readouts 138 137 for (int i = 0; i < num; i++) { 139 138 if (!psphotSubtractBackgroundReadout (config, view, filerule, i, recipe)) { 140 psError (PSPHOT_ERR_CONFIG, false, "failed to subtract background for PSPHOT.INPUT entry %d", i);139 psError (PSPHOT_ERR_CONFIG, false, "failed to subtract background for %s entry %d", filerule, i); 141 140 return false; 142 141 }
Note:
See TracChangeset
for help on using the changeset viewer.
