Changeset 31992
- Timestamp:
- Aug 3, 2011, 10:32:41 AM (15 years ago)
- Location:
- branches/eam_branches/ipp-20110710/psModules/src/objects
- Files:
-
- 6 edited
-
Makefile.am (modified) (1 diff)
-
pmSource.c (modified) (2 diffs)
-
pmSourceExtendedPars.c (modified) (1 diff)
-
pmSourceExtendedPars.h (modified) (2 diffs)
-
pmSourceFitPCM.c (modified) (5 diffs)
-
pmSourceIO_CMF.c.in (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20110710/psModules/src/objects/Makefile.am
r31927 r31992 130 130 131 131 # 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.c132 BUILT_SOURCES = pmSourceIO_CMF_PS1_V1.c pmSourceIO_CMF_PS1_V2.c pmSourceIO_CMF_PS1_V3.c 133 133 134 pmSourceIO_CMF_PS1_V1. v1.c : pmSourceIO_CMF.c.in mksource.pl134 pmSourceIO_CMF_PS1_V1.c : pmSourceIO_CMF.c.in mksource.pl 135 135 mksource.pl pmSourceIO_CMF.c.in PS1_V1 pmSourceIO_CMF_PS1_V1.c 136 136 137 pmSourceIO_CMF_PS1_V2. v1.c : pmSourceIO_CMF.c.in mksource.pl137 pmSourceIO_CMF_PS1_V2.c : pmSourceIO_CMF.c.in mksource.pl 138 138 mksource.pl pmSourceIO_CMF.c.in PS1_V2 pmSourceIO_CMF_PS1_V2.c 139 139 140 pmSourceIO_CMF_PS1_V3. v1.c : pmSourceIO_CMF.c.in mksource.pl140 pmSourceIO_CMF_PS1_V3.c : pmSourceIO_CMF.c.in mksource.pl 141 141 mksource.pl pmSourceIO_CMF.c.in PS1_V3 pmSourceIO_CMF_PS1_V3.c 142 142 -
branches/eam_branches/ipp-20110710/psModules/src/objects/pmSource.c
r31670 r31992 58 58 psFree(tmp->modelEXT); 59 59 psFree(tmp->modelFits); 60 psFree(tmp->extFitPars); 60 61 psFree(tmp->extpars); 61 62 psFree(tmp->moments); … … 119 120 source->modelEXT = NULL; 120 121 source->modelFits = NULL; 122 source->extFitPars = NULL; 121 123 source->type = PM_SOURCE_TYPE_UNKNOWN; 122 124 source->mode = PM_SOURCE_MODE_DEFAULT; -
branches/eam_branches/ipp-20110710/psModules/src/objects/pmSourceExtendedPars.c
r31925 r31992 274 274 275 275 pars->Mrf = NAN; 276 pars->Mrh = NAN; 277 276 278 pars->apMag = NAN; 277 279 pars->krMag = NAN; 278 280 pars->psfMag = NAN; 281 pars->peakMag = NAN; 279 282 280 283 return pars; -
branches/eam_branches/ipp-20110710/psModules/src/objects/pmSourceExtendedPars.h
r31925 r31992 74 74 75 75 float Mrf; 76 float Mrh; 77 76 78 float apMag; 77 79 float krMag; 78 80 float psfMag; 81 float peakMag; 79 82 } pmSourceExtFitPars; 80 83 … … 104 107 bool pmSourceRadialProfileSortPair(psVector *index, psVector *extra); 105 108 106 109 pmSourceExtFitPars *pmSourceExtFitParsAlloc (void); 107 110 108 111 /// @} -
branches/eam_branches/ipp-20110710/psModules/src/objects/pmSourceFitPCM.c
r31926 r31992 48 48 // convolved model image. 49 49 50 # define TIMING 0 51 50 52 bool pmSourceFitPCM (pmPCMdata *pcm, pmSource *source, pmSourceFitOptions *fitOptions, psImageMaskType maskVal, psImageMaskType markVal, int psfSize) { 51 53 52 psTimerStart ("pmSourceFitPCM");54 if (TIMING) { psTimerStart ("pmSourceFitPCM"); } 53 55 54 56 psVector *params = pcm->modelConv->params; … … 66 68 psImage *covar = psImageAlloc (params->n, params->n, PS_TYPE_F32); 67 69 68 float t1 = psTimerMark ("pmSourceFitPCM"); 70 float t1, t2, t3, t4, t5; 71 if (TIMING) { t1 = psTimerMark ("pmSourceFitPCM"); } 69 72 70 73 bool fitStatus = pmPCM_MinimizeChisq (myMin, covar, params, source, pcm); 71 float t2 = psTimerMark ("pmSourceFitPCM");74 if (TIMING) { t2 = psTimerMark ("pmSourceFitPCM"); } 72 75 73 76 for (int i = 0; i < dparams->n; i++) { … … 82 85 } 83 86 psTrace ("psphot", 4, "niter: %d, chisq: %f", myMin->iter, myMin->value); 84 float t3 = psTimerMark ("pmSourceFitPCM");87 if (TIMING) { t3 = psTimerMark ("pmSourceFitPCM"); } 85 88 86 89 // renormalize output model image (generated by fitting process) … … 104 107 pmSourceChisqUnsubtracted (source, pcm->modelConv, maskVal); 105 108 } 106 float t4 = psTimerMark ("pmSourceFitPCM");109 if (TIMING) { t4 = psTimerMark ("pmSourceFitPCM"); } 107 110 108 111 // set the model success or failure status … … 122 125 123 126 source->mode |= PM_SOURCE_MODE_FITTED; // XXX is this needed? 124 float t5 = psTimerMark ("pmSourceFitPCM");127 if (TIMING) { t5 = psTimerMark ("pmSourceFitPCM"); } 125 128 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 } 129 132 130 133 psFree(myMin); -
branches/eam_branches/ipp-20110710/psModules/src/objects/pmSourceIO_CMF.c.in
r31927 r31992 55 55 // followed by a zero-size matrix, followed by the table data 56 56 57 // # define MODE @CMFMODE@58 57 bool pmSourcesWrite_CMF_@CMFMODE@ (psFits *fits, pmReadout *readout, psArray *sources, psMetadata *imageHeader, psMetadata *tableHeader, char *extname, psMetadata *recipe) 59 58 { … … 595 594 assert (model); 596 595 596 pmSourceExtFitPars *extPars = source->extFitPars->data[j]; 597 assert (extPars); 598 597 599 // skip models which were not actually fitted 598 600 if (model->flags & PM_MODEL_STATUS_BADARGS) continue; … … 617 619 psMetadataAddF32 (row, PS_LIST_TAIL, "EXT_INST_MAG", 0, "EXT fit instrumental magnitude", model->mag); 618 620 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); 619 632 620 633 psMetadataAddF32 (row, PS_LIST_TAIL, "NPARAMS", 0, "number of model parameters", model->params->n);
Note:
See TracChangeset
for help on using the changeset viewer.
