IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 9594


Ignore:
Timestamp:
Oct 16, 2006, 4:21:03 PM (20 years ago)
Author:
Paul Price
Message:

Documenting pmFPAMaskWeight.[ch]. Moving NOT_U8 and NOT_U16 macros into psLib (and renamed with PS_ prefix). Updating other files that use these macros so that they compile.

Location:
trunk/psModules/src
Files:
6 edited

Legend:

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

    r8815 r9594  
    9494//////////////////////////////////////////////////////////////////////////////////////////////////////////////
    9595
    96 bool pmReadoutSetMask(pmReadout *readout// Readout for which to set mask
    97                      )
     96bool pmReadoutSetMask(pmReadout *readout)
    9897{
    9998    PS_ASSERT_PTR_NON_NULL(readout, false);
     
    143142}
    144143
    145 bool pmReadoutGenerateMask(pmReadout *readout // Readout for which to generate mask
    146                           )
     144bool pmReadoutGenerateMask(pmReadout *readout)
    147145{
    148146    PS_ASSERT_PTR_NON_NULL(readout, false);
     
    190188}
    191189
    192 bool pmReadoutSetWeight(pmReadout *readout // Readout for which to set weight
    193                        )
     190bool pmReadoutSetWeight(pmReadout *readout)
    194191{
    195192    PS_ASSERT_PTR_NON_NULL(readout, false);
     
    219216}
    220217
    221 bool pmReadoutGenerateWeight(pmReadout *readout // Readout for which to generate weight
    222                             )
     218bool pmReadoutGenerateWeight(pmReadout *readout)
    223219{
    224220    PS_ASSERT_PTR_NON_NULL(readout, false);
     
    266262}
    267263
    268 bool pmCellGenerateMaskWeight(pmCell *cell // Cell for which to set weights
    269                              )
     264bool pmReadoutGenerateMaskWeight(pmReadout *readout)
     265{
     266    PS_ASSERT_PTR_NON_NULL(readout, false);
     267
     268    bool success = true;                // Was everything successful?
     269
     270    success |= pmReadoutGenerateMask(readout);
     271    success |= pmReadoutGenerateWeight(readout);
     272
     273    return success;
     274}
     275
     276bool pmCellGenerateMaskWeight(pmCell *cell)
    270277{
    271278    PS_ASSERT_PTR_NON_NULL(cell, false);
     
    275282    for (int i = 0; i < readouts->n; i++) {
    276283        pmReadout *readout = readouts->data[i]; // The readout
    277         success |= pmReadoutGenerateMask(readout);
    278         success |= pmReadoutGenerateWeight(readout);
     284        pmReadoutGenerateMaskWeight(readout);
    279285    }
    280286
     
    282288}
    283289
    284 bool pmReadoutGenerateMaskWeight(pmReadout *readout // Readout for which to set mask and weights
    285                                 )
    286 {
    287     PS_ASSERT_PTR_NON_NULL(readout, false);
    288 
    289     bool success = true;                // Was everything successful?
    290 
    291     success |= pmReadoutGenerateMask(readout);
    292     success |= pmReadoutGenerateWeight(readout);
    293 
    294     return success;
    295 }
  • trunk/psModules/src/camera/pmFPAMaskWeight.h

    r7715 r9594  
    1 #ifndef PM_READOUT_MASK_WEIGHT_H
    2 #define PM_READOUT_MASK_WEIGHT_H
     1/// @file pmFPAHeader.h
     2///
     3/// @brief Functions read FITS headers for FPA components
     4///
     5/// @ingroup Camera
     6///
     7/// @author Paul Price, IfA
     8/// @author Eugene Magnier, IfA
     9///
     10/// @version $Revision: 1.5 $ $Name: not supported by cvs2svn $
     11/// @date $Date: 2006-10-17 02:21:03 $
     12///
     13/// Copyright 2005-2006 Institute for Astronomy, University of Hawaii
     14///
     15#ifndef PM_FPA_MASK_WEIGHT_H
     16#define PM_FPA_MASK_WEIGHT_H
    317
    418#include "pmFPA.h"
    519
    6 // these defines are necessary to yield 8-bit results (use instead of ~)
    7 #define NOT_U8(A)(UCHAR_MAX-(A))
    8 #define NOT_U16(A)(USHORT_MAX-(A))
    9 
    10 /** Mask values */
     20/// Pixel mask values
    1121typedef enum {
    1222    PM_MASK_CLEAR   = 0x00,   ///< The pixel is not masked
     
    2131} pmMaskValue;
    2232
    23 // These functions set an extant mask/weight (or create a throwaway one).
    24 // The throwaway case is intended for when the user is iterating using pmReadoutReadNext, in which case
    25 // the HDU can't be generated
    26 bool pmReadoutSetMask(pmReadout *readout // Readout for which to set mask
     33
     34/// Set a temporary readout mask using CELL.SATURATION and CELL.BAD
     35///
     36/// Identifies pixels that are saturated (>= CELL.SATURATION) or bad (<= CELL.BAD).  The mask that is produced
     37/// within the readout is temporary --- it is not added to the HDU.  This is intended for when the user is
     38/// iterating using pmReadoutReadNext, in which case the HDU can't be generated.
     39bool pmReadoutSetMask(pmReadout *readout ///< Readout for which to set mask
    2740                     );
    28 bool pmReadoutSetWeight(pmReadout *readout // Readout for which to set weight
     41
     42
     43/// Set a temporary readout weight map using CELL.GAIN and CELL.READNOISE
     44///
     45/// Calculates weights (actually variances) for each pixel using photon statistics and the cell gain
     46/// (CELL.GAIN) and read noise (CELL.READNOISE).  The weight map that is produced within the readout is
     47/// temporary --- it is not added to the HDU.  This is intended for when the user is iterating using
     48/// pmReadoutReadNext, in which case the HDU can't be generated.
     49bool pmReadoutSetWeight(pmReadout *readout ///< Readout for which to set weight
    2950                       );
    3051
    31 // These functions generate a mask/weight suitable for output (complete with HDU entry) and then set them.
    32 bool pmReadoutGenerateMask(pmReadout *readout // Readout for which to generate mask
     52/// Generate a readout mask (suitable for output) using CELL.SATURATION and CELL.BAD
     53///
     54/// Identifies pixels that are saturated (>= CELL.SATURATION) or bad (<= CELL.BAD).  The mask that is produced
     55/// is suitable for output (complete with HDU entry).  This is intended for most operations.
     56bool pmReadoutGenerateMask(pmReadout *readout ///< Readout for which to generate mask
    3357                          );
    34 bool pmReadoutGenerateWeight(pmReadout *readout // Readout for which to generate weight
     58
     59/// Generate a weight map (suitable for output) using CELL.GAIN and CELL.READNOISE
     60///
     61/// Calculates weights (actually variances) for each pixel using photon statistics and the cell gain
     62/// (CELL.GAIN) and read noise (CELL.READNOISE).  The weight map that is produced within the readout is
     63/// suitable for output (complete with HDU entry).  This is intended for most operations.
     64bool pmReadoutGenerateWeight(pmReadout *readout ///< Readout for which to generate weight
    3565                            );
    3666
    37 // These functions are conveniences for pmReadoutGenerateMask and pmReadoutGenerateWeight.
    38 bool pmCellGenerateMaskWeight(pmCell *cell // Cell for which to generate mask and weights
     67/// Generate mask and weight map for a readout
     68///
     69/// Calls pmReadoutGenerateMask and pmReadoutGenerateWeight for the readout
     70bool pmReadoutGenerateMaskWeight(pmReadout *readout ///< Readout for which to generate mask and weights
     71                                );
     72
     73/// Generate mask and weight maps for all readouts within a cell
     74///
     75/// Calls pmReadoutGenerateMaskWeight for each readout within the cell.
     76bool pmCellGenerateMaskWeight(pmCell *cell ///< Cell for which to generate mask and weights
    3977                             );
    40 bool pmReadoutGenerateMaskWeight(pmReadout *readout // Readout for which to generate mask and weights
    41                                 );
     78
    4279
    4380
  • trunk/psModules/src/camera/pmFPAfileIO.c

    r9585 r9594  
    605605            pmFPAfile *file = item->data.V;
    606606            if (state) {
    607                 file->state &= NOT_U8(PM_FPA_STATE_INACTIVE);
     607                file->state &= PS_NOT_U8(PM_FPA_STATE_INACTIVE);
    608608            } else {
    609609                file->state |= PM_FPA_STATE_INACTIVE;
     
    625625    }
    626626    if (state) {
    627         file->state &= NOT_U8(PM_FPA_STATE_INACTIVE);
     627        file->state &= PS_NOT_U8(PM_FPA_STATE_INACTIVE);
    628628    } else {
    629629        file->state |= PM_FPA_STATE_INACTIVE;
  • trunk/psModules/src/objects/pmPSFtry.c

    r9564 r9594  
    55 *  @author EAM, IfA
    66 *
    7  *  @version $Revision: 1.19 $ $Name: not supported by cvs2svn $
    8  *  @date $Date: 2006-10-14 00:56:37 $
     7 *  @version $Revision: 1.20 $ $Name: not supported by cvs2svn $
     8 *  @date $Date: 2006-10-17 02:21:03 $
    99 *
    1010 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    121121        psImageKeepCircle (source->mask, x, y, RADIUS, "OR", PM_MASK_MARK);
    122122        status = pmSourceFitModel (source, model, PM_SOURCE_FIT_EXT);
    123         psImageKeepCircle (source->mask, x, y, RADIUS, "AND", NOT_U8(PM_MASK_MARK));
     123        psImageKeepCircle (source->mask, x, y, RADIUS, "AND", PS_NOT_U8(PM_MASK_MARK));
    124124
    125125        // exclude the poor fits
     
    183183
    184184next_source:
    185         psImageKeepCircle (source->mask, x, y, RADIUS, "AND", NOT_U8(PM_MASK_MARK));
     185        psImageKeepCircle (source->mask, x, y, RADIUS, "AND", PS_NOT_U8(PM_MASK_MARK));
    186186
    187187    }
  • trunk/psModules/src/objects/pmSourcePhotometry.c

    r9528 r9594  
    33 *  @author EAM, IfA; GLG, MHPCC
    44 *
    5  *  @version $Revision: 1.10 $ $Name: not supported by cvs2svn $
    6  *  @date $Date: 2006-10-13 02:29:14 $
     5 *  @version $Revision: 1.11 $ $Name: not supported by cvs2svn $
     6 *  @date $Date: 2006-10-17 02:21:03 $
    77 *
    88 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    144144
    145145    // unmask aperture
    146     psImageKeepCircle (source->mask, x, y, model->radiusTMP, "AND", NOT_U8(PM_MASK_MARK));
     146    psImageKeepCircle (source->mask, x, y, model->radiusTMP, "AND", PS_NOT_U8(PM_MASK_MARK));
    147147
    148148    // subtract object, leave local sky
  • trunk/psModules/src/objects/pmSourceSky.c

    r8815 r9594  
    66 *  @author EAM, IfA: significant modifications.
    77 *
    8  *  @version $Revision: 1.8 $ $Name: not supported by cvs2svn $
    9  *  @date $Date: 2006-09-15 09:49:01 $
     8 *  @version $Revision: 1.9 $ $Name: not supported by cvs2svn $
     9 *  @date $Date: 2006-10-17 02:21:03 $
    1010 *
    1111 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    7070    psStats *myStats = psStatsAlloc(statsOptions);
    7171    myStats = psImageStats(myStats, image, mask, 0xff);
    72     psImageMaskRegion(mask, srcRegion, "AND", NOT_U8(PM_MASK_MARK));
     72    psImageMaskRegion(mask, srcRegion, "AND", PS_NOT_U8(PM_MASK_MARK));
    7373    double value = psStatsGetValue(myStats, statistic);
    7474    psFree(myStats);
     
    117117    psStats *myStats = psStatsAlloc(statsOptions);
    118118    myStats = psImageStats(myStats, image, mask, 0xff);
    119     psImageMaskRegion(mask, srcRegion, "AND", NOT_U8(PM_MASK_MARK));
     119    psImageMaskRegion(mask, srcRegion, "AND", PS_NOT_U8(PM_MASK_MARK));
    120120    double value = psStatsGetValue(myStats, statistic);
    121121    psFree(myStats);
Note: See TracChangeset for help on using the changeset viewer.