Changeset 17157 for branches/pap_branch_080320/ppMerge/src/ppMergeCamera.c
- Timestamp:
- Mar 27, 2008, 2:59:07 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/pap_branch_080320/ppMerge/src/ppMergeCamera.c
r17090 r17157 5 5 #include <stdio.h> 6 6 #include <string.h> 7 #include <assert.h> 7 8 #include <pslib.h> 8 9 #include <psmodules.h> … … 10 11 #include "ppMerge.h" 11 12 13 // Define an output file, with its own FPA 14 bool outputFile(pmConfig *config, // Configuration 15 const char *name, // Name of output file 16 pmFPAfileType type, // Type of file 17 const char *description, // Description of file 18 psMetadata *format, // Camera format 19 pmFPAview *view // View for PHU 20 ) 21 { 22 assert(config); 23 assert(name && strlen(name) > 0); 24 assert(view); 25 26 // Output image 27 pmFPA *fpa = pmFPAConstruct(config->camera); // FPA to contain the output 28 if (!fpa) { 29 psError(PS_ERR_UNEXPECTED_NULL, false, "Unable to construct an FPA from camera configuration."); 30 return false; 31 } 32 33 pmFPAfile *output = pmFPAfileDefineOutput(config, fpa, name); 34 psFree(fpa); // Drop reference 35 if (!output) { 36 psError(PS_ERR_IO, false, "Unable to generate output file from %s", name); 37 return false; 38 } 39 if (output->type != type) { 40 psError(PS_ERR_IO, true, "%s is not of type %s", name, pmFPAfileStringFromType(type)); 41 return false; 42 } 43 output->save = true; 44 45 if (!pmFPAAddSourceFromView(fpa, description, view, format)) { 46 psError(PS_ERR_UNKNOWN, false, "Unable to generate output FPA."); 47 return false; 48 } 49 50 return true; 51 } 12 52 13 53 … … 191 231 psFree(cell->concepts); 192 232 cell->concepts = NULL; 233 cell->data_exists = false; 234 cell->file_exists = false; 193 235 culled++; 194 236 } … … 197 239 psFree(chip->concepts); 198 240 chip->concepts = NULL; 241 chip->data_exists = false; 242 chip->file_exists = false; 199 243 } 200 244 } … … 256 300 } 257 301 258 pmFPAfile *output = pmFPAfileDefineOutput(config, fpa, outName); 259 psFree(fpa); // Drop reference 260 if (!output) { 261 psError(PS_ERR_IO, false, _("Unable to generate output file from %s"), outName); 302 if (!outputFile(config, outName, fileType, "Merged detrend", format, phuView)) { 262 303 psFree(outName); 263 return false; 264 } 265 if (output->type != fileType) { 266 psError(PS_ERR_IO, true, "%s is not of type %s", outName, pmFPAfileStringFromType(fileType)); 267 psFree(outName); 268 return false; 269 } 270 output->save = true; 304 psFree(phuView); 305 return false; 306 } 271 307 psFree(outName); 272 308 273 if (!pmFPAAddSourceFromView(fpa, "Merged detrend", phuView, format)) { 274 psError(PS_ERR_UNKNOWN, false, "Unable to generate output FPA."); 275 psFree(fpa); 276 return false; 277 } 309 if (!outputFile(config, "PPMERGE.OUTPUT.SIGMA", fileType, "Merge sigma", format, phuView)) { 310 psFree(phuView); 311 return false; 312 } 313 314 if (!outputFile(config, "PPMERGE.OUTPUT.COUNT", fileType, "Merged count", format, phuView)) { 315 psFree(phuView); 316 return false; 317 } 318 278 319 psFree(phuView); 279 320
Note:
See TracChangeset
for help on using the changeset viewer.
