- Timestamp:
- Mar 29, 2010, 3:55:49 PM (16 years ago)
- Location:
- branches/eam_branches/20100225
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
ppStack/src/ppStackCleanup.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/20100225
- Property svn:mergeinfo changed
-
branches/eam_branches/20100225/ppStack/src/ppStackCleanup.c
r27004 r27517 6 6 #include <pslib.h> 7 7 #include <psmodules.h> 8 #include <ppStats.h> 8 9 9 10 #include "ppStack.h" … … 31 32 #endif 32 33 33 // Close up34 35 ppStackMemDump("cleanup");36 37 34 // Generate binned JPEGs 38 35 { … … 46 43 pmCell *cell2 = pmFPAfileThisCell(config->files, view, "PPSTACK.OUTPUT.JPEG2"); 47 44 psImageMaskType maskValue = pmConfigMaskGet("BLANK", config); // Bits to mask 45 psFree(view); 48 46 49 47 pmReadout *ro1 = pmReadoutAlloc(cell1), *ro2 = pmReadoutAlloc(cell2); // Binned readouts … … 59 57 } 60 58 59 // Statistics on output 60 if (options->stats) { 61 psTrace("ppStack", 1, "Gathering statistics on stacked image....\n"); 62 psString maskBadStr = psMetadataLookupStr(NULL, recipe, "MASK.BAD"); // Name of bits for bad 63 psImageMaskType maskBad = pmConfigMaskGet(maskBadStr, config); // Bits to mask for bad pixels 64 65 pmFPAview *view = pmFPAviewAlloc(0); // View to readout 66 view->chip = view->cell = view->readout = 0; 67 68 ppStatsFPA(options->stats, options->outRO->parent->parent->parent, view, maskBad, config); 69 70 psFree(view); 71 } 72 73 if (!ppStackFilesIterateUp(config)) { 74 psError(psErrorCodeLast(), false, "Unable to close files."); 75 return false; 76 } 77 ppStackFileActivation(config, PPSTACK_FILES_STACK, false); 78 ppStackFileActivation(config, PPSTACK_FILES_PHOT, false); 79 80 // Ensure files are freed 81 { 82 options->outRO->data_exists = false; 83 options->outRO->parent->data_exists = false; 84 options->outRO->parent->parent->data_exists = false; 85 psFree(options->outRO); 86 options->outRO = NULL; 87 88 options->expRO->data_exists = false; 89 options->expRO->parent->data_exists = false; 90 options->expRO->parent->parent->data_exists = false; 91 psFree(options->expRO); 92 options->expRO = NULL; 93 94 pmFPAview *view = pmFPAviewAlloc(0);// Pointer into FPA hierarchy 95 view->chip = view->cell = 0; // pmFPAviewFreeData doesn't want to deal with readouts 96 pmFPAfile *jpeg1 = pmFPAfileSelectSingle(config->files, "PPSTACK.OUTPUT.JPEG1", 0); // JPEG file 97 pmFPAviewFreeData(view, jpeg1); 98 pmFPAfile *jpeg2 = pmFPAfileSelectSingle(config->files, "PPSTACK.OUTPUT.JPEG2", 0); // JPEG file 99 pmFPAviewFreeData(view, jpeg2); 100 pmFPAfile *phot = NULL; // Photometry file 101 if (options->photometry) { 102 phot = pmFPAfileSelectSingle(config->files, "PSPHOT.INPUT", 0); // Photometry file 103 pmFPAviewFreeData(view, phot); 104 } 105 106 view->readout = 0; 107 pmReadout *ro1 = pmFPAviewThisReadout(view, jpeg1->fpa); // JPEG readout 108 ro1->data_exists = ro1->parent->data_exists = ro1->parent->parent->data_exists = false; 109 pmReadout *ro2 = pmFPAviewThisReadout(view, jpeg2->fpa); // JPEG readout 110 ro2->data_exists = ro2->parent->data_exists = ro2->parent->parent->data_exists = false; 111 if (options->photometry) { 112 pmReadout *ro = pmFPAviewThisReadout(view, phot->fpa); // Photometry readout 113 ro->data_exists = ro->parent->data_exists = ro->parent->parent->data_exists = false; 114 } 115 psFree(view); 116 } 117 61 118 return true; 62 119 }
Note:
See TracChangeset
for help on using the changeset viewer.
