Changeset 7621 for trunk/ppImage/src/ppImageParseCamera.c
- Timestamp:
- Jun 21, 2006, 12:51:48 PM (20 years ago)
- File:
-
- 1 edited
-
trunk/ppImage/src/ppImageParseCamera.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ppImage/src/ppImageParseCamera.c
r7592 r7621 6 6 bool status = false; 7 7 8 // the input image defines the camera 8 // the input image defines the camera, and all recipes and options the follow 9 9 pmFPAfile *input = pmFPAfileDefineFromArgs (&status, config, "PPIMAGE.INPUT", "INPUT"); 10 10 if (!status) { … … 14 14 15 15 // add recipe options supplied on command line 16 psMetadata *recipe = psMetadataLookupPtr (&status, config->recipes, "PHASE2");16 psMetadata *recipe = psMetadataLookupPtr (&status, config->recipes, "PHASE2"); 17 17 psMetadata *arglist = psMetadataLookupPtr (&status, config->arguments, "PPIMAGE.OPTIONS"); 18 18 psMetadataCopy (recipe, arglist); … … 20 20 // parse the options from the metadata format to the ppImageOptions structure 21 21 ppImageOptions *options = ppImageOptionsParse (config); 22 23 // the following files are output targets24 pmFPAfileDefineOutput (config, input->fpa, "PPIMAGE.OUTPUT");25 pmFPAfileDefineNewCamera (config, "PPIMAGE.OUTPUT.CHIP");26 22 27 23 // the following are defined from the argument list, if given, … … 56 52 if (!status) psAbort ("ppImageParseDetrend", "can't find a flat image source"); 57 53 } 58 if (options->doBin1) { 59 pmFPAfile *file = pmFPAfileDefineFromFPA (config, input->fpa, options->xBin1, options->yBin1, "PPIMAGE.BIN1"); 60 if (options->doBin1JPG) { 61 pmFPAfileDefineOutput (config, file->fpa, "PPIMAGE.JPEG1"); 54 55 // the following files are output targets 56 pmFPAfile *output = pmFPAfileDefineOutput (config, input->fpa, "PPIMAGE.OUTPUT"); 57 pmFPAfile *byChip = pmFPAfileDefineNewCamera (config, "PPIMAGE.OUTPUT.CHIP"); 58 pmFPAfile *byFPA1 = pmFPAfileDefineNewCamera (config, "PPIMAGE.OUTPUT.FPA1"); 59 pmFPAfile *byFPA2 = pmFPAfileDefineNewCamera (config, "PPIMAGE.OUTPUT.FPA2"); 60 61 // save any of these files? 62 output->save = options->BaseFITS; 63 byChip->save = options->ChipFITS; 64 byFPA1->save = options->FPA1FITS; 65 byFPA2->save = options->FPA2FITS; 66 67 // output is used as a carrier: input to byChip 68 output->freeLevel = PM_FPA_LEVEL_CHIP; 69 70 // define the binned target files (which may just be carriers for some camera configurations) 71 pmFPAfile *bin1 = pmFPAfileDefineFromFPA (config, byChip->fpa, options->xBin1, options->yBin1, "PPIMAGE.BIN1"); 72 pmFPAfile *bin2 = pmFPAfileDefineFromFPA (config, byChip->fpa, options->xBin2, options->yBin2, "PPIMAGE.BIN2"); 73 74 // set the CELL.XBIN and CELL.YBIN for the output mosaiced FPAs 75 for (int i = 0; i < byFPA1->fpa->chips->n; i++) { 76 pmChip *chip = byFPA1->fpa->chips->data[i]; 77 for (int j = 0; j < chip->cells->n; j++) { 78 pmCell *cell = chip->cells->data[j]; 79 psMetadataAddF32 (cell->concepts, PS_LIST_TAIL, "CELL.XBIN", PS_META_REPLACE, "", options->xBin1); 80 psMetadataAddF32 (cell->concepts, PS_LIST_TAIL, "CELL.YBIN", PS_META_REPLACE, "", options->yBin1); 62 81 } 63 82 } 64 if (options->doBin2) { 65 pmFPAfile *file = pmFPAfileDefineFromFPA (config, input->fpa, options->xBin2, options->yBin2, "PPIMAGE.BIN2"); 66 if (options->doBin2JPG) { 67 pmFPAfileDefineOutput (config, file->fpa, "PPIMAGE.JPEG2"); 83 for (int i = 0; i < byFPA2->fpa->chips->n; i++) { 84 pmChip *chip = byFPA2->fpa->chips->data[i]; 85 for (int j = 0; j < chip->cells->n; j++) { 86 pmCell *cell = chip->cells->data[j]; 87 psMetadataAddF32 (cell->concepts, PS_LIST_TAIL, "CELL.XBIN", PS_META_REPLACE, "", options->xBin2); 88 psMetadataAddF32 (cell->concepts, PS_LIST_TAIL, "CELL.YBIN", PS_META_REPLACE, "", options->yBin2); 68 89 } 69 90 } 70 91 71 // ppImage is supplied with an output name, which may be used by multiple 72 // output files to construct the output names. supply this value to the 73 // files which are write types. 74 char *output = psMetadataLookupPtr(&status, config->arguments, "OUTPUT"); 75 pmFPAfileAddFileNames (config->files, "OUTPUT", output, PM_FPA_MODE_WRITE); 92 // bin1 and bin2 are used as carriers: input for byFPA1, byFPA2 93 bin1->freeLevel = PM_FPA_LEVEL_FPA; 94 bin2->freeLevel = PM_FPA_LEVEL_FPA; 95 96 pmFPAfile *jpg1 = pmFPAfileDefineOutput (config, byFPA1->fpa, "PPIMAGE.JPEG1"); 97 pmFPAfile *jpg2 = pmFPAfileDefineOutput (config, byFPA2->fpa, "PPIMAGE.JPEG2"); 98 99 // XXX we could potentially not define these pmFPAfiles if no output is requested... 100 bin1->save = options->Bin1FITS; 101 bin2->save = options->Bin2FITS; 102 jpg1->save = options->Bin1JPEG; 103 jpg2->save = options->Bin2JPEG; 76 104 77 105 // Chip selection: turn on only the chips specified (pass status to suppress missing-key log msg)
Note:
See TracChangeset
for help on using the changeset viewer.
