Changeset 23711 for branches/pap/ppSub/src/ppSubLoop.c
- Timestamp:
- Apr 3, 2009, 6:25:39 PM (17 years ago)
- File:
-
- 1 edited
-
branches/pap/ppSub/src/ppSubLoop.c (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/pap/ppSub/src/ppSubLoop.c
r23704 r23711 55 55 } 56 56 57 psMetadataAddF32(data->stats, PS_LIST_TAIL, "TIME_MATCH", 0, "Time to match PSFs", 58 psTimerClear("PPSUB_MATCH")); 59 57 60 // Close input files 58 61 if (!ppSubFilesIterateUp(config, PPSUB_FILES_INPUT)) { … … 72 75 } 73 76 74 if ( data->inverse && !ppSubDefineOutput("PPSUB.OUTINV", config, data, view)) {75 psError(PS_ERR_UNKNOWN, false, "Unable to define inverse.");77 if (!data->quality && !ppSubMakePSF("PPSUB.OUTPUT", "PPSUB.INVERSE", config, data, view)) { 78 psError(PS_ERR_UNKNOWN, false, "Unable to generate PSF."); 76 79 return false; 77 80 } 78 81 79 if (! data->quality && !ppSubMakePSF("PPSUB.OUTPUT", "PPSUB.OUTINV", config, data, view)) {80 psError(PS_ERR_UNKNOWN, false, "Unable to generate PSF.");82 if (!ppSubReadoutSubtract("PPSUB.OUTPUT", config, view)) { 83 psError(PS_ERR_UNKNOWN, false, "Unable to subtract images."); 81 84 return false; 82 85 } … … 88 91 } 89 92 90 if (!ppSubReadoutSubtract("PPSUB.OUTPUT", config, view)) {91 psError(PS_ERR_UNKNOWN, false, "Unable to subtract images.");92 return false;93 }94 95 93 // Higher order background subtraction using psphot 96 if (!ppSubBackground( "PPSUB.OUTPUT",config, view)) {94 if (!ppSubBackground(config, view)) { 97 95 psError(PS_ERR_UNKNOWN, false, "Unable to subtract background."); 98 96 return false; 99 97 } 100 98 101 if (!data->quality && data->!ppSubReadoutPhotometry("PPSUB.OUTPUT", config, data, view)) {99 if (!data->quality && ppSubReadoutPhotometry("PPSUB.OUTPUT", PPSUB_FILES_PHOT_SUB, config, data, view)) { 102 100 psError(PS_ERR_UNKNOWN, false, "Unable to perform photometry."); 103 101 return false; 104 102 } 105 103 106 if (!ppSubReadoutUpdate("PPSUB.OUTPUT", config, data, view)) { 107 psError(PS_ERR_UNKNOWN, false, "Unable to update."); 104 // Perform statistics on the cell 105 if (!ppSubReadoutStats(config, data, view)) { 106 psError(PS_ERR_UNKNOWN, false, "Unable to collect statistics"); 108 107 return false; 109 108 } 110 109 111 // Perform statistics on the cell 112 if (statsFile) { 113 pmFPAfile *output = psMetadataLookupPtr(NULL, config->files, "PPSUB.OUTPUT"); // Output file 114 if (!output) { 115 psError(PS_ERR_UNEXPECTED_NULL, true, "Unable to find file PPSUB.OUTPUT.\n"); 116 goto ERROR; 117 } 118 psImageMaskType maskValue = pmConfigMaskGet("MASK.VALUE", config); 119 ppStatsFPA(data->stats, output->fpa, view, maskValue, config); 110 if (!ppSubReadoutJpeg("PPSUB.OUTPUT", config, data, view)) { 111 psError(PS_ERR_UNKNOWN, false, "Unable to update."); 112 return false; 120 113 } 121 114 … … 127 120 } 128 121 129 if (!ppSubReadoutInverse("PPSUB.OUTINV", "PPSUB.OUTPUT", config, view)) { 122 if (data->inverse && !ppSubDefineOutput("PPSUB.INVERSE", config, data, view)) { 123 psError(PS_ERR_UNKNOWN, false, "Unable to define inverse."); 124 return false; 125 } 126 127 if (!ppSubReadoutInverse("PPSUB.INVERSE", "PPSUB.OUTPUT", config, view)) { 130 128 psError(PS_ERR_UNKNOWN, false, "Unable to invert images."); 131 129 return false; … … 138 136 } 139 137 140 if (!data->quality && data->!ppSubReadoutPhotometry("PPSUB.OUTINV", config, data, view)) { 141 psError(PS_ERR_UNKNOWN, false, "Unable to perform photometry."); 142 return false; 138 if (!data->quality && data->!ppSubReadoutPhotometry("PPSUB.INVERSE", PPSUB_FILES_PHOT_INV, 139 config, data, view)) { 140 psError(PS_ERR_UNKNOWN, false, "Unable to perform photometry."); 141 return false; 142 } 143 144 // Close inverse subtraction files 145 if (!ppSubFilesIterateUp(config, PPSUB_FILES_INV)) { 146 psError(PPSUB_ERR_IO, false, "Unable to close subtraction files."); 147 return false; 143 148 } 144 149 } else { … … 149 154 } 150 155 } 151 152 153 if (!ppSubReadoutUpdate("PPSUB.OUTPUT", config, data, view)) {154 psError(PS_ERR_UNKNOWN, false, "Unable to update.");155 return false;156 }157 158 156 159 157 psFree(view);
Note:
See TracChangeset
for help on using the changeset viewer.
