Changeset 29004 for trunk/psModules/src/objects/pmSourceIO_CMF_PS1_V1.c
- Timestamp:
- Aug 20, 2010, 1:14:11 PM (16 years ago)
- Location:
- trunk/psModules
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
src/objects/pmSourceIO_CMF_PS1_V1.c (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules
- Property svn:mergeinfo deleted
-
trunk/psModules/src/objects/pmSourceIO_CMF_PS1_V1.c
r27818 r29004 28 28 #include "pmFPAfile.h" 29 29 30 #include "pmTrend2D.h" 31 #include "pmResiduals.h" 32 #include "pmGrowthCurve.h" 30 33 #include "pmSpan.h" 34 #include "pmFootprintSpans.h" 31 35 #include "pmFootprint.h" 32 36 #include "pmPeaks.h" 33 37 #include "pmMoments.h" 34 #include "pmGrowthCurve.h" 35 #include "pmResiduals.h" 36 #include "pmTrend2D.h" 38 #include "pmModelFuncs.h" 39 #include "pmModel.h" 40 #include "pmModelUtils.h" 41 #include "pmModelClass.h" 42 #include "pmSourceMasks.h" 43 #include "pmSourceExtendedPars.h" 44 #include "pmSourceDiffStats.h" 45 #include "pmSource.h" 46 #include "pmSourceFitModel.h" 37 47 #include "pmPSF.h" 38 #include "pmModel.h" 39 #include "pmSource.h" 40 #include "pmModelClass.h" 48 #include "pmPSFtry.h" 49 41 50 #include "pmSourceIO.h" 42 51 … … 45 54 // followed by a zero-size matrix, followed by the table data 46 55 47 bool pmSourcesWrite_CMF_PS1_V1 (psFits *fits, pmReadout *readout, psArray *sources, 48 psMetadata *imageHeader, psMetadata *tableHeader, char *extname) 56 bool pmSourcesWrite_CMF_PS1_V1 (psFits *fits, pmReadout *readout, psArray *sources, psMetadata *imageHeader, psMetadata *tableHeader, char *extname, psMetadata *recipe) 49 57 { 50 58 PS_ASSERT_PTR_NON_NULL(fits, false); … … 184 192 psMetadataAdd (row, PS_LIST_TAIL, "PSF_MINOR", PS_DATA_F32, "PSF width (minor axis)", axes.minor); 185 193 psMetadataAdd (row, PS_LIST_TAIL, "PSF_THETA", PS_DATA_F32, "PSF orientation angle", axes.theta); 186 psMetadataAdd (row, PS_LIST_TAIL, "PSF_QF", PS_DATA_F32, "PSF coverage/quality factor", source->pixWeight );194 psMetadataAdd (row, PS_LIST_TAIL, "PSF_QF", PS_DATA_F32, "PSF coverage/quality factor", source->pixWeightNotBad); 187 195 psMetadataAdd (row, PS_LIST_TAIL, "PSF_NDOF", PS_DATA_S32, "degrees of freedom", nDOF); 188 196 psMetadataAdd (row, PS_LIST_TAIL, "PSF_NPIX", PS_DATA_S32, "number of pixels in fit", nPix); … … 310 318 source->peak = pmPeakAlloc(PAR[PM_PAR_XPOS], PAR[PM_PAR_YPOS], peakFlux, PM_PEAK_LONE); 311 319 source->peak->flux = peakFlux; 320 source->peak->xf = PAR[PM_PAR_XPOS]; // more accurate position 321 source->peak->yf = PAR[PM_PAR_YPOS]; // more accurate position 312 322 source->peak->dx = dPAR[PM_PAR_XPOS]; 313 323 source->peak->dy = dPAR[PM_PAR_YPOS]; 314 315 source->pixWeight = psMetadataLookupF32 (&status, row, "PSF_QF"); 324 if (isfinite (source->errMag) && (source->errMag > 0.0)) { 325 source->peak->SN = 1.0 / source->errMag; 326 } else { 327 source->peak->SN = sqrt(source->peak->flux); // an alternate proxy: various functions sort by peak S/N 328 } 329 330 source->pixWeightNotBad = psMetadataLookupF32 (&status, row, "PSF_QF"); 316 331 source->crNsigma = psMetadataLookupF32 (&status, row, "CR_NSIGMA"); 317 332 source->extNsigma = psMetadataLookupF32 (&status, row, "EXT_NSIGMA"); … … 516 531 517 532 // XXX this layout is still the same as PS1_DEV_1 518 bool pmSourcesWrite_CMF_PS1_V1_XFIT (psFits *fits, pmReadout *readout, psArray *sources, char *extname)533 bool pmSourcesWrite_CMF_PS1_V1_XFIT(psFits *fits, pmReadout *readout, psArray *sources, psMetadata *imageHeader, char *extname) 519 534 { 520 535 … … 565 580 assert (model); 566 581 582 // skip models which were not actually fitted 583 if (model->flags & PM_MODEL_STATUS_BADARGS) continue; 584 567 585 PAR = model->params->data.F32; 568 586 dPAR = model->dparams->data.F32;
Note:
See TracChangeset
for help on using the changeset viewer.
