Changeset 13901 for trunk/ppImage/src/ppImageLoop.c
- Timestamp:
- Jun 19, 2007, 4:49:08 PM (19 years ago)
- File:
-
- 1 edited
-
trunk/ppImage/src/ppImageLoop.c (modified) (15 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ppImage/src/ppImageLoop.c
r13837 r13901 27 27 return false; 28 28 } 29 stats = psMetadataAlloc();29 stats = psMetadataAlloc(); 30 30 psFree(resolved); 31 31 } … … 34 34 if (!status) { 35 35 psErrorStackPrint(stderr, "Can't find input data!\n"); 36 exit(EXIT_FAILURE); 36 ppImageCleanup(config, options); 37 exit(PS_EXIT_PROG_ERROR); 37 38 } 38 39 … … 42 43 // files associated with the science image 43 44 if (!pmFPAfileIOChecks(config, view, PM_FPA_BEFORE)) { 44 psFree (view);45 psFree (view); 45 46 return false; 46 47 } … … 53 54 54 55 if (!pmFPAfileIOChecks(config, view, PM_FPA_BEFORE)) { 55 psFree (view);56 psFree (view); 56 57 return false; 57 58 } … … 63 64 } 64 65 if (!pmFPAfileIOChecks(config, view, PM_FPA_BEFORE)) { 65 psFree (view);66 psFree (view); 66 67 return false; 67 68 } … … 78 79 while ((readout = pmFPAviewNextReadout (view, input->fpa, 1)) != NULL) { 79 80 if (!pmFPAfileIOChecks(config, view, PM_FPA_BEFORE)) { 80 psFree (view);81 psFree (view); 81 82 return false; 82 83 } … … 88 89 if (!ppImageDetrendReadout(config, options, view)) { 89 90 psError(PS_ERR_UNKNOWN, false, "Unable to detrend readout.\n"); 90 psFree (view);91 psFree (view); 91 92 return false; 92 93 } … … 99 100 pmChip *fringe = pmFPAfileThisChip(config->files, view, "PPIMAGE.FRINGE"); 100 101 if (!ppImageDetrendFringeSolve(chip, fringe, options)) { 101 psFree (view);102 psFree (view); 102 103 return false; 103 104 } … … 116 117 pmCell *fringeCell = pmFPAfileThisCell(config->files, view, "PPIMAGE.FRINGE"); 117 118 if (!ppImageDetrendFringeGenerate(cell, fringeCell)) { 118 psFree (view);119 psFree (view); 119 120 return false; 120 121 } … … 127 128 if (!mdok || !output) { 128 129 psError(PS_ERR_UNEXPECTED_NULL, true, "Unable to find file PPIMAGE.OUTPUT.\n"); 129 psFree (view);130 return false; 131 } 132 133 if (!ppStats(stats, 134 output->fpa, 135 view,136 options->satMask | options->badMask | options->maskValue,137 config)) {130 psFree (view); 131 return false; 132 } 133 134 if (!ppStats(stats, 135 output->fpa, 136 view, 137 options->satMask | options->badMask | options->maskValue, 138 config)) { 138 139 psError(PS_ERR_UNEXPECTED_NULL, true, "Unable to generate stats for image.\n"); 139 psFree (stats);140 psFree (view);141 return false; 142 } 143 } 144 140 psFree (stats); 141 psFree (view); 142 return false; 143 } 144 } 145 145 146 // Add MD5 information for cell 146 147 pmHDU *hdu = pmHDUFromCell(cell); // HDU that owns the cell … … 162 163 } 163 164 164 if (!ppImageMosaicChip(config, view, "PPIMAGE.OUTPUT.CHIP", "PPIMAGE.OUTPUT")) {165 if (!ppImageMosaicChip(config, options, view, "PPIMAGE.CHIP", "PPIMAGE.OUTPUT")) { 165 166 psError(PS_ERR_UNKNOWN, false, "Unable to mosaic chip.\n"); 166 psFree (view);167 psFree (view); 167 168 return false; 168 169 } 169 170 if (!ppImageRebinChip(config, view, "PPIMAGE.BIN1")) { 170 171 psError(PS_ERR_UNKNOWN, false, "Unable to bin chip.\n"); 171 psFree (view);172 psFree (view); 172 173 return false; 173 174 } 174 175 if (!ppImageRebinChip(config, view, "PPIMAGE.BIN2")) { 175 176 psError(PS_ERR_UNKNOWN, false, "Unable to bin chip.\n"); 176 psFree (view);177 psFree (view); 177 178 return false; 178 179 } … … 181 182 if (options->doPhotom) { 182 183 if (!ppImagePhotom(config, view)) { 183 psError(PS_ERR_UNKNOWN, false, "error running photometry.\n");184 psFree (view);185 return false;186 }184 psError(PS_ERR_UNKNOWN, false, "error running photometry.\n"); 185 psFree (view); 186 return false; 187 } 187 188 } 188 189 … … 195 196 196 197 if (!pmFPAfileIOChecks(config, view, PM_FPA_AFTER)) { 197 psFree(view);198 psFree(view); 198 199 return false; 199 200 } … … 202 203 // Close chip 203 204 if (!pmFPAfileIOChecks(config, view, PM_FPA_AFTER)) { 204 psFree(view);205 psFree(view); 205 206 return false; 206 207 } … … 221 222 222 223 // XXX an optional full-scale FPA mosaic could happen here 223 // it would require us to NOT free PPIMAGE. OUTPUT.CHIP until here224 // ppImageMosaicFPA (config, "PPIMAGE.OUTPUT.FPA", "PPIMAGE. OUTPUT.CHIP");225 ppImageMosaicFPA(config, "PPIMAGE.OUTPUT.FPA1", "PPIMAGE.BIN1");226 ppImageMosaicFPA(config, "PPIMAGE.OUTPUT.FPA2", "PPIMAGE.BIN2");224 // it would require us to NOT free PPIMAGE.CHIP until here 225 // ppImageMosaicFPA (config, "PPIMAGE.OUTPUT.FPA", "PPIMAGE.CHIP"); 226 ppImageMosaicFPA(config, options, "PPIMAGE.OUTPUT.FPA1", "PPIMAGE.BIN1"); 227 ppImageMosaicFPA(config, options, "PPIMAGE.OUTPUT.FPA2", "PPIMAGE.BIN2"); 227 228 228 229 // we perform astrometry on all chips after sources have been detected 229 230 if (options->doAstromChip || options->doAstromMosaic) { 230 231 if (!ppImageAstrom(config)) { 231 psError(PS_ERR_UNKNOWN, false, "error running astrometry.\n");232 psFree(view);233 return false;234 }232 psError(PS_ERR_UNKNOWN, false, "error running astrometry.\n"); 233 psFree(view); 234 return false; 235 } 235 236 } 236 237 237 238 // Close FPA 238 239 if (!pmFPAfileIOChecks(config, view, PM_FPA_AFTER)) { 239 psFree(view);240 psFree(view); 240 241 return false; 241 242 }
Note:
See TracChangeset
for help on using the changeset viewer.
