IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 30627


Ignore:
Timestamp:
Feb 13, 2011, 3:03:08 PM (15 years ago)
Author:
eugene
Message:

fixed ppImageAddNoise to make the variance consistent with the image

Location:
tags/ipp-20101215/ppImage/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • tags/ipp-20101215/ppImage/src/ppImageAddNoise.c

    r30596 r30627  
    2222  static float add_sigmas[] = {NAN, 13.39, 23.79, 75.25, 110.19, 128.84};
    2323 
    24   // Exposure times for 3pi in grizy
     24  // Target Exposure times for 3pi in grizy
    2525  static float expTimes3Pi[] = {NAN, 43.0, 40.0, 45.0, 30.0, 30.0};
    2626  float expTime   = psMetadataLookupF32(NULL, fpa->concepts, "FPA.EXPOSURE"); // Exposure time for image
     
    5454  // find the currently selected readout
    5555  psImage *image = inReadout->image;
     56  psImage *variance = inReadout->variance;
    5657 
    5758  // Warning, just in case this is left on accidently!
     
    6869      image->data.F32[iy][ix] += ppImageRandomGaussian(rng, 0.0, add_sigmas[band]);
    6970      image->data.F32[iy][ix] /= expTimeScaling;
     71      variance->data.F32[iy][ix] += PS_SQR(add_sigmas[band]);
     72      variance->data.F32[iy][ix] /= expTimeScaling;
    7073    }
    7174  }
    7275         
    7376  // Update the metadata about exposure time
    74   psMetadataAddF32(fpa->concepts, PS_LIST_TAIL, "FPA.EXPOSURE", PS_META_REPLACE, "the modified exposure time", expTimes3Pi[band]);
     77  psMetadataAddF32(inReadout->parent->concepts, PS_LIST_TAIL, "CELL.EXPOSURE", PS_META_REPLACE, "the modified exposure time", expTimes3Pi[band]);
    7578  psMetadataAddF32(fpa->concepts, PS_LIST_TAIL, "EXPTIME", PS_META_REPLACE, "the modified exposure time", expTimes3Pi[band]);
    7679  ppImageRandomGaussianFree();
  • tags/ipp-20101215/ppImage/src/ppImageLoop.c

    r30596 r30627  
    110110                    ESCAPE("Unable to set bit masks");
    111111                }
     112
     113                // perform the detrend analysis
     114                if (!ppImageDetrendReadout(config, options, view)) {
     115                    ESCAPE("Unable to detrend readout");
     116                }
     117
     118                // free detrend images potentially in use: MASK, BIAS, DARK, SHUTTER, FLAT
     119                if (!ppImageDetrendFree (config, view)) {
     120                    ESCAPE("Unable to free detrend images");
     121                }
     122
     123                // optionally measure CTE by examining the variance in a box
     124                if (!ppImageCheckCTE (config, options, view)) {
     125                    ESCAPE("Unable to measure CTE");
     126                }
     127
    112128                // optionally degrade a MD image to 3pi exposure times
    113129                if (!ppImageAddNoise(config, options, view, input->fpa)){
    114130                    ESCAPE("Unable to degrade MD image to 3pi");
    115131                }
    116 
    117                 // perform the detrend analysis
    118                 if (!ppImageDetrendReadout(config, options, view)) {
    119                     ESCAPE("Unable to detrend readout");
    120                 }
    121 
    122                 // free detrend images potentially in use: MASK, BIAS, DARK, SHUTTER, FLAT
    123                 if (!ppImageDetrendFree (config, view)) {
    124                     ESCAPE("Unable to free detrend images");
    125                 }
    126 
    127                 // optionally measure CTE by examining the variance in a box
    128                 if (!ppImageCheckCTE (config, options, view)) {
    129                     ESCAPE("Unable to measure CTE");
    130                 }
    131132            }
    132133
Note: See TracChangeset for help on using the changeset viewer.