Changeset 19904 for trunk/psModules/src/objects/pmSourceIO_PS1_DEV_1.c
- Timestamp:
- Oct 6, 2008, 3:02:43 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/src/objects/pmSourceIO_PS1_DEV_1.c
r17396 r19904 3 3 * @author EAM, IfA 4 4 * 5 * @version $Revision: 1.1 0$ $Name: not supported by cvs2svn $6 * @date $Date: 2008- 04-08 18:35:38$5 * @version $Revision: 1.11 $ $Name: not supported by cvs2svn $ 6 * @date $Date: 2008-10-06 13:02:43 $ 7 7 * 8 8 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 61 61 psF32 xPos, yPos; 62 62 psF32 xErr, yErr; 63 psF32 errMag; 63 64 64 65 // let's write these out in S/N order … … 67 68 table = psArrayAllocEmpty (sources->n); 68 69 69 // we write out all sources, regardless of quality. the source flags tell us the state70 // we write out PSF-fits for all sources, regardless of quality. the source flags tell us the state 70 71 for (i = 0; i < sources->n; i++) { 71 72 pmSource *source = (pmSource *) sources->data[i]; … … 73 74 74 75 // no difference between PSF and non-PSF model 75 pmModel *model = pmSourceGetModel (NULL, source);76 pmModel *model = source->modelPSF; 76 77 77 78 if (model != NULL) { … … 82 83 xErr = dPAR[PM_PAR_XPOS]; 83 84 yErr = dPAR[PM_PAR_YPOS]; 84 85 85 axes = pmPSF_ModelToAxes (PAR, 20.0); 86 87 // need to determine the PSF photometry error: source->errMag is the error on the 'best' model mag. 88 errMag = model->dparams->data.F32[PM_PAR_I0] / model->params->data.F32[PM_PAR_I0]; 86 89 } else { 87 90 xPos = source->peak->xf; … … 89 92 xErr = source->peak->dx; 90 93 yErr = source->peak->dy; 91 axes.major = 0.0; 92 axes.minor = 0.0; 93 axes.theta = 0.0; 94 axes.major = NAN; 95 axes.minor = NAN; 96 axes.theta = NAN; 97 errMag = NAN; 94 98 } 95 99 … … 104 108 psMetadataAdd (row, PS_LIST_TAIL, "X_PSF_SIG", PS_DATA_F32, "Sigma in PSF x coordinate", xErr); 105 109 psMetadataAdd (row, PS_LIST_TAIL, "Y_PSF_SIG", PS_DATA_F32, "Sigma in PSF y coordinate", yErr); 106 psMetadataAdd (row, PS_LIST_TAIL, "PSF_INST_MAG", PS_DATA_F32, "PSF fit instrumental magnitude", PS_MIN (99.0, source->psfMag));107 psMetadataAdd (row, PS_LIST_TAIL, "PSF_INST_MAG_SIG", PS_DATA_F32, "Sigma of PSF instrumental magnitude", PS_MIN (99.0, source->errMag));108 psMetadataAdd (row, PS_LIST_TAIL, "PEAK_FLUX_AS_MAG", PS_DATA_F32, "Peak flux expressed as magnitude", PS_MIN (99.0, peakMag));110 psMetadataAdd (row, PS_LIST_TAIL, "PSF_INST_MAG", PS_DATA_F32, "PSF fit instrumental magnitude", source->psfMag); 111 psMetadataAdd (row, PS_LIST_TAIL, "PSF_INST_MAG_SIG", PS_DATA_F32, "Sigma of PSF instrumental magnitude", source->errMag); 112 psMetadataAdd (row, PS_LIST_TAIL, "PEAK_FLUX_AS_MAG", PS_DATA_F32, "Peak flux expressed as magnitude", peakMag); 109 113 psMetadataAdd (row, PS_LIST_TAIL, "SKY", PS_DATA_F32, "Sky level", source->sky); 110 114 psMetadataAdd (row, PS_LIST_TAIL, "SKY_SIGMA", PS_DATA_F32, "Sigma of sky level", source->skyErr); 111 115 112 psMetadataAdd (row, PS_LIST_TAIL, "PSF_CHISQ", PS_DATA_F32, "Chisq of PSF-fit to top 9 pixels", source->psfChisq);116 psMetadataAdd (row, PS_LIST_TAIL, "PSF_CHISQ", PS_DATA_F32, "Chisq of PSF-fit", model->chisq); 113 117 psMetadataAdd (row, PS_LIST_TAIL, "CR_NSIGMA", PS_DATA_F32, "Nsigma deviations from PSF to CF", source->crNsigma); 114 118 psMetadataAdd (row, PS_LIST_TAIL, "EXT_NSIGMA", PS_DATA_F32, "Nsigma deviations from PSF to EXT", source->extNsigma); 119 120 // EXT_NSIGMA will be NAN if: 1) contour ellipse is imaginary; 2) source is not 121 // subtracted 122 123 // CR_NSIGMA will be NAN if: 1) source is not subtracted; 2) source is on the image 124 // edge; 3) any pixels in the 3x3 peak region are masked; 125 126 // CR_NSIGMA and 115 127 116 128 // XXX these should be major and minor, not 'x' and 'y'
Note:
See TracChangeset
for help on using the changeset viewer.
