Changeset 34800 for trunk/ppStack/src/ppStackCombinePrepare.c
- Timestamp:
- Dec 11, 2012, 2:04:31 PM (13 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
ppStack/src/ppStackCombinePrepare.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk
-
trunk/ppStack/src/ppStackCombinePrepare.c
r30620 r34800 1 1 #include "ppStack.h" 2 2 3 bool ppStackCombinePrepare(const char *outName, const char *expName, 3 bool ppStackCombinePrepare(const char *outName, const char *expName, const char *bkgName, 4 4 ppStackFileList files, ppStackThreadData *stack, 5 5 ppStackOptions *options, pmConfig *config) … … 27 27 options->outRO = pmReadoutAlloc(cell); // Output readout 28 28 29 pmCell *expCell = pmFPAfileThisCell(config->files, view, expName); // Exposure cell 30 options->expRO = pmReadoutAlloc(expCell); // Output readout 29 if (expName) { 30 pmCell *expCell = pmFPAfileThisCell(config->files, view, expName); // Exposure cell 31 options->expRO = pmReadoutAlloc(expCell); //Output readout 32 } 33 /* else { */ 34 /* options->expRO = NULL; */ 35 /* } */ 36 pmCell *bkgCell; 37 int bkg_r0,bkg_c0; 38 int bkg_nC,bkg_nR; 39 if (bkgName) { 40 ppStackFileActivationSingle(config, PPSTACK_FILES_BKG, true, 0); 41 pmFPAfile *file = pmFPAfileSelectSingle(config->files, "PPSTACK.INPUT.BKGMODEL", 0); 42 pmFPAview *view = ppStackFilesIterateDown(config); 43 pmReadout *ro = pmFPAviewThisReadout(view,file->fpa); 44 45 bkg_r0 = ro->image->row0; 46 bkg_c0 = ro->image->col0; 47 bkg_nC = ro->image->numCols; 48 bkg_nR = ro->image->numRows; 49 bkgCell = pmFPAfileThisCell(config->files, view, bkgName); // Bkg cell 50 51 options->bkgRO = pmReadoutAlloc(bkgCell); // BKG readout 52 // if (!pmHDUGenerateForFPA(options->bkgRO->parent->parent->parent)) { 53 options->bkgRO->parent->parent->parent->hdu = pmHDUAlloc(NULL); 54 if (!options->bkgRO->parent->parent->parent->hdu) { 55 fprintf(stderr,"failed to generate a HDU for this thing.\n"); 56 } 57 options->bkgRO->parent->parent->parent->hdu->header = psMetadataCopy(options->bkgRO->parent->parent->parent->hdu->header, 58 ro->parent->parent->parent->hdu->header); 59 60 options->bkgRO->parent->concepts = psMetadataCopy(options->bkgRO->parent->concepts, 61 ro->parent->concepts); 62 options->bkgRO->parent->parent->concepts = psMetadataCopy(options->bkgRO->parent->parent->concepts, 63 ro->parent->parent->concepts); 64 options->bkgRO->parent->parent->parent->concepts = psMetadataCopy(options->bkgRO->parent->parent->parent->concepts, 65 ro->parent->parent->parent->concepts); 66 67 } 68 else { 69 options->bkgRO = NULL; 70 } 31 71 32 72 psFree(view); … … 42 82 } 43 83 44 if (!pmReadoutStackDefineOutput(options->expRO, col0, row0, numCols, numRows, true, true, 0)) { 84 if (expName) { 85 if (!pmReadoutStackDefineOutput(options->expRO, col0, row0, numCols, numRows, true, true, 0)) { 45 86 psError(PPSTACK_ERR_ARGUMENTS, false, "Unable to prepare output."); 46 87 return false; 88 } 89 } 90 91 if (bkgName) { 92 if (!pmReadoutStackDefineOutput(options->bkgRO, bkg_c0, bkg_r0, bkg_nC, bkg_nR, false, false, 0)) { 93 psError(PPSTACK_ERR_ARGUMENTS, false, "Unable to prepare output."); 94 return false; 95 } 96 97 98 47 99 } 48 100
Note:
See TracChangeset
for help on using the changeset viewer.
