Changeset 41348 for trunk/psModules
- Timestamp:
- Apr 28, 2020, 1:26:07 PM (6 years ago)
- Location:
- trunk/psModules/src/objects
- Files:
-
- 4 edited
-
pmSourceIO.c (modified) (1 diff)
-
pmSourceIO.h (modified) (1 diff)
-
pmSourceIO_Ghosts.c (modified) (6 diffs)
-
pmSourceIO_Glints.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/src/objects/pmSourceIO.c
r41338 r41348 810 810 pmSourceIO_WriteMatchedRefs (file->fits, file->fpa, config); 811 811 pmSourceIO_WriteGlints (file->fits, file->fpa, config); 812 pmSourceIO_WriteGhosts (file->fits, file->fpa, config); 812 813 return true; 813 814 } -
trunk/psModules/src/objects/pmSourceIO.h
r41338 r41348 92 92 93 93 bool pmSourceIO_WriteGlints (psFits *fits, pmFPA *fpa, pmConfig *config); 94 bool pmSourceIO_WriteGhosts (psFits *fits, pmFPA *fpa, pmConfig *config); 94 95 95 96 /// @} -
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) { -
trunk/psModules/src/objects/pmSourceIO_Glints.c
r41339 r41348 66 66 float zeropt, exptime; 67 67 68 psLogMsg ("psastro", PS_LOG_INFO, "writing glint positions"); 69 68 70 // select the current recipe 69 71 psMetadata *recipe = psMetadataLookupPtr (&status, config->recipes, PSASTRO_RECIPE); … … 184 186 } 185 187 186 //do a rudimentary check of whether the glint enters the pixel FPA 187 if (!strcasecmp(glintType, "TOP") && ((star->FP->y - glintLength) > 20500.)) continue;188 if (!strcasecmp(glintType, "BOTTOM") && ((star->FP->y + glintLength) < - 20500.)) continue;189 if (!strcasecmp(glintType, "LEFT") && ((star->FP->x + glintLength) < - 20500.)) continue;190 if (!strcasecmp(glintType, "RIGHT") && ((star->FP->x - glintLength) > 20500.)) continue;188 //do a rudimentary check of whether the glint enters the pixel FPA, and exclude very short ones 189 if (!strcasecmp(glintType, "TOP") && ((star->FP->y - glintLength) > 19500.)) continue; 190 if (!strcasecmp(glintType, "BOTTOM") && ((star->FP->y + glintLength) < -19500.)) continue; 191 if (!strcasecmp(glintType, "LEFT") && ((star->FP->x + glintLength) < -19500.)) continue; 192 if (!strcasecmp(glintType, "RIGHT") && ((star->FP->x - glintLength) > 19500.)) continue; 191 193 192 194 //save the glint positions
Note:
See TracChangeset
for help on using the changeset viewer.
