Changeset 29851
- Timestamp:
- Nov 26, 2010, 10:47:07 AM (15 years ago)
- Location:
- branches/eam_branches/ipp-20101103/ppImage/src
- Files:
-
- 9 edited
-
ppImage.h (modified) (1 diff)
-
ppImageArguments.c (modified) (2 diffs)
-
ppImageDefineFile.c (modified) (4 diffs)
-
ppImageDetrendFree.c (modified) (2 diffs)
-
ppImageDetrendNonLinear.c (modified) (2 diffs)
-
ppImageDetrendReadout.c (modified) (3 diffs)
-
ppImageLoop.c (modified) (1 diff)
-
ppImageOptions.c (modified) (3 diffs)
-
ppImageParseCamera.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20101103/ppImage/src/ppImage.h
r28043 r29851 155 155 bool ppImageDetrendBias(pmReadout *inputReadout, pmReadout *bias, pmReadout *dark, ppImageOptions *options); 156 156 157 bool ppImageDetrendNonLinear(pmReadout *input, ppImageOptions *options); 157 //bool ppImageDetrendNonLinear(pmReadout *input, ppImageOptions *options); 158 bool ppImageDetrendNonLinear(pmReadout *input, pmFPAview *linearity, pmConfig *config); 158 159 bool ppImageDetrendNonLinearLookup(pmReadout *input, psMetadataItem *dataItem); 159 160 bool ppImageDetrendNonLinearPolynomial(pmReadout *input, psMetadataItem *dataItem); -
branches/eam_branches/ipp-20101103/ppImage/src/ppImageArguments.c
r24485 r29851 24 24 fprintf(stderr, "\t-mask/-masklist: Mask image.\n"); 25 25 fprintf(stderr, "\t-fringe/-fringelist: Fringe image and data.\n"); 26 fprintf(stderr, "\t-linearity/-linearlist: linearity correction file.\n"); 26 27 fprintf(stderr, "\n"); 27 28 exit (2); … … 120 121 pmConfigFileSetsMD (config->arguments, &argc, argv, "MASK", "-mask", "-masklist"); 121 122 pmConfigFileSetsMD (config->arguments, &argc, argv, "FRINGE", "-fringe", "-fringelist"); 123 pmConfigFileSetsMD (config->arguments, &argc, argv, "LINEARITY", "-linearity", "-linearlist"); 122 124 123 125 // chip selection is used to limit chips to be processed -
branches/eam_branches/ipp-20101103/ppImage/src/ppImageDefineFile.c
r26494 r29851 15 15 file = pmFPAfileDefineFromArgs(&status, config, filerule, argname); 16 16 if (!status) { 17 psError(PS_ERR_UNKNOWN, false, "failed to load file definition ");17 psError(PS_ERR_UNKNOWN, false, "failed to load file definition ARG LIST"); 18 18 return false; 19 19 } … … 23 23 file = pmFPAfileDefineFromRun(&status, NULL, config, filerule); 24 24 if (!status) { 25 psError(PS_ERR_UNKNOWN, false, "failed to load file definition ");25 psError(PS_ERR_UNKNOWN, false, "failed to load file definition RUN"); 26 26 return false; 27 27 } … … 31 31 file = pmFPAfileDefineFromConf(&status, config, filerule); 32 32 if (!status) { 33 psError(PS_ERR_UNKNOWN, false, "failed to load file definition ");33 psError(PS_ERR_UNKNOWN, false, "failed to load file definition CONFIG"); 34 34 return false; 35 35 } … … 39 39 file = pmFPAfileDefineFromDetDB(&status, config, filerule, input, detrendType); 40 40 if (!status) { 41 psError(PS_ERR_UNKNOWN, false, "failed to load file definition ");41 psError(PS_ERR_UNKNOWN, false, "failed to load file definition DETREND"); 42 42 return false; 43 43 } -
branches/eam_branches/ipp-20101103/ppImage/src/ppImageDetrendFree.c
r24485 r29851 13 13 "PPIMAGE.FLAT", 14 14 "PPIMAGE.SHUTTER", 15 "PPIMAGE.LINEARITY", 15 16 NULL 16 17 }; … … 23 24 24 25 pmFPAfile *file = psMetadataLookupPtr(&status, config->files, detrendTypes[i]); // File of interest 26 psTrace("pmFPAfileFree",1,"Working on %s\n",detrendTypes[i]); 25 27 if (!file) continue; // not all detrends are used in any given run 26 28 -
branches/eam_branches/ipp-20101103/ppImage/src/ppImageDetrendNonLinear.c
r11702 r29851 44 44 } 45 45 46 bool ppImageDetrendNonLinear(pmReadout *input, ppImageOptions *options) { 46 47 bool ppImageDetrendNonLinear(pmReadout *input, pmFPAview *detview, pmConfig *config) { 48 bool status; 49 50 pmFPAfile *linearity_file = psMetadataLookupPtr(&status,config->files,"PPIMAGE.LINEARITY"); 51 psFits *linearity_fits = linearity_file->fits; 52 53 char *extname = psMetadataLookupStr(&status,input->parent->concepts,"CELL.NAME"); 54 if (!extname) { 55 psError(PS_ERR_IO, false, "missing CELL.NAME in concepts"); 56 return(false); 57 } 58 59 if (!psFitsMoveExtName(linearity_fits,extname)) { 60 psError(PS_ERR_IO, false, "Unable to move to non-linearity table %s", extname); 61 return(false); 62 } 63 64 psArray *table = psFitsReadTable(linearity_fits); 65 if (!table) { 66 psError(PS_ERR_IO, false, "Unable to read non-linearity table.\n"); 67 return(false); 68 } 69 70 // It might be better to pack lookup table here... 71 // Why? I only use that lookup table once for the single cell it matches. 72 73 if (!pmNonLinearityApply(input,table)) { 74 psError(PS_ERR_UNKNOWN, false, "Unable to apply non-linearity corrections.\n"); 75 psFree (table); 76 return(false); 77 } 78 psFree (table); 79 80 return true; 81 } 82 83 bool ppImageDetrendNonLinear_Original(pmReadout *input, ppImageOptions *options) { 47 84 48 85 psMetadataItem *concept; … … 59 96 60 97 case PS_DATA_METADATA: 61 // XXX EAM: this is somewhat confusing : let's wrap in a function when i understand it62 63 98 // Go looking for the value in the hierarchy 64 99 concept = psMetadataLookup(cell->concepts, options->nonLinearSource); -
branches/eam_branches/ipp-20101103/ppImage/src/ppImageDetrendReadout.c
r26653 r29851 51 51 } 52 52 53 54 # if 0 53 // Subtract the overscan 54 if (options->doOverscan) { 55 if (!pmOverscanSubtract (input, options->overscan)) { 56 psError(PS_ERR_UNKNOWN, false, "Unable to subtract overscan."); 57 psFree(detview); 58 return false; 59 } 60 } 61 55 62 // Non-linearity correction 56 63 if (options->doNonLin) { 57 ppImageDetrendNonLinear(detrend->input, input, options); 58 } 59 # endif 64 if (!ppImageDetrendNonLinear(input,detview,config)) { 65 psError(PS_ERR_UNKNOWN, false, "Unable to correct NonLinearity"); 66 psFree(detview); 67 return(false); 68 } 69 } 60 70 61 71 // set up the dark and bias … … 77 87 } 78 88 79 // Bias , dark and overscan subtraction are allmerged.80 if (options->doBias || options->doOverscan) {81 if (!pmBiasSubtract(input, options->overscan,bias, oldDark, view)) {89 // Bias and temperature-independent-dark subtraction are merged. 90 if (options->doBias) { 91 if (!pmBiasSubtract(input, bias, oldDark, view)) { 82 92 psError(PS_ERR_UNKNOWN, false, "Unable to subtract bias."); 83 93 psFree(detview); … … 85 95 } 86 96 } 87 97 88 98 // Weight on the basis of pixel value needs to be done after the overscan has been subtracted 89 99 if (options->doVarianceBuild) { -
branches/eam_branches/ipp-20101103/ppImage/src/ppImageLoop.c
r28375 r29851 152 152 ESCAPE("Unable to free detrend images"); 153 153 } 154 154 155 155 // Apply the fringe correction 156 156 if (options->doFringe) { -
branches/eam_branches/ipp-20101103/ppImage/src/ppImageOptions.c
r29658 r29851 8 8 { 9 9 psFree(options->overscan); 10 psFree(options->nonLinearData);11 psFree(options->nonLinearSource);10 // psFree(options->nonLinearData); 11 // psFree(options->nonLinearSource); 12 12 } 13 13 … … 130 130 psMetadataItem *dataItem = psMetadataLookup(recipe, "NONLIN.DATA"); 131 131 if (! dataItem) { 132 psLogMsg(__func__, PS_LOG_ERROR, "Non-linearity correction desired, but unable to " 133 "find NONLIN.DATA in recipe %s.", RECIPE_NAME); 132 psLogMsg("ppImage", PS_LOG_ERROR, "Non-linearity correction desired, but unable to find NONLIN.DATA in recipe %s.", RECIPE_NAME); 134 133 exit(EXIT_FAILURE); 135 134 } … … 147 146 // This is a menu; we need the key 148 147 case PS_DATA_METADATA: 149 { 150 bool status; 151 options->nonLinearSource = psMetadataLookupStr(&status, recipe, "NONLIN.SOURCE"); 152 if (! status || ! options->nonLinearSource) { 153 psLogMsg(__func__, PS_LOG_ERROR, "Non-linearity correction desired, but unable to " 154 "find NONLIN.SOURCE in recipe %s.", RECIPE_NAME); 155 exit(EXIT_FAILURE); 156 } 157 } 148 options->nonLinearSource = psMetadataLookupStr(&status, recipe, "NONLIN.SOURCE"); 149 if (! status || ! options->nonLinearSource) { 150 psLogMsg("ppImage", PS_LOG_ERROR, "Non-linearity correction desired, but unable to find NONLIN.SOURCE in recipe %s.", RECIPE_NAME); 151 exit(EXIT_FAILURE); 152 } 158 153 break; 159 154 default: 160 psLogMsg(__func__, PS_LOG_ERROR, "Non-linearity correction desired, but " 161 "NONLIN.DATA is of invalid type in recipe %s.", RECIPE_NAME); 155 psLogMsg("ppImage", PS_LOG_ERROR, "Non-linearity correction desired, but NONLIN.DATA is of invalid type in recipe %s.", RECIPE_NAME); 162 156 exit(EXIT_FAILURE); 163 157 } -
branches/eam_branches/ipp-20101103/ppImage/src/ppImageParseCamera.c
r26895 r29851 73 73 return NULL; 74 74 } 75 } 76 77 if (options->doNonLin) { 78 if (!ppImageDefineFile(config, input->fpa, "PPIMAGE.LINEARITY", "LINEARITY", 79 PM_FPA_FILE_LINEARITY, PM_DETREND_TYPE_LINEARITY)) { 80 psError(PS_ERR_IO, false, "Can't find a non-linearity correction source"); 81 psFree(options); 82 return NULL; 83 } 75 84 } 76 85
Note:
See TracChangeset
for help on using the changeset viewer.
