Changeset 32347 for trunk/psModules/src/objects/pmSourceOutputs.c
- Timestamp:
- Sep 6, 2011, 1:02:53 PM (15 years ago)
- Location:
- trunk/psModules/src/objects
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
pmSourceOutputs.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/src/objects
- Property svn:ignore
-
old new 5 5 *.la 6 6 *.lo 7 pmSourceIO_CMF_PS1_V1.c 8 pmSourceIO_CMF_PS1_V2.c 9 pmSourceIO_CMF_PS1_V3.c
-
- Property svn:ignore
-
trunk/psModules/src/objects/pmSourceOutputs.c
r31451 r32347 107 107 } 108 108 if (isfinite(PAR[PM_PAR_SXX]) && isfinite(PAR[PM_PAR_SXY]) && isfinite(PAR[PM_PAR_SYY])) { 109 axes = pmPSF_ModelToAxes (PAR, 20.0 );109 axes = pmPSF_ModelToAxes (PAR, 20.0, model->type); 110 110 outputs->psfMajor = axes.major; 111 111 outputs->psfMinor = axes.minor; … … 178 178 moments->KronCore = source->moments ? source->moments->KronCore : NAN; 179 179 moments->KronCoreErr = source->moments ? source->moments->KronCoreErr : NAN; 180 181 return true; 182 } 180 moments->KronPSF = source->moments ? source->moments->KronFluxPSF : NAN; 181 moments->KronPSFErr = source->moments ? source->moments->KronFluxPSFErr : NAN; 182 183 return true; 184 } 185 186 bool pmSourceLocalAstrometry (psSphere *ptSky, float *posAngle, float *pltScale, pmChip *chip, float xPos, float yPos) { 187 188 pmFPA *fpa = chip->parent; 189 190 if (!chip->toFPA) goto escape; 191 if (!fpa->toTPA) goto escape; 192 if (!fpa->toSky) goto escape; 193 194 // generate RA,DEC 195 psPlane ptCH, ptFP, ptTP_o, ptTP_x, ptTP_y; 196 197 // calculate the astrometry for the coordinate of interest 198 ptCH.x = xPos; 199 ptCH.y = yPos; 200 psPlaneTransformApply (&ptFP, chip->toFPA, &ptCH); 201 psPlaneTransformApply (&ptTP_o, fpa->toTPA, &ptFP); 202 psDeproject (ptSky, &ptTP_o, fpa->toSky); 203 204 // calculate the astrometry for the coordinate + 1pix in X 205 ptCH.x = xPos + 1.0; 206 ptCH.y = yPos; 207 psPlaneTransformApply (&ptFP, chip->toFPA, &ptCH); 208 psPlaneTransformApply (&ptTP_x, fpa->toTPA, &ptFP); 209 210 // calculate the astrometry for the coordinate + 1pix in Y 211 ptCH.x = xPos; 212 ptCH.y = yPos + 1.0; 213 psPlaneTransformApply (&ptFP, chip->toFPA, &ptCH); 214 psPlaneTransformApply (&ptTP_y, fpa->toTPA, &ptFP); 215 216 // the resulting Tangent Plane coordinates are in TP pixels; convert to local Tangent Plane 217 // degrees 218 219 float dTPx_dCHx = fpa->toSky->Xs * (ptTP_x.x - ptTP_o.x); 220 float dTPy_dCHx = fpa->toSky->Ys * (ptTP_x.y - ptTP_o.y); 221 222 float dTPx_dCHy = fpa->toSky->Xs * (ptTP_y.x - ptTP_o.x); 223 float dTPy_dCHy = fpa->toSky->Ys * (ptTP_y.y - ptTP_o.y); 224 225 float pltScale_x = hypot(dTPx_dCHx, dTPy_dCHx); 226 float pltScale_y = hypot(dTPx_dCHy, dTPy_dCHy); 227 *pltScale = 0.5*(pltScale_x + pltScale_y); 228 229 float posAngle_x = atan2 (+dTPy_dCHx, +dTPx_dCHx); 230 float posAngle_y = atan2 (-dTPy_dCHy, +dTPx_dCHy); 231 *posAngle = 0.5*(posAngle_x + posAngle_y); 232 233 return true; 234 235 escape: 236 // no astrometry calibration, give up 237 ptSky->r = NAN; 238 ptSky->d = NAN; 239 *posAngle = NAN; 240 *pltScale = NAN; 241 242 return false; 243 } 244
Note:
See TracChangeset
for help on using the changeset viewer.
