IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 18364


Ignore:
Timestamp:
Jun 29, 2008, 2:53:45 PM (18 years ago)
Author:
eugene
Message:

defer construction of blank of concepts until element is used

Location:
trunk/psModules/src
Files:
6 edited

Legend:

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

    r17986 r18364  
    303303
    304304    tmpCell->concepts = psMetadataAlloc();
    305     tmpCell->conceptsRead = PM_CONCEPT_SOURCE_NONE;
    306305    if (!psMetadataAddStr(tmpCell->concepts, PS_LIST_HEAD, "CELL.NAME", 0, NULL, name)) {
    307306        psErrorClear();
    308307        psWarning("Could not add CELL.NAME to metadata.");
    309308    }
    310     pmConceptsBlankCell(tmpCell);
     309    tmpCell->conceptsRead = PM_CONCEPT_SOURCE_NONE;
     310    // XXX does this work?  moved to conceptsRead... pmConceptsBlankCell(tmpCell);
    311311
    312312    return tmpCell;
     
    342342
    343343    tmpChip->concepts = psMetadataAlloc();
    344     tmpChip->conceptsRead = PM_CONCEPT_SOURCE_NONE;
    345344    if (!psMetadataAddStr(tmpChip->concepts, PS_LIST_HEAD, "CHIP.NAME", 0, NULL, name)) {
    346345        psErrorClear();
    347346        psWarning("Could not add CHIP.NAME %s to concepts.", name);
    348347    }
    349     pmConceptsBlankChip(tmpChip);
     348    tmpChip->conceptsRead = PM_CONCEPT_SOURCE_NONE;
     349    // XXX does this work?  moved to conceptsRead... pmConceptsBlankChip(tmpChip);
    350350    return tmpChip;
    351351}
     
    372372
    373373    tmpFPA->concepts = psMetadataAlloc();
    374     tmpFPA->conceptsRead = PM_CONCEPT_SOURCE_NONE;
    375     pmConceptsBlankFPA(tmpFPA);
    376 
    377374    if (!psMetadataAddStr(tmpFPA->concepts, PS_LIST_TAIL, "FPA.CAMERA", PS_META_REPLACE,
    378375                          "Camera name (according to configuration)", cameraName)) {
     
    380377        psWarning("Could not add FPA.CAMERA %s to concepts.", cameraName);
    381378    }
     379    tmpFPA->conceptsRead = PM_CONCEPT_SOURCE_NONE;
     380    // XXX does this work?  moved to conceptsRead... pmConceptsBlankFPA(tmpFPA);
    382381
    383382    // this may be somewhat pedantic, but it makes these things consistent
  • trunk/psModules/src/camera/pmFPAfileFitsIO.h

    r18330 r18364  
    55 * @author PAP, IfA
    66 *
    7  * @version $Revision: 1.13 $ $Name: not supported by cvs2svn $
    8  * @date $Date: 2008-06-26 21:11:56 $
     7 * @version $Revision: 1.14 $ $Name: not supported by cvs2svn $
     8 * @date $Date: 2008-06-30 00:53:45 $
    99 * Copyright 2004-2005 Institute for Astronomy, University of Hawaii
    1010 */
  • trunk/psModules/src/camera/pmFPAfileIO.h

    r18330 r18364  
    55 * @author PAP, IfA
    66 *
    7  * @version $Revision: 1.8 $ $Name: not supported by cvs2svn $
    8  * @date $Date: 2008-06-26 21:11:56 $
     7 * @version $Revision: 1.9 $ $Name: not supported by cvs2svn $
     8 * @date $Date: 2008-06-30 00:53:45 $
    99 * Copyright 2004-2005 Institute for Astronomy, University of Hawaii
    1010 */
  • trunk/psModules/src/concepts/pmConcepts.c

    r18178 r18364  
    191191// Read all registered concepts for the specified level
    192192static bool conceptsRead(psMetadata **specs, // One of the concepts specifications
    193                          const pmFPA *fpa,    // The FPA
    194                          const pmChip *chip,  // The chip
    195                          const pmCell *cell, // The cell
     193                         pmFPA *fpa,    // The FPA
     194                         pmChip *chip,  // The chip
     195                         pmCell *cell, // The cell
    196196                         unsigned int *read,     // What's already been read
    197197                         pmConceptSource source, // The source of the concepts to read
     
    215215    }
    216216    pmHDU *hduHigh = pmHDUGetHighest(fpa, chip, cell); // Highest HDU
     217
     218    if (cell && (cell->conceptsRead == PM_CONCEPT_SOURCE_NONE)) {
     219        pmConceptsBlankCell(cell);
     220        cell->conceptsRead = PM_CONCEPT_SOURCE_BLANK;
     221    }
     222    if (chip && (chip->conceptsRead == PM_CONCEPT_SOURCE_NONE)) {
     223        pmConceptsBlankChip(chip);
     224        chip->conceptsRead = PM_CONCEPT_SOURCE_BLANK;
     225    }
     226    if (fpa && (fpa->conceptsRead == PM_CONCEPT_SOURCE_NONE)) {
     227        pmConceptsBlankFPA(fpa);
     228        fpa->conceptsRead = PM_CONCEPT_SOURCE_BLANK;
     229    }
    217230
    218231    bool success = true;                // Success in reading concepts?
  • trunk/psModules/src/concepts/pmConcepts.h

    r18163 r18364  
    44 * @author Paul Price, IfA
    55 *
    6  * @version $Revision: 1.18 $ $Name: not supported by cvs2svn $
    7  * @date $Date: 2008-06-17 22:16:38 $
     6 * @version $Revision: 1.19 $ $Name: not supported by cvs2svn $
     7 * @date $Date: 2008-06-30 00:53:45 $
    88 * Copyright 2005-2006 Institute for Astronomy, University of Hawaii
    99 */
     
    2424typedef enum {
    2525    PM_CONCEPT_SOURCE_NONE     = 0x00,  ///< No concepts
    26     PM_CONCEPT_SOURCE_CELLS    = 0x01,  ///< Concept comes from the camera information
    27     PM_CONCEPT_SOURCE_DEFAULTS = 0x02,  ///< Concept comes from defaults
    28     PM_CONCEPT_SOURCE_PHU      = 0x04,  ///< Concept comes from PHU
    29     PM_CONCEPT_SOURCE_HEADER   = 0x08,  ///< Concept comes from FITS header
    30     PM_CONCEPT_SOURCE_DATABASE = 0x10,  ///< Concept comes from database
    31     PM_CONCEPT_SOURCE_ALL      = 0xff   ///< All concepts
     26    PM_CONCEPT_SOURCE_BLANK    = 0x01,  ///< Blank concepts defined, but not read
     27    PM_CONCEPT_SOURCE_CELLS    = 0x02,  ///< Concept comes from the camera information
     28    PM_CONCEPT_SOURCE_DEFAULTS = 0x04,  ///< Concept comes from defaults
     29    PM_CONCEPT_SOURCE_PHU      = 0x08,  ///< Concept comes from PHU
     30    PM_CONCEPT_SOURCE_HEADER   = 0x10,  ///< Concept comes from FITS header
     31    PM_CONCEPT_SOURCE_DATABASE = 0x20,  ///< Concept comes from database
     32    PM_CONCEPT_SOURCE_ALL      = 0xfe   ///< All concepts (exclude BLANK)
    3233} pmConceptSource;
    3334
  • trunk/psModules/src/detrend/pmMaskBadPixels.c

    r17228 r18364  
    100100    if (suspect) {
    101101        PS_ASSERT_IMAGE_NON_EMPTY(suspect, false);
    102         PS_ASSERT_IMAGE_TYPE(suspect, PS_TYPE_S32, false);
     102        PS_ASSERT_IMAGE_TYPE(suspect, PS_TYPE_F32, false);
    103103        PS_ASSERT_IMAGES_SIZE_EQUAL(readout->image, suspect, false);
    104104        psMemIncrRefCounter(suspect);
    105105    } else {
    106         suspect = psImageAlloc(readout->image->numCols, readout->image->numRows, PS_TYPE_S32);
     106        suspect = psImageAlloc(readout->image->numCols, readout->image->numRows, PS_TYPE_F32);
    107107        psImageInit(suspect, 0);
    108108        psMetadataAddImage(output->analysis, PS_LIST_TAIL, PM_MASK_ANALYSIS_SUSPECT, PS_META_REPLACE,
     
    115115        // If we get down here and the statistics are missing, then we should go and mask the entire image
    116116        psWarning("Missing statistics --- flagging entire image as suspect.");
    117         return (psImage*)psBinaryOp(suspect, suspect, "+", psScalarAlloc(1.0, PS_TYPE_S32));
     117        return (psImage*)psBinaryOp(suspect, suspect, "+", psScalarAlloc(1.0, PS_TYPE_F32));
    118118    }
    119119
     
    126126        for (int x = 0; x < image->numCols; x++) {
    127127            if (fabs((image->data.F32[y][x] - median) / stdev) >= rej &&
    128                     (!mask || !(mask->data.PS_TYPE_MASK_DATA[y][x] & maskVal))) {
    129                 suspect->data.S32[y][x]++;
     128                (!mask || !(mask->data.PS_TYPE_MASK_DATA[y][x] & maskVal))) {
     129                suspect->data.F32[y][x] += 1.0;
    130130            }
    131131        }
     
    149149    }
    150150    PS_ASSERT_IMAGE_NON_EMPTY(suspects, false);
    151     PS_ASSERT_IMAGE_TYPE(suspects, PS_TYPE_S32, false);
     151    PS_ASSERT_IMAGE_TYPE(suspects, PS_TYPE_F32, false);
    152152    if (output->mask) {
    153153        PS_ASSERT_IMAGE_NON_EMPTY(output->mask, false);
     
    243243    for (int y = 0; y < suspects->numRows; y++) {
    244244        for (int x = 0; x < suspects->numCols; x++) {
    245             if (suspects->data.S32[y][x] >= limit) {
     245            if (suspects->data.F32[y][x] >= limit) {
    246246                badpix->data.PS_TYPE_MASK_DATA[y][x] = maskVal;
    247247            }
Note: See TracChangeset for help on using the changeset viewer.