IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 31992


Ignore:
Timestamp:
Aug 3, 2011, 10:32:41 AM (15 years ago)
Author:
eugene
Message:

add several non-parametric values to extended source table; convert pmSourceIO_* functions to use autogenerated code for different formats; add optional timing marks to pmSourceFitPCM

Location:
branches/eam_branches/ipp-20110710/psModules/src/objects
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20110710/psModules/src/objects/Makefile.am

    r31927 r31992  
    130130
    131131# pmSourceID_CMF_* functions use a common framework
    132 BUILT_SOURCES = pmSourceIO_CMF_PS1_V1.v1.c pmSourceIO_CMF_PS1_V2.v1.c pmSourceIO_CMF_PS1_V3.v1.c
     132BUILT_SOURCES = pmSourceIO_CMF_PS1_V1.c pmSourceIO_CMF_PS1_V2.c pmSourceIO_CMF_PS1_V3.c
    133133
    134 pmSourceIO_CMF_PS1_V1.v1.c : pmSourceIO_CMF.c.in mksource.pl
     134pmSourceIO_CMF_PS1_V1.c : pmSourceIO_CMF.c.in mksource.pl
    135135        mksource.pl pmSourceIO_CMF.c.in PS1_V1 pmSourceIO_CMF_PS1_V1.c
    136136
    137 pmSourceIO_CMF_PS1_V2.v1.c : pmSourceIO_CMF.c.in mksource.pl
     137pmSourceIO_CMF_PS1_V2.c : pmSourceIO_CMF.c.in mksource.pl
    138138        mksource.pl pmSourceIO_CMF.c.in PS1_V2 pmSourceIO_CMF_PS1_V2.c
    139139
    140 pmSourceIO_CMF_PS1_V3.v1.c : pmSourceIO_CMF.c.in mksource.pl
     140pmSourceIO_CMF_PS1_V3.c : pmSourceIO_CMF.c.in mksource.pl
    141141        mksource.pl pmSourceIO_CMF.c.in PS1_V3 pmSourceIO_CMF_PS1_V3.c
    142142
  • branches/eam_branches/ipp-20110710/psModules/src/objects/pmSource.c

    r31670 r31992  
    5858    psFree(tmp->modelEXT);
    5959    psFree(tmp->modelFits);
     60    psFree(tmp->extFitPars);
    6061    psFree(tmp->extpars);
    6162    psFree(tmp->moments);
     
    119120    source->modelEXT = NULL;
    120121    source->modelFits = NULL;
     122    source->extFitPars = NULL;
    121123    source->type = PM_SOURCE_TYPE_UNKNOWN;
    122124    source->mode = PM_SOURCE_MODE_DEFAULT;
  • branches/eam_branches/ipp-20110710/psModules/src/objects/pmSourceExtendedPars.c

    r31925 r31992  
    274274
    275275    pars->Mrf    = NAN;
     276    pars->Mrh    = NAN;
     277
    276278    pars->apMag  = NAN;
    277279    pars->krMag  = NAN;
    278280    pars->psfMag = NAN;
     281    pars->peakMag = NAN;
    279282
    280283    return pars;
  • branches/eam_branches/ipp-20110710/psModules/src/objects/pmSourceExtendedPars.h

    r31925 r31992  
    7474   
    7575    float Mrf;
     76    float Mrh;
     77
    7678    float apMag;
    7779    float krMag;
    7880    float psfMag;
     81    float peakMag;
    7982} pmSourceExtFitPars;
    8083
     
    104107bool pmSourceRadialProfileSortPair(psVector *index, psVector *extra);
    105108
    106 
     109pmSourceExtFitPars *pmSourceExtFitParsAlloc (void);
    107110
    108111/// @}
  • branches/eam_branches/ipp-20110710/psModules/src/objects/pmSourceFitPCM.c

    r31926 r31992  
    4848// convolved model image.
    4949
     50# define TIMING 0
     51
    5052bool pmSourceFitPCM (pmPCMdata *pcm, pmSource *source, pmSourceFitOptions *fitOptions, psImageMaskType maskVal, psImageMaskType markVal, int psfSize) {
    5153   
    52     psTimerStart ("pmSourceFitPCM");
     54    if (TIMING) { psTimerStart ("pmSourceFitPCM"); }
    5355
    5456    psVector *params  = pcm->modelConv->params;
     
    6668    psImage *covar = psImageAlloc (params->n, params->n, PS_TYPE_F32);
    6769
    68     float t1 = psTimerMark ("pmSourceFitPCM");
     70    float t1, t2, t3, t4, t5;
     71    if (TIMING) { t1 = psTimerMark ("pmSourceFitPCM"); }
    6972
    7073    bool fitStatus = pmPCM_MinimizeChisq (myMin, covar, params, source, pcm);
    71     float t2 = psTimerMark ("pmSourceFitPCM");
     74    if (TIMING) { t2 = psTimerMark ("pmSourceFitPCM"); }
    7275
    7376    for (int i = 0; i < dparams->n; i++) {
     
    8285    }
    8386    psTrace ("psphot", 4, "niter: %d, chisq: %f", myMin->iter, myMin->value);
    84     float t3 = psTimerMark ("pmSourceFitPCM");
     87    if (TIMING) { t3 = psTimerMark ("pmSourceFitPCM"); }
    8588
    8689    // renormalize output model image (generated by fitting process)
     
    104107        pmSourceChisqUnsubtracted (source, pcm->modelConv, maskVal);
    105108    }
    106     float t4 = psTimerMark ("pmSourceFitPCM");
     109    if (TIMING) { t4 = psTimerMark ("pmSourceFitPCM"); }
    107110
    108111    // set the model success or failure status
     
    122125
    123126    source->mode |= PM_SOURCE_MODE_FITTED; // XXX is this needed?
    124     float t5 = psTimerMark ("pmSourceFitPCM");
     127    if (TIMING) { t5 = psTimerMark ("pmSourceFitPCM"); }
    125128
    126     if (0) {
    127         fprintf (stderr, "nIter: %2d, npix: %5d, t1: %6.4f, t2: %6.4f, t3: %6.4f, t4: %6.4f, t5: %6.4f\n", myMin->iter, pcm->nPix, t1, t2, t3, t4, t5);
    128     }
     129     if (TIMING) {
     130        fprintf (stderr, "nIter: %2d, npix: %5d, t1: %6.4f, t2: %6.4f, t3: %6.4f, t4: %6.4f, t5: %6.4f\n", myMin->iter, pcm->nPix, t1, t2, t3, t4, t5);
     131     }
    129132
    130133    psFree(myMin);
  • branches/eam_branches/ipp-20110710/psModules/src/objects/pmSourceIO_CMF.c.in

    r31927 r31992  
    5555// followed by a zero-size matrix, followed by the table data
    5656
    57 // # define MODE @CMFMODE@
    5857bool pmSourcesWrite_CMF_@CMFMODE@ (psFits *fits, pmReadout *readout, psArray *sources, psMetadata *imageHeader, psMetadata *tableHeader, char *extname, psMetadata *recipe)
    5958{
     
    595594            assert (model);
    596595
     596            pmSourceExtFitPars *extPars = source->extFitPars->data[j];
     597            assert (extPars);
     598
    597599            // skip models which were not actually fitted
    598600            if (model->flags & PM_MODEL_STATUS_BADARGS) continue;
     
    617619            psMetadataAddF32 (row, PS_LIST_TAIL, "EXT_INST_MAG",     0, "EXT fit instrumental magnitude",             model->mag);
    618620            psMetadataAddF32 (row, PS_LIST_TAIL, "EXT_INST_MAG_SIG", 0, "Sigma of PSF instrumental magnitude",        model->magErr);
     621
     622            psMetadataAddF32 (row, PS_LIST_TAIL, "MOMENTS_XX",       0, "second moment in x",                         extPars->Mxx);
     623            psMetadataAddF32 (row, PS_LIST_TAIL, "MOMENTS_XY",       0, "second moment in x,y",                       extPars->Mxy);
     624            psMetadataAddF32 (row, PS_LIST_TAIL, "MOMENTS_YY",       0, "second moment in y",                         extPars->Myy);
     625            psMetadataAddF32 (row, PS_LIST_TAIL, "MOMENTS_R1",       0, "first radial moment",                        extPars->Mrf);
     626            psMetadataAddF32 (row, PS_LIST_TAIL, "MOMENTS_RH",       0, "half radial moment",                         extPars->Mrh);
     627
     628            psMetadataAddF32 (row, PS_LIST_TAIL, "PSF_INST_MAG",     0, "PSF fit instrumental magnitude",             source->psfMag);
     629            psMetadataAddF32 (row, PS_LIST_TAIL, "AP_MAG",           0, "PSF-sized aperture magnitude",               source->apMag);
     630            psMetadataAddF32 (row, PS_LIST_TAIL, "KRON_MAG",         0, "Kron Mag",                                   extPars->krMag);
     631            psMetadataAddF32 (row, PS_LIST_TAIL, "PEAK_FLUX_AS_MAG", 0, "peak flux expressed as a magnitude",         extPars->peakMag);
    619632
    620633            psMetadataAddF32 (row, PS_LIST_TAIL, "NPARAMS",          0, "number of model parameters",                 model->params->n);
Note: See TracChangeset for help on using the changeset viewer.