Changeset 31441
- Timestamp:
- May 5, 2011, 10:08:44 AM (15 years ago)
- Location:
- branches/eam_branches/ipp-20110404/ppSub/src
- Files:
-
- 6 edited
-
ppSubDefineOutput.c (modified) (3 diffs)
-
ppSubLoop.c (modified) (6 diffs)
-
ppSubMakePSF.c (modified) (1 diff)
-
ppSubReadoutPhotometry.c (modified) (1 diff)
-
ppSubReadoutSubtract.c (modified) (2 diffs)
-
ppSubThreshold.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20110404/ppSub/src/ppSubDefineOutput.c
r31156 r31441 44 44 45 45 // Convolved input images 46 pmReadout *inConv = pmFPAfileThisReadout(config->files, view, "PPSUB.INPUT.CONV"); // Input readout 47 pmReadout *refConv = pmFPAfileThisReadout(config->files, view, "PPSUB.REF.CONV"); // Reference readout 46 psMetadata *recipe = psMetadataLookupPtr(NULL, config->recipes, PPSUB_RECIPE); 47 bool noConvolve = psMetadataLookupBool(NULL, recipe, "NOCONVOLVE"); // Do not use convolved images. 48 49 pmReadout *inConv; 50 if (noConvolve) { 51 inConv = pmFPAfileThisReadout(config->files, view, "PPSUB.INPUT"); // Input readout 52 } 53 else { 54 inConv = pmFPAfileThisReadout(config->files, view, "PPSUB.INPUT.CONV"); // Input readout 55 } 56 pmReadout *refConv; 57 if (noConvolve) { 58 refConv = pmFPAfileThisReadout(config->files, view, "PPSUB.REF"); // Reference readout 59 } 60 else { 61 refConv = pmFPAfileThisReadout(config->files, view, "PPSUB.REF.CONV"); // Reference readout 62 } 48 63 psFree(view); 49 64 … … 60 75 kernels = psMetadataLookupPtr(&mdok, analysis, PM_SUBTRACTION_ANALYSIS_KERNEL); 61 76 } 62 if (!kernels ) {77 if (!kernels && !noConvolve) { 63 78 psError(PPSUB_ERR_UNKNOWN, true, "Unable to find SUBTRACTION.KERNEL"); 64 79 psFree(outRO); … … 66 81 } 67 82 psAssert (hdu, "unable to find HDU"); 68 psMetadataAddStr(outHDU->header, PS_LIST_TAIL, "PPSUB.KERNEL", 0, "Subtraction kernel", kernels->description); 83 if (!noConvolve) { 84 psMetadataAddStr(outHDU->header, PS_LIST_TAIL, "PPSUB.KERNEL", 0, "Subtraction kernel", kernels->description); 85 } 69 86 outHDU->header = psMetadataCopy(outHDU->header, hdu->header); 70 87 -
branches/eam_branches/ipp-20110404/ppSub/src/ppSubLoop.c
r30619 r31441 107 107 108 108 // XXX if it exists, use the POS1, POS2 successs for the FWHMs 109 if (!ppSubMatchPSFs(data)) { 109 psMetadata *recipe = psMetadataLookupPtr(NULL, config->recipes, PPSUB_RECIPE); 110 bool noConvolve = psMetadataLookupBool(NULL, recipe, "NOCONVOLVE"); // Do not use convolved images. 111 if (noConvolve) { 112 psWarning("not matching PSFs because NOCONVOLVE is TRUE\n"); 113 } else { 114 if (!ppSubMatchPSFs(data)) { 110 115 psError(psErrorCodeLast(), false, "Unable to match PSFs."); 111 116 success = false; 112 117 goto ESCAPE; 113 } 118 } 119 } 120 114 121 115 122 if (data->quality) { … … 132 139 133 140 // Close input files 141 if (!noConvolve) { 134 142 if (!ppSubFilesIterateUp(config, PPSUB_FILES_INPUT)) { 135 143 psError(PPSUB_ERR_IO, false, "Unable to close input files."); … … 137 145 goto ESCAPE; 138 146 } 139 147 } 140 148 if (!ppSubLowThreshold(data)) { 141 149 psError(psErrorCodeLast(), false, "Unable to threshold images."); … … 157 165 } 158 166 167 if (!noConvolve) { 159 168 if (!data->quality && !ppSubMakePSF(data)) { 160 169 psError(psErrorCodeLast(), false, "Unable to generate PSF."); … … 162 171 goto ESCAPE; 163 172 } 164 173 } 165 174 // Now we've got a PSF, blow away detections in case they're confused with real output detections 166 175 { … … 187 196 } 188 197 // dumpout(config, "diff.2a.fits"); 189 198 if (noConvolve) { 199 if (!ppSubFilesIterateUp(config, PPSUB_FILES_INPUT)) { 200 psError(PPSUB_ERR_IO, false, "Unable to close input files."); 201 success = false; 202 goto ESCAPE; 203 } 204 } 205 190 206 // Higher order background subtraction using psphot 191 207 if (!ppSubBackground(config)) { -
branches/eam_branches/ipp-20110404/ppSub/src/ppSubMakePSF.c
r31156 r31441 37 37 38 38 bool reverse = psMetadataLookupBool(NULL, config->arguments, "REVERSE"); // Reverse sense of subtraction? 39 39 40 40 bool mdok = false; // Status of MD lookup 41 41 pmReadout *minuend = NULL; // Image that will be positive following subtraction 42 42 pmFPAfile *minuendFile = NULL; // File for minuend image 43 43 pmFPAview *view = ppSubViewReadout(); // View to readout 44 if (reverse) { 44 45 psMetadata *recipe = psMetadataLookupMetadata(&mdok, config->recipes, PPSUB_RECIPE); // Recipe for ppSub 46 bool noConvolve = psMetadataLookupBool(&mdok, recipe, "NOCONVOLVE"); // Do not use convolved images. 47 48 if (!noConvolve) { 49 printf("Using Convolved images because NOCONVOLVE is FALSE\n"); 50 if (reverse) { 45 51 minuend = pmFPAfileThisReadout(config->files, view, "PPSUB.REF.CONV"); 46 minuendFile = psMetadataLookupPtr(&mdok, config->files, "PPSUB.REF.CONV");47 } else {52 minuendFile = psMetadataLookupPtr(&mdok, config->files, "PPSUB.REF.CONV"); 53 } else { 48 54 minuend = pmFPAfileThisReadout(config->files, view, "PPSUB.INPUT.CONV"); 49 minuendFile = psMetadataLookupPtr(&mdok, config->files, "PPSUB.INPUT.CONV"); 55 minuendFile = psMetadataLookupPtr(&mdok, config->files, "PPSUB.INPUT.CONV"); 56 } 57 } 58 else { 59 psWarning("Not using Convolved images because NOCONVOLVE is TRUE\n"); 60 if (reverse) { 61 minuend = pmFPAfileThisReadout(config->files, view, "PPSUB.REF"); 62 minuendFile = psMetadataLookupPtr(&mdok, config->files, "PPSUB.REF"); 63 } else { 64 minuend = pmFPAfileThisReadout(config->files, view, "PPSUB.INPUT"); 65 minuendFile = psMetadataLookupPtr(&mdok, config->files, "PPSUB.INPUT"); 66 } 50 67 } 51 68 -
branches/eam_branches/ipp-20110404/ppSub/src/ppSubReadoutPhotometry.c
r31363 r31441 60 60 // grab the PSF information from the pmFPAfile PSPHOT.PSF.LOAD 61 61 pmFPAfile *psfFile = psMetadataLookupPtr(&mdok, config->files, "PSPHOT.PSF.LOAD"); // PSF file 62 62 63 ppSubCopyPSF (photFile, psfFile, view); 63 64 -
branches/eam_branches/ipp-20110404/ppSub/src/ppSubReadoutSubtract.c
r30619 r31441 31 31 32 32 bool reverse = psMetadataLookupBool(&mdok, config->arguments, "REVERSE"); // Reverse sense of subtraction? 33 bool noConvolve = psMetadataLookupBool(&mdok, recipe, "NOCONVOLVE"); // Do not use convolved images. 33 34 bool addPair = psMetadataLookupBool(&mdok, recipe, "ADD.NOT.SUBTRACT"); // add instead of subtracting 34 35 … … 38 39 pmReadout *minuend = NULL; // Positive image 39 40 pmReadout *subtrahend = NULL; // Negative image 40 if (reverse) { 41 if (!noConvolve) { 42 printf("Using Convolved images because NOCONVOLVE is FALSE\n"); 43 if (reverse) { 41 44 minuend = pmFPAfileThisReadout(config->files, view, "PPSUB.REF.CONV"); 42 45 subtrahend = pmFPAfileThisReadout(config->files, view, "PPSUB.INPUT.CONV"); 43 } else {46 } else { 44 47 minuend = pmFPAfileThisReadout(config->files, view, "PPSUB.INPUT.CONV"); 45 48 subtrahend = pmFPAfileThisReadout(config->files, view, "PPSUB.REF.CONV"); 49 } 50 } 51 else { 52 psWarning("Not using Convolved images because NOCONVOLVE is TRUE\n"); 53 if (reverse) { 54 minuend = pmFPAfileThisReadout(config->files, view, "PPSUB.REF"); 55 subtrahend = pmFPAfileThisReadout(config->files, view, "PPSUB.INPUT"); 56 } else { 57 minuend = pmFPAfileThisReadout(config->files, view, "PPSUB.INPUT"); 58 subtrahend = pmFPAfileThisReadout(config->files, view, "PPSUB.REF"); 59 } 46 60 } 47 61 -
branches/eam_branches/ipp-20110404/ppSub/src/ppSubThreshold.c
r30619 r31441 95 95 96 96 // Input images 97 pmReadout *in = pmFPAfileThisReadout(config->files, view, "PPSUB.INPUT.CONV"); // Input image 97 bool noConvolve = psMetadataLookupBool(NULL, recipe, "NOCONVOLVE"); 98 99 pmReadout *in; 100 if (noConvolve) { 101 in = pmFPAfileThisReadout(config->files, view, "PPSUB.INPUT"); // Input image 102 } 103 else { 104 in = pmFPAfileThisReadout(config->files, view, "PPSUB.INPUT.CONV"); // Input image 105 } 98 106 if (!in) { 99 107 psError(PPSUB_ERR_UNKNOWN, false, "Unable to find readout."); … … 102 110 } 103 111 104 pmReadout *ref = pmFPAfileThisReadout(config->files, view, "PPSUB.REF.CONV"); // Reference image 112 pmReadout *ref; 113 if (noConvolve) { 114 ref = pmFPAfileThisReadout(config->files, view, "PPSUB.REF"); // Reference image 115 } 116 else { 117 ref = pmFPAfileThisReadout(config->files, view, "PPSUB.REF.CONV"); // Reference image 118 } 105 119 if (!ref) { 106 120 psError(PPSUB_ERR_UNKNOWN, false, "Unable to find readout.");
Note:
See TracChangeset
for help on using the changeset viewer.
