Changeset 23406
- Timestamp:
- Mar 18, 2009, 3:51:09 PM (17 years ago)
- Location:
- branches/eam_branches/eam_branch_20090312/ppImage/src
- Files:
-
- 1 added
- 2 edited
-
ppImageCheckCTE.c (modified) (4 diffs)
-
ppImageCheckCTE.v1.c (added)
-
ppImageParseCamera.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/eam_branch_20090312/ppImage/src/ppImageCheckCTE.c
r23320 r23406 5 5 #include "ppImage.h" 6 6 7 // XXX I originally coded this to create a new pmFPAfile, but in retrospect it makes more sense 8 // to treat this function as an operation on the input image 9 10 // XXX make the choice of stats optional 7 11 bool ppImageCheckCTE(pmConfig *config, ppImageOptions *options, pmFPAview *view) 8 12 { … … 34 38 psImageBinningSetSkip(binning, image); 35 39 36 pmCell *inCell = pmFPAfileThisCell (config->files, view, "PPIMAGE.INPUT"); 37 pmCell *outCell = pmFPAfileThisCell (config->files, view, "PPIMAGE.CTEMAP"); 38 if (!pmCellCopyStructure(outCell, inCell, binning->nXbin, binning->nYbin)) { 39 psError(PS_ERR_UNKNOWN, false, "Unable to copy cell structure."); 40 return false; 41 } 40 psStats *stats = psStatsAlloc (PS_STAT_ROBUST_MEDIAN); 41 psRandom *rng = psRandomAlloc(PS_RANDOM_TAUS); 42 psImageBackground (stats, NULL, image, mask, 0xffff, rng); 43 float cellMedian = stats->robustMedian; 44 psFree (stats); 42 45 43 pmReadout *outRO = pmFPAfileThisReadout(config->files, view, "PPIMAGE.CTEMAP");44 psImage *output = outRO->image;46 // stats = psStatsAlloc (PS_STAT_SAMPLE_STDEV); 47 // psStats *statsDefaults = psStatsAlloc (PS_STAT_SAMPLE_STDEV); 45 48 46 // Don't care about the bias: get rid of it, if present 47 psFree(outRO->bias); 48 outRO->bias = psListAlloc(NULL); 49 psMetadataItem *biassec = psMetadataLookup(outCell->concepts, "CELL.BIASSEC"); 50 psFree(biassec->data.V); 51 biassec->data.V = psListAlloc(NULL); 52 53 psStats *stats = psStatsAlloc (PS_STAT_SAMPLE_MEDIAN | PS_STAT_SAMPLE_STDEV); 54 psStats *statsDefaults = psStatsAlloc (PS_STAT_SAMPLE_MEDIAN | PS_STAT_SAMPLE_STDEV); 49 stats = psStatsAlloc (PS_STAT_ROBUST_STDEV); 50 psStats *statsDefaults = psStatsAlloc (PS_STAT_ROBUST_STDEV); 55 51 56 52 // measure median and variance for subimages 57 53 psRegion ruffRegion = {0,0,0,0}; 58 54 psRegion fineRegion = {0,0,0,0}; 59 for (int iy = 0; iy < output->numRows; iy++) {60 for (int ix = 0; ix < output->numCols; ix++) {55 for (int iy = 0; iy < binning->nYruff; iy++) { 56 for (int ix = 0; ix < binning->nXruff; ix++) { 61 57 62 58 // convert the ruff grid cell to the equivalent fine grid cell … … 84 80 statsDefaults->tmpData = NULL; 85 81 86 psImageStats (stats, subset, submask, 0 );82 psImageStats (stats, subset, submask, 0xffff); 87 83 88 // XXX need to apply the gain as well 89 output->data.F32[iy][ix] = PS_SQR(stats->sampleStdev) / stats->sampleMedian; 84 // XXX need to apply the gain as well 85 float normVariance = PS_SQR(stats->robustStdev) / cellMedian; 86 // float normVariance = PS_SQR(stats->sampleStdev) / cellMedian; 87 88 // apply resulting value to the input pixels 89 for (int jy = fineRegion.y0; jy < fineRegion.y1; jy++) { 90 for (int jx = fineRegion.x0; jx < fineRegion.x1; jx++) { 91 image->data.F32[jy][jx] = normVariance; 92 } 93 } 90 94 91 95 psFree (subset); … … 94 98 } 95 99 100 psFree (rng); 96 101 psFree (binning); 97 102 psFree (stats); -
branches/eam_branches/eam_branch_20090312/ppImage/src/ppImageParseCamera.c
r23316 r23406 154 154 } 155 155 156 if (options->checkCTE ) {156 if (options->checkCTE && false) { 157 157 int DX = psMetadataLookupS32 (&status, recipe, "CTE.XBIN"); 158 158 int DY = psMetadataLookupS32 (&status, recipe, "CTE.YBIN");
Note:
See TracChangeset
for help on using the changeset viewer.
