Changeset 29004 for trunk/psModules/src/objects/pmSourceIO_CMF_PS1_DV1.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_DV1.c (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules
- Property svn:mergeinfo deleted
-
trunk/psModules/src/objects/pmSourceIO_CMF_PS1_DV1.c
r28013 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 … … 47 56 // This version has elements intended for difference images & forced photometry: 48 57 // diffStats entries (good for dipoles); flux + flux error (for insignificant detections) 49 bool pmSourcesWrite_CMF_PS1_DV1 (psFits *fits, pmReadout *readout, psArray *sources, 50 psMetadata *imageHeader, psMetadata *tableHeader, char *extname) 58 bool pmSourcesWrite_CMF_PS1_DV1 (psFits *fits, pmReadout *readout, psArray *sources, psMetadata *imageHeader, psMetadata *tableHeader, char *extname, psMetadata *recipe) 51 59 { 52 60 PS_ASSERT_PTR_NON_NULL(fits, false); … … 194 202 psMetadataAdd (row, PS_LIST_TAIL, "PSF_MINOR", PS_DATA_F32, "PSF width (minor axis)", axes.minor); 195 203 psMetadataAdd (row, PS_LIST_TAIL, "PSF_THETA", PS_DATA_F32, "PSF orientation angle", axes.theta); 196 psMetadataAdd (row, PS_LIST_TAIL, "PSF_QF", PS_DATA_F32, "PSF coverage/quality factor", source->pixWeight );204 psMetadataAdd (row, PS_LIST_TAIL, "PSF_QF", PS_DATA_F32, "PSF coverage/quality factor", source->pixWeightNotBad); 197 205 psMetadataAdd (row, PS_LIST_TAIL, "PSF_NDOF", PS_DATA_S32, "degrees of freedom", nDOF); 198 206 psMetadataAdd (row, PS_LIST_TAIL, "PSF_NPIX", PS_DATA_S32, "number of pixels in fit", nPix); … … 324 332 source->peak = pmPeakAlloc(PAR[PM_PAR_XPOS], PAR[PM_PAR_YPOS], peakFlux, PM_PEAK_LONE); 325 333 source->peak->flux = peakFlux; 334 source->peak->xf = PAR[PM_PAR_XPOS]; // more accurate position 335 source->peak->yf = PAR[PM_PAR_YPOS]; // more accurate position 326 336 source->peak->dx = dPAR[PM_PAR_XPOS]; 327 337 source->peak->dy = dPAR[PM_PAR_YPOS]; 328 source->peak->SN = sqrt(source->peak->flux); // XXX a proxy: various functions sort by peak S/N 329 330 source->pixWeight = psMetadataLookupF32 (&status, row, "PSF_QF"); 338 if (isfinite (source->errMag) && (source->errMag > 0.0)) { 339 source->peak->SN = 1.0 / source->errMag; 340 } else { 341 source->peak->SN = sqrt(source->peak->flux); // an alternate proxy: various functions sort by peak S/N 342 } 343 344 source->pixWeightNotBad = psMetadataLookupF32 (&status, row, "PSF_QF"); 331 345 source->crNsigma = psMetadataLookupF32 (&status, row, "CR_NSIGMA"); 332 346 source->extNsigma = psMetadataLookupF32 (&status, row, "EXT_NSIGMA"); … … 536 550 537 551 // XXX this layout is still the same as PS1_DEV_1 538 bool pmSourcesWrite_CMF_PS1_DV1_XFIT (psFits *fits, pmReadout *readout, psArray *sources, char *extname)552 bool pmSourcesWrite_CMF_PS1_DV1_XFIT(psFits *fits, pmReadout *readout, psArray *sources, psMetadata *imageHeader, char *extname) 539 553 { 540 554 … … 585 599 assert (model); 586 600 601 // skip models which were not actually fitted 602 if (model->flags & PM_MODEL_STATUS_BADARGS) continue; 603 587 604 PAR = model->params->data.F32; 588 605 dPAR = model->dparams->data.F32;
Note:
See TracChangeset
for help on using the changeset viewer.
