Changeset 34266
- Timestamp:
- Jul 31, 2012, 6:17:31 PM (14 years ago)
- Location:
- trunk/psphot/src
- Files:
-
- 3 edited
-
psphot.h (modified) (1 diff)
-
psphotMergeSources.c (modified) (1 diff)
-
psphotStackReadout.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psphot/src/psphot.h
r34258 r34266 436 436 bool psphotCopySources (pmConfig *config, const pmFPAview *view, const char *ruleOut, const char *ruleSrc); 437 437 bool psphotCopySourcesReadout (pmConfig *config, const pmFPAview *view, const char *ruleOut, const char *ruleSrc, int index); 438 bool psphotCopyEfficiency (pmConfig *config, const pmFPAview *view, const char *ruleOut, const char *ruleSrc); 439 bool psphotCopyEfficiencyReadout (pmConfig *config, const pmFPAview *view, const char *ruleOut, const char *ruleSrc, int index); 438 440 439 441 bool psphotRadialApertures (pmConfig *config, const pmFPAview *view, const char *filerule, int entry); -
trunk/psphot/src/psphotMergeSources.c
r33910 r34266 939 939 } 940 940 941 bool psphotCopyEfficiency (pmConfig *config, const pmFPAview *view, const char *ruleOut, const char *ruleSrc) 942 { 943 bool status = true; 944 945 int num = psphotFileruleCount(config, ruleSrc); 946 947 // skip the chisq image because it is a duplicate of the detection version 948 int chisqNum = psMetadataLookupS32 (&status, config->arguments, "PSPHOT.CHISQ.NUM"); 949 if (!status) chisqNum = -1; 950 951 // loop over the available readouts 952 for (int i = 0; i < num; i++) { 953 if (i == chisqNum) continue; // skip chisq image 954 if (!psphotCopyEfficiencyReadout (config, view, ruleOut, ruleSrc, i)) { 955 psError (PSPHOT_ERR_CONFIG, false, "failed to copy detection efficiency from %s to %s entry %d", ruleSrc, ruleOut, i); 956 return false; 957 } 958 } 959 return true; 960 } 961 962 // add newly selected sources to the existing list of sources 963 bool psphotCopyEfficiencyReadout (pmConfig *config, const pmFPAview *view, const char *ruleOut, const char *ruleSrc, int index) { 964 965 bool status; 966 967 // find the currently selected readout 968 pmFPAfile *fileSrc = pmFPAfileSelectSingle(config->files, ruleSrc, index); // File of interest 969 psAssert (fileSrc, "missing file?"); 970 971 pmReadout *readoutSrc = pmFPAviewThisReadout(view, fileSrc->fpa); 972 psAssert (readoutSrc, "missing readout?"); 973 974 // find the currently selected readout 975 pmFPAfile *fileOut = pmFPAfileSelectSingle(config->files, ruleOut, index); // File of interest 976 psAssert (fileOut, "missing file?"); 977 978 pmReadout *readoutOut = pmFPAviewThisReadout(view, fileOut->fpa); 979 psAssert (readoutOut, "missing readout?"); 980 981 pmDetEff *de = psMetadataLookupPtr(&status, readoutSrc->analysis, PM_DETEFF_ANALYSIS); // Detection efficiency 982 if (!status || !de) { 983 // nothing there 984 return true; 985 } 986 987 // save DetEff on the readoutOut->analysis 988 if (!psMetadataAddPtr (readoutOut->analysis, PS_LIST_TAIL, PM_DETEFF_ANALYSIS, PS_META_REPLACE | PS_DATA_UNKNOWN, "Detection efficiency", de)) { 989 psError (PSPHOT_ERR_CONFIG, false, "problem saving Detection efficiency on readout"); 990 return false; 991 } 992 993 return true; 994 } -
trunk/psphot/src/psphotStackReadout.c
r34226 r34266 416 416 psphotMagnitudes(config, view, STACK_SRC); 417 417 418 // XXX NOTE: this function wants to have the PSF of the image, but we (so far) only measure the 419 // PSF of the SRC image. can we fake it by generating the PSF for DET as well (up above)? 420 if (false && !psphotEfficiency(config, view, STACK_DET)) { 418 if (!useRaw) { 419 // psphotEfficiency wants to have the PSF of the image, but since we are measuring on 420 // the convolved images we need to generate PSFs for the DET images 421 if (!psphotChoosePSF (config, view, STACK_DET, false)) { // pass 1 422 psLogMsg ("psphot", 3, "failure to construct a psf model for raw input"); 423 return psphotReadoutCleanup (config, view, STACK_DET); 424 } 425 } 426 if (!psphotEfficiency(config, view, STACK_DET)) { 421 427 psErrorStackPrint(stderr, "Unable to determine detection efficiencies from fake sources"); 422 428 psErrorClear(); 423 429 } 430 psphotCopyEfficiency (config, view, STACK_OUT, STACK_DET); 424 431 425 432 // replace failed sources?
Note:
See TracChangeset
for help on using the changeset viewer.
