Changeset 41348 for trunk/psModules/src/objects/pmSourceIO_Ghosts.c
- Timestamp:
- Apr 28, 2020, 1:26:07 PM (6 years ago)
- File:
-
- 1 edited
-
trunk/psModules/src/objects/pmSourceIO_Ghosts.c (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/src/objects/pmSourceIO_Ghosts.c
r41339 r41348 104 104 psPolynomial2D *centerX = NULL; 105 105 psPolynomial2D *centerY = NULL; 106 psPolynomial1D *mirrorRad = NULL; 106 107 psPolynomial1D *outerMajor = NULL; 107 108 psPolynomial1D *outerMinor = NULL; … … 110 111 psMetadata *ghostModel = NULL; 111 112 113 psLogMsg ("psastro", PS_LOG_INFO, "writing ghost positions"); 114 112 115 // select the current recipe 113 116 psMetadata *recipe = psMetadataLookupPtr (&status, config->recipes, PSASTRO_RECIPE); … … 132 135 pmFPAview *view = pmFPAviewAlloc (0); 133 136 137 GET_1D_POLY ("GHOST.MIRROR.RAD", mirrorRad); 134 138 GET_2D_POLY ("GHOST.CENTER.X", centerX); 135 139 GET_2D_POLY ("GHOST.CENTER.Y", centerY); … … 187 191 for (int i = 0; i < refstars->n; i++) { 188 192 pmAstromObj *ref = refstars->data[i]; 189 psTrace("psastro.ghost",5,"Begin ghost %d/%ld: MAX_MAG: %g; ref_mag: %g @ (%.10g,%.10g)",i,refstars->n,MAX_MAG,ref->Mag,ref->sky->r * 180 / M_PI,ref->sky->d * 180.0 / M_PI);190 193 if (ref->Mag > MAX_MAG) continue; 191 194 … … 194 197 ghost->srcFP->y = ref->FP->y; 195 198 196 // XXX it is stupid that this takes -X_fpa,-Y_fpa --> the analysis script is reporting the guess FPA position, and the fit is using that... 197 ghost->FP->x = -ref->FP->x + psPolynomial2DEval(centerX, -ref->FP->x, -ref->FP->y); 198 ghost->FP->y = -ref->FP->y + psPolynomial2DEval(centerY, -ref->FP->x, -ref->FP->y); 199 200 float rSrc = hypot (ref->FP->x, ref->FP->y); 199 //TdB: first mirror the reference star positions (around the 0,0 pixel) using the radial offset coefficients and the ghost/star angle 200 double rSrc = hypot (ref->FP->x, ref->FP->y); 201 double theta0 = atan2(ref->FP->y,ref->FP->x); 202 203 double ghost_offset_rad = psPolynomial1DEval (mirrorRad, rSrc); 204 double ghost_x_fpa_mirror = ref->FP->x + ((ref->FP->x*-1.)/abs(ref->FP->x)*abs(cos(theta0)*ghost_offset_rad)); 205 double ghost_y_fpa_mirror = ref->FP->y + ((ref->FP->y*-1.)/abs(ref->FP->y)*abs(sin(theta0)*ghost_offset_rad)); 206 207 // Now use the mirrored position together with the 2D ghost center fitting to get the actual ghost position in FPA coords 208 ghost->FP->x = ghost_x_fpa_mirror + psPolynomial2DEval(centerX, ghost_x_fpa_mirror, ghost_y_fpa_mirror); 209 ghost->FP->y = ghost_y_fpa_mirror + psPolynomial2DEval(centerY, ghost_x_fpa_mirror, ghost_y_fpa_mirror); 201 210 202 211 ghost->inner.major = psPolynomial1DEval (innerMajor, rSrc); … … 278 287 psFree (ghostModel); 279 288 psFree (view); 280 return true;281 289 282 290 if (table->n == 0) {
Note:
See TracChangeset
for help on using the changeset viewer.
