Changeset 23719 for branches/pap/ppSub/src/ppSubMakePSF.c
- Timestamp:
- Apr 6, 2009, 6:52:51 PM (17 years ago)
- Location:
- branches/pap/ppSub/src
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
ppSubMakePSF.c (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/pap/ppSub/src
- Property svn:ignore
-
old new 10 10 stamp-h1 11 11 ppSubKernel 12 ppSubErrorCodes.h 13 ppSubErrorCodes.c
-
- Property svn:ignore
-
branches/pap/ppSub/src/ppSubMakePSF.c
r23688 r23719 22 22 #include "ppSub.h" 23 23 24 bool ppSubMakePSF(pmConfig *config, ppSubData *data , const pmFPAview *view)24 bool ppSubMakePSF(pmConfig *config, ppSubData *data) 25 25 { 26 26 psAssert(config, "Require configuration"); 27 psAssert(view, "Require view"); 27 28 if (!data->photometry) { 29 return true; 30 } 28 31 29 32 psTimerStart("PPSUB_PHOT"); … … 44 47 pmReadout *minuend = NULL; // Image that will be positive following subtraction 45 48 pmFPAfile *minuendFile = NULL; // File for minuend image 49 pmFPAview *view = ppSubViewReadout(); // View to readout 46 50 if (reverse) { 47 51 minuend = pmFPAfileThisReadout(config->files, view, "PPSUB.REF.CONV"); … … 53 57 54 58 #if 1 59 pmFPAfile *photFile = psMetadataLookupPtr(&mdok, config->files, "PSPHOT.INPUT"); // Photometry file 60 #if 0 61 pmReadout *photRO = pmFPAviewThisReadout(view, photFile->fpa); // Readout to photometer 55 62 pmReadout *template = minuend; 56 pmFPAfile *photFile = psMetadataLookupPtr(&mdok, config->files, "PSPHOT.INPUT"); // Photometry file57 pmReadout *photRO = pmFPAviewThisReadout(view, photFile->fpa); // Readout to photometer58 63 if (!photRO) { 59 64 pmCell *cell = pmFPAviewThisCell(view, photFile->fpa); // Cell to photometer … … 74 79 } 75 80 #else 81 if (!pmFPACopy(photFile->fpa, minuendFile->fpa)) { 82 psError(PS_ERR_UNKNOWN, false, "Unable to copy FPA for photometry"); 83 psFree(view); 84 return false; 85 } 86 pmReadout *photRO = pmFPAviewThisReadout(view, photFile->fpa); // Readout to photometer 87 if (psMetadataLookup(photRO->analysis, "PSPHOT.SOURCES")) { 88 psMetadataRemoveKey(photRO->analysis, "PSPHOT.SOURCES"); 89 } 90 #endif 91 92 93 #else 76 94 // Supply the minuend pmFPAfile to psphot as PSPHOT.INPUT: 77 95 psMetadataAddPtr(config->files, PS_LIST_TAIL, "PSPHOT.INPUT", PS_DATA_UNKNOWN | PS_META_REPLACE, … … 87 105 psErrorStackPrint(stderr, "Unable to determine PSF"); 88 106 psWarning("Unable to determine PSF --- suspect bad data quality."); 89 ppSubDataQuality(config, data, PSPHOT_ERR_PSF, PPSUB_FILES_PHOT); 107 ppSubDataQuality(config, data, PSPHOT_ERR_PSF, PPSUB_FILES_PHOT_SUB | PPSUB_FILES_PHOT_INV); 108 psFree(view); 90 109 return true; 91 110 } … … 93 112 // Record the FWHM in the output header 94 113 pmReadout *outRO = pmFPAfileThisReadout(config->files, view, "PPSUB.OUTPUT"); // Output readout 114 psFree(view); 95 115 pmHDU *hdu = pmHDUFromCell(outRO->parent); // HDU with header 96 116 psMetadataItemSupplement(hdu->header, psphotRecipe, "FWHM_MAJ"); … … 100 120 psMetadataRemoveKey(photRO->analysis, "PSPHOT.HEADER"); 101 121 122 data->psf = psMemIncrRefCounter(psMetadataLookupPtr(NULL, photRO->parent->parent->analysis, 123 "PSPHOT.PSF")); 124 102 125 return true; 103 126 }
Note:
See TracChangeset
for help on using the changeset viewer.
