IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Apr 7, 2006, 5:57:23 PM (20 years ago)
Author:
eugene
Message:

substantial upgrade to work with the pmFPAfile paradigm

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ppImage/src/ppImageDetrendMask.c

    r6747 r6817  
    1 #include <stdio.h>
    2 #include "psmodules.h"
    3 #include "ppImageDetrend.h"
     1#include "ppImage.h"
    42
    53# define MASK_MODE (PM_MASK_TRAP | PM_MASK_BADCOL | PM_MASK_SAT)
     
    75// XXX pass 'concepts' not 'cell' to this function?
    86
    9 bool ppImageDetrendMask(pmCell *cell, pmReadout *input, pmReadout *mask) {
     7bool ppImageDetrendMask(pmReadout *input, pmReadout *mask) {
    108
    11     float saturation = psMetadataLookupF32(NULL, cell->concepts, "CELL.SATURATION");
     9    psImage *image = NULL;
     10
     11    float saturation = psMetadataLookupF32(NULL, input->parent->concepts, "CELL.SATURATION");
    1212
    1313    // Need to change this later to grow the mask by the size of the convolution kernel
    1414    // XXX does this function respect the mask / image cell region information?
    1515    // XXX should probably take pmRegion *mask
    16     pmMaskBadPixels(input, mask->image, MASK_MODE, saturation, PM_MASK_TRAP, 0);
     16
     17    if (mask->image->type.type != PS_TYPE_MASK) {
     18        image = psImageCopy (NULL, mask->image, PS_TYPE_MASK);
     19    } else {
     20        image = psMemIncrRefCounter (mask->image);
     21    }
     22
     23    pmMaskBadPixels(input, image, MASK_MODE, saturation, PM_MASK_TRAP, 0);
     24    psFree (image);
    1725
    1826    return true;
    1927}
     28
     29
     30// XXX the translation here should not be needed
     31// the mask should (but is not) be read in using the mask read functions
     32// by identifying the image type as a mask (in pmFPAfile).
     33// currently, pmFPAfileReadImage converts the image to F32
Note: See TracChangeset for help on using the changeset viewer.