Changeset 13837
- Timestamp:
- Jun 14, 2007, 2:47:06 PM (19 years ago)
- File:
-
- 1 edited
-
trunk/ppImage/src/ppImageLoop.c (modified) (15 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ppImage/src/ppImageLoop.c
r13830 r13837 42 42 // files associated with the science image 43 43 if (!pmFPAfileIOChecks(config, view, PM_FPA_BEFORE)) { 44 psFree (view); 44 45 return false; 45 46 } … … 52 53 53 54 if (!pmFPAfileIOChecks(config, view, PM_FPA_BEFORE)) { 55 psFree (view); 54 56 return false; 55 57 } … … 61 63 } 62 64 if (!pmFPAfileIOChecks(config, view, PM_FPA_BEFORE)) { 65 psFree (view); 63 66 return false; 64 67 } … … 75 78 while ((readout = pmFPAviewNextReadout (view, input->fpa, 1)) != NULL) { 76 79 if (!pmFPAfileIOChecks(config, view, PM_FPA_BEFORE)) { 80 psFree (view); 77 81 return false; 78 82 } … … 84 88 if (!ppImageDetrendReadout(config, options, view)) { 85 89 psError(PS_ERR_UNKNOWN, false, "Unable to detrend readout.\n"); 90 psFree (view); 86 91 return false; 87 92 } … … 94 99 pmChip *fringe = pmFPAfileThisChip(config->files, view, "PPIMAGE.FRINGE"); 95 100 if (!ppImageDetrendFringeSolve(chip, fringe, options)) { 101 psFree (view); 96 102 return false; 97 103 } … … 110 116 pmCell *fringeCell = pmFPAfileThisCell(config->files, view, "PPIMAGE.FRINGE"); 111 117 if (!ppImageDetrendFringeGenerate(cell, fringeCell)) { 118 psFree (view); 112 119 return false; 113 120 } … … 120 127 if (!mdok || !output) { 121 128 psError(PS_ERR_UNEXPECTED_NULL, true, "Unable to find file PPIMAGE.OUTPUT.\n"); 129 psFree (view); 122 130 return false; 123 131 } 124 132 125 133 if (!ppStats(stats, 126 output->fpa,127 view,128 options->satMask | options->badMask | options->maskValue,129 config)) {134 output->fpa, 135 view, 136 options->satMask | options->badMask | options->maskValue, 137 config)) { 130 138 psError(PS_ERR_UNEXPECTED_NULL, true, "Unable to generate stats for image.\n"); 131 139 psFree (stats); 140 psFree (view); 132 141 return false; 133 142 } … … 151 160 psFree(headerName); 152 161 } 153 154 #if 0155 if (!pmFPAfileIOChecks(config, view, PM_FPA_AFTER)) {156 return false;157 }158 #endif159 160 162 } 161 163 162 164 if (!ppImageMosaicChip(config, view, "PPIMAGE.OUTPUT.CHIP", "PPIMAGE.OUTPUT")) { 163 165 psError(PS_ERR_UNKNOWN, false, "Unable to mosaic chip.\n"); 166 psFree (view); 164 167 return false; 165 168 } 166 169 if (!ppImageRebinChip(config, view, "PPIMAGE.BIN1")) { 167 170 psError(PS_ERR_UNKNOWN, false, "Unable to bin chip.\n"); 171 psFree (view); 168 172 return false; 169 173 } 170 174 if (!ppImageRebinChip(config, view, "PPIMAGE.BIN2")) { 171 175 psError(PS_ERR_UNKNOWN, false, "Unable to bin chip.\n"); 176 psFree (view); 172 177 return false; 173 178 } … … 175 180 // we perform photometry on the readouts of this chip in the output 176 181 if (options->doPhotom) { 177 ppImagePhotom(config, view); 182 if (!ppImagePhotom(config, view)) { 183 psError(PS_ERR_UNKNOWN, false, "error running photometry.\n"); 184 psFree (view); 185 return false; 186 } 178 187 } 179 188 … … 186 195 187 196 if (!pmFPAfileIOChecks(config, view, PM_FPA_AFTER)) { 197 psFree(view); 188 198 return false; 189 199 } … … 192 202 // Close chip 193 203 if (!pmFPAfileIOChecks(config, view, PM_FPA_AFTER)) { 204 psFree(view); 194 205 return false; 195 206 } … … 198 209 // Write out summary statistics 199 210 if (stats) { 200 c onst char *statsMDC = psMetadataConfigFormat(stats);211 char *statsMDC = psMetadataConfigFormat(stats); 201 212 if (!statsMDC || strlen(statsMDC) == 0) { 202 213 psError(PS_ERR_IO, false, "Unable to get statistics MDC file.\n"); … … 204 215 fprintf(statsFile, "%s", statsMDC); 205 216 } 206 psFree( (void *)statsMDC);217 psFree(statsMDC); 207 218 fclose(statsFile); 208 219 psFree(stats); … … 217 228 // we perform astrometry on all chips after sources have been detected 218 229 if (options->doAstromChip || options->doAstromMosaic) { 219 ppImageAstrom(config); 220 } 221 // XXX should we keep the addstar command as an option, or just run it externally? 222 // XXX if we included direct Ohana/DVO API calls, we could send the data from within ppImage. 223 # if (0) 224 if (options->doAddstar) { 225 ppImageAddstar(config); 226 } 227 # endif 228 230 if (!ppImageAstrom(config)) { 231 psError(PS_ERR_UNKNOWN, false, "error running astrometry.\n"); 232 psFree(view); 233 return false; 234 } 235 } 236 237 // Close FPA 229 238 if (!pmFPAfileIOChecks(config, view, PM_FPA_AFTER)) { 239 psFree(view); 230 240 return false; 231 241 } 232 242 233 243 psFree(view); 234 235 244 return true; 236 245 }
Note:
See TracChangeset
for help on using the changeset viewer.
