IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Mar 22, 2007, 5:09:53 PM (19 years ago)
Author:
Paul Price
Message:

When we went to process TC3 images, we found that our camera formats
didn't handle its case (PHU=CHIP, EXT=CELL) properly. In order to
accomodate it, I've reworked the camera formats (including adding a
source to an FPA, and generating mosaic camera configurations). Now,
the particular format of the camera format file is *very* dependent
upon the FITS file:

Case PHU EXTENSIONS Description

  1. FPA CHIP CONTENTS(METADATA) has a list of extensions, each with a chip type.

CHIPS(METADATA) has a list of chip types, each with cell:type

  1. FPA CELL CONTENTS(METADATA) has a list of extensions, each with chip:cell:type

No need for CHIPS.

  1. FPA NONE CONTENTS(STRING) has a list of extensions, chip:cell:type

No need for CHIPS

  1. CHIP CELL CONTENTS(METADATA) is a menu, each with a chip type

CHIPS(METADATA) has a list of chip types(METADATA), containg a list of
extensions.

  1. CHIP NONE CONTENTS(METADATA) is a menu, each with a chip type

CHIPS(METADATA) has a list of chip types(STRING) with cell:type

  1. CELL NONE CONTENTS(METADATA) is a menu, each with a cell type.

No need for CHIPS.

Debugged and plugged memory leaks for this fix. Now able to
successfully read TC3 and Megacam (all 3 formats). Can't run ppImage
with PPIMAGE_N on file with PHU=CHIP because it's trying to write out
a PHU (at the FPA level) before it reads any of the input data. This
behaviour exists in a previous version (IPP 1.0; in fact, the current
fix deals with it a bit better --- error instead of SEGV), so it
should be safe to use this now.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psModules/src/camera/pmFPARead.c

    r11793 r12564  
    3939                         const psRegion *trimsec, // Trim section
    4040                         const psList *biassecs, // Bias sections
    41                         fpaReadType type
     41                        fpaReadType type
    4242                        )
    4343{
     
    6565    switch (type) {
    6666      case FPA_READ_TYPE_IMAGE:
    67         if (readout->image) {
    68             psFree (readout->image);
    69         }
    70         readout->image = psMemIncrRefCounter(psImageSubset(image, region));     
    71         break;
     67        if (readout->image) {
     68            psFree (readout->image);
     69        }
     70        readout->image = psMemIncrRefCounter(psImageSubset(image, region));
     71        break;
    7272      case FPA_READ_TYPE_MASK:
    73         if (readout->mask) {
    74             psFree (readout->mask);
    75         }
    76         readout->mask = psMemIncrRefCounter(psImageSubset(image, region));     
    77         break;
     73        if (readout->mask) {
     74            psFree (readout->mask);
     75        }
     76        readout->mask = psMemIncrRefCounter(psImageSubset(image, region));
     77        break;
    7878      case FPA_READ_TYPE_WEIGHT:
    79         if (readout->weight) {
    80             psFree (readout->weight);
    81         }
    82         readout->weight = psMemIncrRefCounter(psImageSubset(image, region));   
    83         break;
     79        if (readout->weight) {
     80            psFree (readout->weight);
     81        }
     82        readout->weight = psMemIncrRefCounter(psImageSubset(image, region));
     83        break;
    8484      default:
    85         psAbort("Unknown read type: %x\n", type);
    86     }
    87    
     85        psAbort("Unknown read type: %x\n", type);
     86    }
     87
    8888    // Get the list of overscans
    8989    // XXX should this step only be performed for IMAGE, not MASK and WEIGHT types?
     
    210210    // check if we have read the desired data, read it if needed
    211211    bool (*hduReadFunc)(pmHDU*, psFits*) = NULL; // Function to use to read the HDU
    212     void *dataPointer = NULL;           // pointer to location of desired data
     212    void *dataPointer = NULL;           // pointer to location of desired data
    213213    switch (type) {
    214214      case FPA_READ_TYPE_IMAGE:
     
    234234    // do we have the data we want (image, header, or etc).
    235235    if (!dataPointer) {
    236         // attempt to read in the desired data
    237         if (!hduReadFunc(hdu, fits)) {
    238             psError(PS_ERR_UNKNOWN, false, "Unable to read HDU for cell.\n");
    239             return false;
    240         }
     236        // attempt to read in the desired data
     237        if (!hduReadFunc(hdu, fits)) {
     238            psError(PS_ERR_UNKNOWN, false, "Unable to read HDU for cell.\n");
     239            return false;
     240        }
    241241    }
    242242
     
    250250    // skip the image arrays completely for the header-only files
    251251    if (type == FPA_READ_TYPE_HEADER) {
    252         pmCellSetDataStatus(cell, true);
    253         return true;
     252        pmCellSetDataStatus(cell, true);
     253        return true;
    254254    }
    255255
    256256    // set up pointers for the different possible image arrays
    257     psArray *imageArray = NULL; // Array of images in the HDU
     257    psArray *imageArray = NULL; // Array of images in the HDU
    258258    psElemType imageType = PS_TYPE_F32; // Expected type for image
    259259    switch (type) {
     
    263263        break;
    264264      case FPA_READ_TYPE_MASK:
    265         imageArray = hdu->masks;
     265        imageArray = hdu->masks;
    266266        imageType = PS_TYPE_MASK;
    267267        break;
Note: See TracChangeset for help on using the changeset viewer.