IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 15398


Ignore:
Timestamp:
Oct 28, 2007, 3:37:48 PM (19 years ago)
Author:
eugene
Message:

adding extended parameters to source; adding astrometry table for I/O; adding extended source table to PS1_DEV_1

Location:
branches/eam_branch_20071023/psModules/src
Files:
3 added
12 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branch_20071023/psModules/src/astrom/Makefile.am

    r12519 r15398  
    88        pmAstrometryDistortion.c \
    99        pmAstrometryUtils.c \
     10        pmAstrometryTable.c \
    1011        pmAstrometryWCS.c
    1112
     
    1516        pmAstrometryDistortion.h \
    1617        pmAstrometryUtils.h \
     18        pmAstrometryTable.h \
    1719        pmAstrometryWCS.h
    1820
  • branches/eam_branch_20071023/psModules/src/astrom/pmAstrometryTable.c

    r15357 r15398  
    11/** @file  pmAstrometryObjects.c
    2 *
    3 *  @brief This file defines the basic types for matching objects
    4 *  based on their astrometry.
    5 *
    6 *  @ingroup AstroImage
    7 *
    8 *  @author EAM, IfA
    9 *
    10 *  @version $Revision: 1.1 $ $Name: not supported by cvs2svn $
    11 *  @date $Date: 2007-10-23 20:52:42 $
    12 *
    13 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
    14 */
     2 *
     3 *  @brief This file defines the basic types for matching objects
     4 *  based on their astrometry.
     5 *
     6 *  @ingroup AstroImage
     7 *
     8 *  @author EAM, IfA
     9 *
     10 *  @version $Revision: 1.1.2.1 $ $Name: not supported by cvs2svn $
     11 *  @date $Date: 2007-10-29 01:37:48 $
     12 *
     13 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     14 */
    1515
    1616#ifdef HAVE_CONFIG_H
     
    2929#include <pslib.h>
    3030
     31#include "pmConfig.h"
     32#include "pmDetrendDB.h"
    3133#include "pmHDU.h"
    3234#include "pmFPA.h"
    33 #include "pmAstrometryObjects.h"
     35#include "pmFPALevel.h"
     36#include "pmFPAview.h"
     37#include "pmFPAfile.h"
     38#include "pmAstrometryTable.h"
     39
    3440
    3541/********************* CheckDataStatus functions *****************************/
     
    179185bool pmAstromWriteChip (pmChip *chip, const pmFPAview *view, pmFPAfile *file, const pmConfig *config)
    180186{
    181     // define the EXTNAME values used for the table data, and residual image segments
    182     {
    183         // lookup the EXTNAME values used for table data and image header segments
    184         char *rule = NULL;
    185 
    186         // Menu of EXTNAME rules
    187         psMetadata *menu = psMetadataLookupMetadata(&status, file->camera, "EXTNAME.RULES");
    188         if (!menu) {
    189             psError(PS_ERR_UNKNOWN, true, "missing EXTNAME.RULES in camera.config");
    190             return false;
    191         }
    192 
    193         // EXTNAME for image header
    194         rule = psMetadataLookupStr(&status, menu, "ASTROMETRY");
    195         if (!rule) {
    196             psError(PS_ERR_UNKNOWN, false, "missing entry for ASTROMETRY in EXTNAME.RULES in camera.config");
    197             return false;
    198         }
    199         extname = pmFPAfileNameFromRule (rule, file, view);
    200     }
     187    bool status;
     188    // *** define the EXTNAME values used for the table data, and residual image segments ***
     189
     190    // lookup the EXTNAME values used for table data and image header segments
     191    char *rule = NULL;
     192
     193    // Menu of EXTNAME rules
     194    psMetadata *menu = psMetadataLookupMetadata(&status, file->camera, "EXTNAME.RULES");
     195    if (!menu) {
     196        psError(PS_ERR_UNKNOWN, true, "missing EXTNAME.RULES in camera.config");
     197        return false;
     198    }
     199
     200    // EXTNAME for image header
     201    rule = psMetadataLookupStr(&status, menu, "ASTROMETRY");
     202    if (!rule) {
     203        psError(PS_ERR_UNKNOWN, false, "missing entry for ASTROMETRY in EXTNAME.RULES in camera.config");
     204        return false;
     205    }
     206
     207    // XXX need to finish this: uncomment when used
     208    # if (0)
     209    char *extname = pmFPAfileNameFromRule (rule, file, view);
     210    # endif
    201211
    202212    // write the chip elements in the following form:
     
    244254bool pmAstromReadChip (pmChip *chip, const pmFPAview *view, pmFPAfile *file, const pmConfig *config)
    245255{
    246     // define the EXTNAME values used for the table data, and residual image segments
    247     {
    248         // lookup the EXTNAME values used for table data and image header segments
    249         char *rule = NULL;
    250 
    251         // Menu of EXTNAME rules
    252         psMetadata *menu = psMetadataLookupMetadata(&status, file->camera, "EXTNAME.RULES");
    253         if (!menu) {
    254             psError(PS_ERR_UNKNOWN, true, "missing EXTNAME.RULES in camera.config");
    255             return false;
    256         }
    257 
    258         // EXTNAME for image header
    259         rule = psMetadataLookupStr(&status, menu, "ASTROMETRY");
    260         if (!rule) {
    261             psError(PS_ERR_UNKNOWN, false, "missing entry for ASTROMETRY in EXTNAME.RULES in camera.config");
    262             return false;
    263         }
    264         extname = pmFPAfileNameFromRule (rule, file, view);
    265     }
     256    bool status;
     257
     258    // lookup the EXTNAME values used for table data and image header segments
     259    char *rule = NULL;
     260
     261    // Menu of EXTNAME rules
     262    psMetadata *menu = psMetadataLookupMetadata(&status, file->camera, "EXTNAME.RULES");
     263    if (!menu) {
     264        psError(PS_ERR_UNKNOWN, true, "missing EXTNAME.RULES in camera.config");
     265        return false;
     266    }
     267
     268    // EXTNAME for image header
     269    rule = psMetadataLookupStr(&status, menu, "ASTROMETRY");
     270    if (!rule) {
     271        psError(PS_ERR_UNKNOWN, false, "missing entry for ASTROMETRY in EXTNAME.RULES in camera.config");
     272        return false;
     273    }
     274
     275    // XXX finish this: uncomment when used
     276    # if (0)
     277    char *extname = pmFPAfileNameFromRule (rule, file, view);
     278    # endif
    266279
    267280    // read the chip elements in the following form:
  • branches/eam_branch_20071023/psModules/src/camera/pmFPAfile.h

    r15180 r15398  
    44 * @author EAM, IfA
    55 *
    6  * @version $Revision: 1.22 $ $Name: not supported by cvs2svn $
    7  * @date $Date: 2007-10-03 21:32:43 $
     6 * @version $Revision: 1.22.2.1 $ $Name: not supported by cvs2svn $
     7 * @date $Date: 2007-10-29 01:37:48 $
    88 * Copyright 2004-2005 Institute for Astronomy, University of Hawaii
    99 */
     
    3535    PM_FPA_FILE_FRINGE,
    3636    PM_FPA_FILE_HEADER,
     37    PM_FPA_FILE_ASTROM,
    3738} pmFPAfileType;
    3839
  • branches/eam_branch_20071023/psModules/src/camera/pmFPAfileIO.c

    r15359 r15398  
    3434#include "pmResiduals.h"
    3535#include "pmPSF_IO.h"
     36#include "pmAstrometryTable.h"
    3637#include "pmFPA_JPEG.h"
    3738#include "pmSourcePlots.h"
  • branches/eam_branch_20071023/psModules/src/detrend/pmDetrendDB.c

    r13775 r15398  
    101101        DETREND_STRING_CASE (SHUTTER);
    102102        DETREND_STRING_CASE (FRINGE);
     103        DETREND_STRING_CASE (ASTROM);
    103104    default:
    104105        return NULL;
  • branches/eam_branch_20071023/psModules/src/detrend/pmDetrendDB.h

    r13775 r15398  
    99 * @author EAM, IfA
    1010 *
    11  * @version $Revision: 1.13 $ $Name: not supported by cvs2svn $
    12  * @date $Date: 2007-06-13 03:42:33 $
     11 * @version $Revision: 1.13.14.1 $ $Name: not supported by cvs2svn $
     12 * @date $Date: 2007-10-29 01:37:48 $
    1313 * Copyright 2004-2005 Institute for Astronomy, University of Hawaii
    1414 */
     
    2929    PM_DETREND_TYPE_FRINGE,
    3030    PM_DETREND_TYPE_BACKGROUND,
     31    PM_DETREND_TYPE_ASTROM,
    3132} pmDetrendType;
    3233
  • branches/eam_branch_20071023/psModules/src/objects/Makefile.am

    r15039 r15398  
    1010     pmModelUtils.c \
    1111     pmSource.c \
     12     pmSourceExtendedPars.c \
    1213     pmSourceUtils.c \
    1314     pmSourceSky.c \
     
    5051     pmModelUtils.h \
    5152     pmSource.h \
     53     pmSourceExtendedPars.h \
    5254     pmSourceUtils.h \
    5355     pmSourceSky.h \
  • branches/eam_branch_20071023/psModules/src/objects/pmModel.c

    r15359 r15398  
    66 *  @author EAM, IfA
    77 *
    8  *  @version $Revision: 1.15.6.1 $ $Name: not supported by cvs2svn $
    9  *  @date $Date: 2007-10-23 20:54:53 $
     8 *  @version $Revision: 1.15.6.2 $ $Name: not supported by cvs2svn $
     9 *  @date $Date: 2007-10-29 01:37:48 $
    1010 *
    1111 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    217217        Ro = psImageInterpolateOptionsAlloc(
    218218            PS_INTERPOLATE_BILINEAR,
    219             model->residuals->Ro, NULL, model->mask, 0, 0.0, 0.0, 1, 0, 0.0);
     219            model->residuals->Ro, NULL, mask, 0, 0.0, 0.0, 1, 0, 0.0);
    220220        Rx = psImageInterpolateOptionsAlloc(
    221221            PS_INTERPOLATE_BILINEAR,
  • branches/eam_branch_20071023/psModules/src/objects/pmSource.h

    r15359 r15398  
    33 * @author EAM, IfA; GLG, MHPCC
    44 *
    5  * @version $Revision: 1.18.2.1 $ $Name: not supported by cvs2svn $
    6  * @date $Date: 2007-10-23 20:54:53 $
     5 * @version $Revision: 1.18.2.2 $ $Name: not supported by cvs2svn $
     6 * @date $Date: 2007-10-29 01:37:48 $
    77 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii
    88 */
     
    1010# ifndef PM_SOURCE_H
    1111# define PM_SOURCE_H
     12
     13# include "pmSourceExtendedPars.h"
    1214
    1315/// @addtogroup Objects Object Detection / Analysis Functions
     
    8486    psRegion region;                    ///< area on image covered by selected pixels
    8587    float sky, skyErr;                  ///< The sky and its error at the center of the object
    86     pmSourceExtendedParameters *extpars; // extended source parameters
     88    pmSourceExtendedPars *extpars;      ///< extended source parameters
    8789};
    88 
    89 typedef struct {
    90   psVector *radius;
    91   psVector *flux;
    92 } pmSourceRadialProfile;
    93 
    94 typedef struct {
    95   psVector *flux;
    96   psVector *fluxVar; // measured variance
    97   psVector *fluxErr; // formal error
    98 } pmSourceAnnuli;
    99 
    100 typedef struct {
    101   float mag;
    102   float magErr;
    103   float rad;
    104   float radErr;
    105 } pmSourceIsophotalValues;
    106 
    107 typedef struct {
    108   float mag;
    109   float magErr;
    110   float rad;
    111   float radErr;
    112 } pmSourcePetrosianValues;
    113 
    114 typedef struct {
    115   float mag;
    116   float magErr;
    117   float rad;
    118   float radErr;
    119 } pmSourceKronValues;
    120 
    121 typedef struct {
    122   pmSourceRadialProfile   *profile;
    123   pmSourceAnnuli          *annuli;
    124   pmSourceIsophotalValues *isophot;
    125   pmSourcePetrosianValues *petrosian;
    126   pmSourceKronValues      *kron;
    127 } pmSourceExtendedParameters;
    12890
    12991/** pmPSFClump data structure
  • branches/eam_branch_20071023/psModules/src/objects/pmSourceIO.c

    r15359 r15398  
    33 *  @author EAM, IfA
    44 *
    5  *  @version $Revision: 1.52.2.1 $ $Name: not supported by cvs2svn $
    6  *  @date $Date: 2007-10-23 20:54:53 $
     5 *  @version $Revision: 1.52.2.2 $ $Name: not supported by cvs2svn $
     6 *  @date $Date: 2007-10-29 01:37:48 $
    77 *
    88 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    286286        // get the current header
    287287        hdu = pmFPAviewThisHDU (view, file->fpa);
     288
     289        // determine the output table format
     290        psMetadata *recipe = psMetadataLookupMetadata(&status, config->recipes, "PSPHOT");
     291        if (!status) {
     292          psError(PS_ERR_UNKNOWN, true, "missing recipe PSPHOT in config data");
     293          return false;
     294        }
     295
     296        // if this is not TRUE, the output files only contain the psf measurements.
     297        bool XSRC_OUTPUT = psMetadataLookupBool(&status, recipe, "SAVE.XSRC");
    288298
    289299        // define the EXTNAME values for the different data segments:
     
    362372            outhead = psMetadataAlloc ();
    363373
    364             // determine the output table format
    365             psMetadata *recipe = psMetadataLookupMetadata(&status, config->recipes, "PSPHOT");
    366             if (!status) {
    367                 psError(PS_ERR_UNKNOWN, true, "missing recipe PSPHOT in config data");
    368                 return false;
    369             }
    370374            exttype = psMemIncrRefCounter (psMetadataLookupStr(&status, recipe, "OUTPUT.FORMAT"));
    371375            if (!exttype) {
  • branches/eam_branch_20071023/psModules/src/objects/pmSourceIO.h

    r15039 r15398  
    44 * @author EAM, IfA; GLG, MHPCC
    55 *
    6  * @version $Revision: 1.12 $ $Name: not supported by cvs2svn $
    7  * @date $Date: 2007-09-27 03:35:29 $
     6 * @version $Revision: 1.12.2.1 $ $Name: not supported by cvs2svn $
     7 * @date $Date: 2007-10-29 01:37:48 $
    88 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii
    99 *
     
    2626bool pmSourcesWrite_SMPDATA (psFits *fits, psArray *sources, psMetadata *imageHeader, psMetadata *tableHeader, char *extname);
    2727bool pmSourcesWrite_PS1_DEV_0 (psFits *fits, psArray *sources, psMetadata *imageHeader, psMetadata *tableHeader, char *extname);
    28 bool pmSourcesWrite_PS1_DEV_1 (psFits *fits, psArray *sources, psMetadata *imageHeader, psMetadata *tableHeader, char *extname);
     28bool pmSourcesWrite_PS1_DEV_1 (psFits *fits, psArray *sources, psMetadata *imageHeader, psMetadata *tableHeader, char *extname, char *xsrcname);
     29bool pmSourcesWrite_PS1_DEV_1_XSRC (psFits *fits, psArray *sources, char *extname);
    2930
    3031bool pmSource_CMF_WritePHU (const pmFPAview *view, pmFPAfile *file, const pmConfig *config);
  • branches/eam_branch_20071023/psModules/src/objects/pmSourceIO_PS1_DEV_1.c

    r15359 r15398  
    33 *  @author EAM, IfA
    44 *
    5  *  @version $Revision: 1.4.2.1 $ $Name: not supported by cvs2svn $
    6  *  @date $Date: 2007-10-23 20:54:53 $
     5 *  @version $Revision: 1.4.2.2 $ $Name: not supported by cvs2svn $
     6 *  @date $Date: 2007-10-29 01:37:48 $
    77 *
    88 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    6060    // if we request XSRC output, add the XSRC name to this header
    6161    if (xsrcname) {
    62       psMetadataAddStr (tableHeader, PS_LIST_TAIL, "EXTXSRC", PS_META_REPLACE, "name of XSRC table extension", xsrcname);
     62      psMetadataAddStr (tableHeader, PS_LIST_TAIL, "XSRCNAME", PS_META_REPLACE, "name of XSRC table extension", xsrcname);
    6363    }
    6464
     
    152152
    153153    if (xsrcname) {
    154       pmSourcesWriteXSRC_PS1_DEV_1 (file->fits, sources, xsrcname);
     154      pmSourcesWrite_PS1_DEV_1_XSRC (fits, sources, xsrcname);
    155155    }
    156156
     
    174174    }
    175175    assert (modelType > -1);
     176
     177    // XXX need to look up the XSRCNAME entries
    176178
    177179    // validate a single row of the table (must match SMP)
     
    251253}
    252254
    253 bool pmSourcesWriteXSRC_PS1_DEV_1 (psFits *fits, psArray *sources, char *extname)
     255bool pmSourcesWrite_PS1_DEV_1_XSRC (psFits *fits, psArray *sources, char *extname)
    254256{
    255257
     
    263265
    264266    // create a header to hold the output data
    265     outhead = psMetadataAlloc ();
     267    psMetadata *outhead = psMetadataAlloc ();
    266268
    267269    // write the links to the image header
Note: See TracChangeset for help on using the changeset viewer.