IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 23184


Ignore:
Timestamp:
Mar 4, 2009, 2:03:08 PM (17 years ago)
Author:
Paul Price
Message:

Adding mask/flag values to header of CMF files.

Location:
trunk/psModules/src
Files:
2 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/psModules/src/objects/Makefile.am

    r21516 r23184  
    1919        pmModelUtils.c \
    2020        pmSource.c \
     21        pmSourceMasks.c \
    2122        pmSourceMoments.c \
    2223        pmSourceExtendedPars.c \
     
    6970        pmModelUtils.h \
    7071        pmSource.h \
     72        pmSourceMasks.h \
    7173        pmSourceExtendedPars.h \
    7274        pmSourceUtils.h \
  • trunk/psModules/src/objects/pmSource.h

    r21516 r23184  
    1919/// @addtogroup Objects Object Detection / Analysis Functions
    2020/// @{
     21
     22#include <pmSourceMasks.h>
    2123
    2224/** pmSourceType enumeration
     
    3436    PM_SOURCE_TYPE_EXTENDED,            ///< an extended object (eg, galaxy) (subtracted model is EXT)
    3537} pmSourceType;
    36 
    37 // bit flags to distinguish analysis results
    38 typedef enum {
    39     PM_SOURCE_MODE_DEFAULT          = 0x00000000, ///< Initial value: resets all bits
    40     PM_SOURCE_MODE_PSFMODEL         = 0x00000001, ///< Source fitted with a psf model (linear or non-linear)
    41     PM_SOURCE_MODE_EXTMODEL         = 0x00000002, ///< Source fitted with an extended-source model
    42     PM_SOURCE_MODE_FITTED           = 0x00000004, ///< Source fitted with non-linear model (PSF or EXT; good or bad)
    43     PM_SOURCE_MODE_FAIL             = 0x00000008, ///< Fit (non-linear) failed (non-converge, off-edge, run to zero)
    44     PM_SOURCE_MODE_POOR             = 0x00000010, ///< Fit succeeds, but low-SN, high-Chisq, or large (for PSF -- drop?)
    45     PM_SOURCE_MODE_PAIR             = 0x00000020, ///< Source fitted with a double psf
    46     PM_SOURCE_MODE_PSFSTAR          = 0x00000040, ///< Source used to define PSF model
    47     PM_SOURCE_MODE_SATSTAR          = 0x00000080, ///< Source model peak is above saturation
    48     PM_SOURCE_MODE_BLEND            = 0x00000100, ///< Source is a blend with other sourcers
    49     PM_SOURCE_MODE_EXTERNAL         = 0x00000200, ///< Source based on supplied input position
    50     PM_SOURCE_MODE_BADPSF           = 0x00000400, ///< Failed to get good estimate of object's PSF
    51     PM_SOURCE_MODE_DEFECT           = 0x00000800, ///< Source is thought to be a defect
    52     PM_SOURCE_MODE_SATURATED        = 0x00001000, ///< Source is thought to be saturated pixels (bleed trail)
    53     PM_SOURCE_MODE_CR_LIMIT         = 0x00002000, ///< Source has crNsigma above limit
    54     PM_SOURCE_MODE_EXT_LIMIT        = 0x00004000, ///< Source has extNsigma above limit
    55     PM_SOURCE_MODE_MOMENTS_FAILURE  = 0x00008000, ///< could not measure the moments
    56     PM_SOURCE_MODE_SKY_FAILURE      = 0x00010000, ///< could not measure the local sky
    57     PM_SOURCE_MODE_SKYVAR_FAILURE   = 0x00020000, ///< could not measure the local sky variance
    58     PM_SOURCE_MODE_BELOW_MOMENTS_SN = 0x00040000, ///< moments not measured due to low S/N
    59     PM_SOURCE_MODE_BIG_RADIUS       = 0x00100000, ///< poor moments for small radius, try large radius
    60     PM_SOURCE_MODE_AP_MAGS          = 0x00200000, ///< source has an aperture magnitude
    61     PM_SOURCE_MODE_BLEND_FIT        = 0x00400000, ///< source was fitted as a blend
    62     PM_SOURCE_MODE_EXTENDED_FIT     = 0x00800000, ///< full extended fit was used
    63     PM_SOURCE_MODE_EXTENDED_STATS   = 0x01000000, ///< extended aperture stats calculated
    64     PM_SOURCE_MODE_LINEAR_FIT       = 0x02000000, ///< source fitted with the linear fit
    65     PM_SOURCE_MODE_NONLINEAR_FIT    = 0x04000000, ///< source fitted with the non-linear fit
    66     PM_SOURCE_MODE_RADIAL_FLUX      = 0x08000000, ///< radial flux measurements calculated
    67     PM_SOURCE_MODE_SIZE_SKIPPED     = 0x10000000, ///< size could not be determined
    68 } pmSourceMode;
    6938
    7039typedef enum {
     
    10170    pmSourceType type;                  ///< Best identification of object.
    10271    pmSourceMode mode;                  ///< analysis flags set for object.
    103     pmSourceTmpF tmpFlags;              ///< internal-only flags
     72    pmSourceTmpF tmpFlags;              ///< internal-only flags
    10473    psArray *blends;                    ///< collection of sources thought to be confused with object
    10574    float psfMag;                       ///< calculated from flux in modelPSF
  • trunk/psModules/src/objects/pmSourceIO_CMF_PS1_V1.c

    r21528 r23184  
    209209    }
    210210
     211    psMetadata *header = psMetadataCopy(NULL, tableHeader);
     212    pmSourceMasksHeader(header);
     213
    211214    if (table->n == 0) {
    212         psFitsWriteBlank (fits, tableHeader, extname);
    213         psFree (table);
     215        psFitsWriteBlank(fits, header, extname);
     216        psFree(table);
     217        psFree(header);
    214218        return true;
    215219    }
    216220
    217221    psTrace ("pmFPAfile", 5, "writing ext data %s\n", extname);
    218     if (!psFitsWriteTable (fits, tableHeader, table, extname)) {
     222    if (!psFitsWriteTable(fits, header, table, extname)) {
    219223        psError(PS_ERR_IO, false, "writing ext data %s\n", extname);
    220224        psFree(table);
     225        psFree(header);
    221226        return false;
    222227    }
    223     psFree (table);
     228    psFree(table);
     229    psFree(header);
    224230
    225231    return true;
  • trunk/psModules/src/psmodules.h

    r22699 r23184  
    113113#include <pmPSF.h>
    114114#include <pmModel.h>
     115#include <pmSourceMasks.h>
    115116#include <pmSource.h>
    116117#include <pmSourceUtils.h>
Note: See TracChangeset for help on using the changeset viewer.