IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Sep 22, 2006, 2:29:31 AM (20 years ago)
Author:
rhl
Message:

[Start to] provide symbolic names for parameters

Location:
trunk/psModules/src/objects
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/psModules/src/objects/pmModel.h

    r6872 r8882  
    66 *  @author EAM, IfA
    77 *
    8  *  @version $Revision: 1.2 $ $Name: not supported by cvs2svn $
    9  *  @date $Date: 2006-04-17 18:01:05 $
     8 *  @version $Revision: 1.3 $ $Name: not supported by cvs2svn $
     9 *  @date $Date: 2006-09-22 12:24:38 $
    1010 *
    1111 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    4949}
    5050pmModel;
     51
     52/** Symbolic names for the elements of [d]params
     53 * Note: these are #defines not enums as a given element of [d]params
     54 * may/will correspond to different parameters in different contexts
     55 */
     56#define PM_PAR_SKY 0   // Sky
     57#define PM_PAR_FLUX 1   // Flux
     58#define PM_PAR_XPOS 2   // X centre of object
     59#define PM_PAR_YPOS 3   // Y centre of object
     60#define PM_PAR_SXX 4   // shape X^2 moment
     61#define PM_PAR_SYY 5   // shape Y^2 moment
     62#define PM_PAR_SXY 6   // shape XY moment
     63#define PM_PAR_7 7   // ??? Unknown parameter
     64#define PM_PAR_8 8   // ??? Unknown parameter
    5165
    5266/** pmModelAlloc()
  • trunk/psModules/src/objects/pmPSFtry.c

    r8815 r8882  
    55 *  @author EAM, IfA
    66 *
    7  *  @version $Revision: 1.15 $ $Name: not supported by cvs2svn $
    8  *  @date $Date: 2006-09-15 09:49:01 $
     7 *  @version $Revision: 1.16 $ $Name: not supported by cvs2svn $
     8 *  @date $Date: 2006-09-22 12:24:38 $
    99 *
    1010 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    191191    psTrace ("psphot.psftry", 3, "keeping %d of %ld PSF candidates (PSF)\n", Npsf, sources->n);
    192192
    193     // measure the chi-square trend as a function of flux (PAR[1])
     193    // measure the chi-square trend as a function of flux (PAR[PM_PAR_FLUX])
    194194    // this should be linear for Poisson errors and quadratic for constant sky errors
    195195    psVector *flux  = psVectorAlloc (psfTry->sources->n, PS_TYPE_F64);
     
    206206            mask->data.U8[i] = 1;
    207207        } else {
    208             flux->data.F64[i] = model->params->data.F32[1];
     208            flux->data.F64[i] = model->params->data.F32[PM_PAR_FLUX];
    209209            chisq->data.F64[i] = model[0].chisq/model[0].nDOF;
    210210            mask->data.U8[i] = 0;
  • trunk/psModules/src/objects/pmSourceIO_CMP.c

    r8815 r8882  
    33 *  @author EAM, IfA
    44 *
    5  *  @version $Revision: 1.13 $ $Name: not supported by cvs2svn $
    6  *  @date $Date: 2006-09-15 09:49:01 $
     5 *  @version $Revision: 1.14 $ $Name: not supported by cvs2svn $
     6 *  @date $Date: 2006-09-22 12:24:38 $
    77 *
    88 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    116116
    117117        type = pmSourceDophotType (source);
    118         lsky = (PAR[0] < 1.0) ? 0.0 : log10(PAR[0]);
    119 
    120         shape.sx  = PAR[4];
    121         shape.sy  = PAR[5];
    122         shape.sxy = PAR[6];
     118        lsky = (PAR[PM_PAR_SKY] < 1.0) ? 0.0 : log10(PAR[PM_PAR_SKY]);
     119
     120        shape.sx  = PAR[PM_PAR_SXX];
     121        shape.sy  = PAR[PM_PAR_SYY];
     122        shape.sxy = PAR[PM_PAR_SXY];
    123123        axes = psEllipseShapeToAxes (shape);
    124124
    125125        psLineInit (line);
    126         psLineAdd (line, "%6.1f ",  PAR[2]);
    127         psLineAdd (line, "%6.1f ",  PAR[3]);
     126        psLineAdd (line, "%6.1f ",  PAR[PM_PAR_XPOS]);
     127        psLineAdd (line, "%6.1f ",  PAR[PM_PAR_YPOS]);
    128128        psLineAdd (line, "%6.3f ",  PS_MIN (99.0, source->psfMag + ZERO_POINT));
    129129        psLineAdd (line, "%03d ",   PS_MIN (999, (int)(1000*source->errMag)));
     
    253253            dPAR = model->dparams->data.F32;
    254254
    255             PAR[0]        = pow (atof (array->data[5]), 10.0);
    256             PAR[2]        = atof (array->data[0]);
    257             PAR[3]        = atof (array->data[1]);
     255            PAR[PM_PAR_SKY] = pow (atof (array->data[5]), 10.0);
     256            PAR[PM_PAR_XPOS] = atof (array->data[0]);
     257            PAR[PM_PAR_YPOS] = atof (array->data[1]);
    258258            source->psfMag = atof (array->data[2]);
    259259            source->extMag = atof (array->data[6]);
  • trunk/psModules/src/objects/pmSourceIO_OBJ.c

    r8815 r8882  
    33 *  @author EAM, IfA
    44 *
    5  *  @version $Revision: 1.4 $ $Name: not supported by cvs2svn $
    6  *  @date $Date: 2006-09-15 09:49:01 $
     5 *  @version $Revision: 1.5 $ $Name: not supported by cvs2svn $
     6 *  @date $Date: 2006-09-22 12:24:38 $
    77 *
    88 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    6262        dPAR = model->dparams->data.F32;
    6363
    64         dmag = dPAR[1] / PAR[1];
     64        dmag = dPAR[PM_PAR_FLUX] / PAR[PM_PAR_FLUX];
    6565        type = pmSourceDophotType (source);
    6666        if ((source->apMag < 99.0) && (source->psfMag < 99.0)) {
     
    7070        }
    7171
    72         shape.sx  = PAR[4];
    73         shape.sy  = PAR[5];
    74         shape.sxy = PAR[6];
     72        shape.sx  = PAR[PM_PAR_SXX];
     73        shape.sy  = PAR[PM_PAR_SYY];
     74        shape.sxy = PAR[PM_PAR_SXY];
    7575        axes = psEllipseShapeToAxes (shape);
    7676
    7777        psLineInit (line);
    7878        psLineAdd (line, "%3d",   type);
    79         psLineAdd (line, "%8.2f", PAR[2]);
    80         psLineAdd (line, "%8.2f", PAR[3]);
     79        psLineAdd (line, "%8.2f", PAR[PM_PAR_XPOS]);
     80        psLineAdd (line, "%8.2f", PAR[PM_PAR_YPOS]);
    8181        psLineAdd (line, "%8.3f", source->psfMag);
    8282        psLineAdd (line, "%6.3f", dmag);
    83         psLineAdd (line, "%9.2f", PAR[0]);
     83        psLineAdd (line, "%9.2f", PAR[PM_PAR_SKY]);
    8484        psLineAdd (line, "%9.3f", axes.major);
    8585        psLineAdd (line, "%9.3f", axes.minor);
  • trunk/psModules/src/objects/pmSourceIO_RAW.c

    r8815 r8882  
    33 *  @author EAM, IfA
    44 *
    5  *  @version $Revision: 1.4 $ $Name: not supported by cvs2svn $
    6  *  @date $Date: 2006-09-15 09:49:01 $
     5 *  @version $Revision: 1.5 $ $Name: not supported by cvs2svn $
     6 *  @date $Date: 2006-09-22 12:24:38 $
    77 *
    88 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    8484
    8585        // dPos is positional error, dMag is mag error
    86         dPos = hypot (dPAR[2], dPAR[3]);
     86        dPos = hypot (dPAR[PM_PAR_XPOS], dPAR[PM_PAR_YPOS]);
    8787
    8888        fprintf (f, "%7.1f %7.1f  %7.1f %8.4f  %7.4f %7.4f  ",
    89                  PAR[2], PAR[3], PAR[0], source->psfMag, source->errMag, dPos);
     89                 PAR[PM_PAR_XPOS], PAR[PM_PAR_YPOS], PAR[PM_PAR_SKY],
     90                 source->psfMag, source->errMag, dPos);
    9091
    9192        for (j = 4; j < model->params->n; j++) {
     
    142143        // dPos is shape error
    143144        // XXX these are hardwired for SGAUSS
    144         dPos = hypot ((dPAR[4] / PAR[4]), (dPAR[5] / PAR[5]));
     145        dPos = hypot ((dPAR[PM_PAR_SXX] / PAR[PM_PAR_SXX]), (dPAR[PM_PAR_SYY] / PAR[PM_PAR_SYY]));
    145146
    146147        fprintf (f, "%7.1f %7.1f  %7.1f %8.4f  %7.4f %7.4f  ",
    147                  PAR[2], PAR[3], PAR[0], source->extMag, source->errMag, dPos);
     148                 PAR[PM_PAR_XPOS], PAR[PM_PAR_YPOS], PAR[PM_PAR_SKY],
     149                 source->extMag, source->errMag, dPos);
    148150
    149151        for (j = 4; j < model->params->n; j++) {
  • trunk/psModules/src/objects/pmSourceIO_SX.c

    r8815 r8882  
    33 *  @author EAM, IfA
    44 *
    5  *  @version $Revision: 1.4 $ $Name: not supported by cvs2svn $
    6  *  @date $Date: 2006-09-15 09:49:01 $
     5 *  @version $Revision: 1.5 $ $Name: not supported by cvs2svn $
     6 *  @date $Date: 2006-09-22 12:24:38 $
    77 *
    88 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    6060        // pmSourceSextractType (source, &type, &flags);
    6161
    62         shape.sx  = PAR[4];
    63         shape.sy  = PAR[5];
    64         shape.sxy = PAR[6];
     62        shape.sx  = PAR[PM_PAR_SXX];
     63        shape.sy  = PAR[PM_PAR_SYY];
     64        shape.sxy = PAR[PM_PAR_SXY];
    6565        axes = psEllipseShapeToAxes (shape);
    6666
    6767        psLineInit (line);
    6868        psLineAdd (line, "%5.2f",  0.0); // should be type
    69         psLineAdd (line, "%11.3f", PAR[2]);
    70         psLineAdd (line, "%11.3f", PAR[3]);
     69        psLineAdd (line, "%11.3f", PAR[PM_PAR_XPOS]);
     70        psLineAdd (line, "%11.3f", PAR[PM_PAR_YPOS]);
    7171        psLineAdd (line, "%9.4f",  source->psfMag);
    7272        psLineAdd (line, "%9.4f",  source->errMag);
    73         psLineAdd (line, "%13.4f", PAR[0]);
     73        psLineAdd (line, "%13.4f", PAR[PM_PAR_SKY]);
    7474        psLineAdd (line, "%9.2f",  axes.major);
    7575        psLineAdd (line, "%9.2f",  axes.minor);
Note: See TracChangeset for help on using the changeset viewer.