IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Sep 13, 2005, 4:06:55 PM (21 years ago)
Author:
eugene
Message:

changed noise to weight, psImageData to eamReadout

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psphot/src/psphotSetup.c

    r4954 r5049  
    55//   apply X/Y border info
    66//   apply the SATURATE mask?
    7 // load or construct the noise
     7// load or construct the weight
    88
    9 psImageData *psphotSetup (psMetadata *config)
     9eamReadout *psphotSetup (psMetadata *config)
    1010{
    1111    psMetadata *header = NULL;
    1212    psImage *image = NULL;
    13     psImage *noise = NULL;
     13    psImage *weight = NULL;
    1414    psImage *mask = NULL;
    1515    psRegion region = {0,0,0,0};        // a region representing the entire array
     
    3939    psMetadataAdd (config, PS_LIST_TAIL, "GAIN",    PS_META_F32 | PS_META_REPLACE, "gain value used", GAIN);
    4040
    41     // load the noise image if it is supplied, otherwise build from input
    42     char *noiseName = psMetadataLookupPtr (&status, config, "NOISE");
     41    // load the weight image if it is supplied, otherwise build from input
     42    // by 'weight' we really mean variance image
     43    char *weightName = psMetadataLookupPtr (&status, config, "WEIGHT");
    4344    if (status == true) {
    44         file = psFitsAlloc (noiseName);
    45         noise = psFitsReadImage  (NULL, file, region, 0);
     45        file = psFitsAlloc (weightName);
     46        weight = psFitsReadImage  (NULL, file, region, 0);
    4647        psFree (file);
    47         // psFree (noiseName); XXX - see psFree (input)
     48        // psFree (weightName); XXX - see psFree (input)
    4849    } else {
    49         // build the noise image from the input image, RDNOISE, and GAIN
    50         noise = psImageAlloc (image->numCols, image->numRows, PS_TYPE_F32);
     50        // build the weight image from the input image, RDNOISE, and GAIN
     51        weight = psImageAlloc (image->numCols, image->numRows, PS_TYPE_F32);
    5152        for (int iy = 0; iy < image->numRows; iy++) {
    5253            for (int ix = 0; ix < image->numCols; ix++) {
    53                 noise->data.F32[iy][ix] = image->data.F32[iy][ix] / GAIN + PS_SQR(RDNOISE/GAIN);
     54                weight->data.F32[iy][ix] = image->data.F32[iy][ix] / GAIN + PS_SQR(RDNOISE/GAIN);
    5455            }
    5556        }
     
    9293
    9394    // save the image data & return it
    94     psImageData *imdata = psImageDataAlloc(image, noise, mask, header);
     95    eamReadout *imdata = eamReadoutAlloc(image, weight, mask, header);
    9596    return (imdata);
    9697}
Note: See TracChangeset for help on using the changeset viewer.