Changeset 41348
- Timestamp:
- Apr 28, 2020, 1:26:07 PM (6 years ago)
- Location:
- trunk
- Files:
-
- 9 edited
-
ippconfig/gpc2/ghost.model.mdc (modified) (2 diffs)
-
ippconfig/gpc2/psastro.config (modified) (4 diffs)
-
psModules/src/objects/pmSourceIO.c (modified) (1 diff)
-
psModules/src/objects/pmSourceIO.h (modified) (1 diff)
-
psModules/src/objects/pmSourceIO_Ghosts.c (modified) (6 diffs)
-
psModules/src/objects/pmSourceIO_Glints.c (modified) (2 diffs)
-
psastro/src/psastroLoadGhosts.c (modified) (5 diffs)
-
psastro/src/psastroLoadGlints.c (modified) (8 diffs)
-
psastro/src/psastroMaskUpdates.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippconfig/gpc2/ghost.model.mdc
r41339 r41348 1 1 # TdB20200327 ghost model fit for gpc2 2 3 # These are the original linear solutions for gpc1 4 GHOST.MIRROR.RAD METADATA 5 NORDER_X S32 1 6 VAL_X00 F64 -412.2283909 7 VAL_X01 F64 2.07619288 8 NELEMENTS S32 2 9 END 10 2 11 GHOST.CENTER.X METADATA 3 12 NORDER_X S32 3 4 13 NORDER_Y S32 3 5 VAL_X00_Y00 F64 -1.15871916e+026 VAL_X01_Y00 F64 4.09678844e-027 VAL_X02_Y00 F64 2.83256020e-088 VAL_X03_Y00 F64 5.83797628e-119 VAL_X00_Y01 F64 2.14720353e-0310 VAL_X01_Y01 F64 -2.07766141e-0711 VAL_X02_Y01 F64 2.45261797e-1212 VAL_X00_Y02 F64 2. 45187527e-0713 VAL_X01_Y02 F64 1.24779721e-1014 VAL_X00_Y03 F64 4.74932940e-1214 VAL_X00_Y00 F64 2.03112383e+01 15 VAL_X01_Y00 F64 -1.65708159e-02 16 VAL_X02_Y00 F64 1.43129504e-07 17 VAL_X03_Y00 F64 4.52735266e-11 18 VAL_X00_Y01 F64 4.26192254e-03 19 VAL_X01_Y01 F64 6.66469973e-08 20 VAL_X02_Y01 F64 -1.33859987e-11 21 VAL_X00_Y02 F64 2.34527886e-07 22 VAL_X01_Y02 F64 6.81385407e-11 23 VAL_X00_Y03 F64 -1.01627226e-11 15 24 NELEMENTS S32 10 16 25 END … … 19 28 NORDER_X S32 3 20 29 NORDER_Y S32 3 21 VAL_X00_Y00 F64 4.06137992e+0122 VAL_X01_Y00 F64 - 3.89362940e-0223 VAL_X02_Y00 F64 -2.22548205e-0724 VAL_X03_Y00 F64 8.83360295e-1125 VAL_X00_Y01 F64 - 2.50474486e-0326 VAL_X01_Y01 F64 3.37661246e-0727 VAL_X02_Y01 F64 1.76755513e-1028 VAL_X00_Y02 F64 1. 92636172e-0729 VAL_X01_Y02 F64 -6.90714499e-1230 VAL_X00_Y03 F64 1.45561098e-1030 VAL_X00_Y00 F64 -3.07632661e+02 31 VAL_X01_Y00 F64 -1.70554450e-03 32 VAL_X02_Y00 F64 9.68642857e-08 33 VAL_X03_Y00 F64 -4.93941120e-12 34 VAL_X00_Y01 F64 -1.59277258e-02 35 VAL_X01_Y01 F64 5.50875919e-08 36 VAL_X02_Y01 F64 5.61297596e-11 37 VAL_X00_Y02 F64 1.12248583e-07 38 VAL_X01_Y02 F64 2.87924055e-11 39 VAL_X00_Y03 F64 4.50177026e-11 31 40 NELEMENTS S32 10 32 41 END 33 42 34 35 # These are the original linear solutions 43 # These are the original linear solutions for gpc1 36 44 GHOST.INNER.MAJOR METADATA 37 45 NORDER_X S32 1 -
trunk/ippconfig/gpc2/psastro.config
r41338 r41348 62 62 63 63 # XXX Test for taurus 64 PSASTRO.GRID.MIN.SIGMA F32 5.064 PSASTRO.GRID.MIN.SIGMA F32 1.0 65 65 PSASTRO.IGNORE STR SATURATED,CRLIMIT,DEFECT,BLEND,FAIL 66 66 … … 174 174 ZEROPT F32 26.3 175 175 PHOTCODE STR r 176 GHOST_MAX_MAG F32 -23. 0176 GHOST_MAX_MAG F32 -23.5 177 177 END 178 178 179 179 REFSTAR_MASK BOOL TRUE 180 REFSTAR_MASK_MAX_MAG F32 -1 5.0180 REFSTAR_MASK_MAX_MAG F32 -16.0 181 181 REFSTAR_MASK_SATSTAR_MAG_MAX F32 -15.0 182 182 REFSTAR_MASK_SATSTAR_MAG_SLOPE F32 10.15 … … 237 237 GLINT_ANGLE_POS_SLOPE F32 0.07903 238 238 GLINT_ANGLE_POS_REF F32 -575.5 239 GLINT_WIDTH F32 30.0239 GLINT_WIDTH F32 60.0 240 240 241 241 # save glint positions? … … 251 251 252 252 GLINT.REGION METADATA 253 REGION STR [-38000:-2 4000,-20000:+20000]253 REGION STR [-38000:-25000,-20000:+20000] 254 254 GLINT.TYPE STR LEFT 255 255 END 256 256 257 257 GLINT.REGION METADATA 258 REGION STR [+2 4000:+38000,-20000:+20000]258 REGION STR [+25000:+38000,-20000:+20000] 259 259 GLINT.TYPE STR RIGHT 260 260 END 261 261 262 262 GLINT.REGION METADATA 263 REGION STR [-20000:+20000,+2 4000:+38000:]263 REGION STR [-20000:+20000,+25000:+38000:] 264 264 GLINT.TYPE STR TOP 265 265 END 266 266 267 267 GLINT.REGION METADATA 268 REGION STR [-20000:+20000,-38000:-2 4000]268 REGION STR [-20000:+20000,-38000:-25000] 269 269 GLINT.TYPE STR BOTTOM 270 270 END -
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 -
trunk/psastro/src/psastroLoadGhosts.c
r41338 r41348 105 105 psPolynomial2D *centerX = NULL; 106 106 psPolynomial2D *centerY = NULL; 107 psPolynomial1D *mirrorRad = NULL; 107 108 psPolynomial1D *outerMajor = NULL; 108 109 psPolynomial1D *outerMinor = NULL; … … 110 111 psPolynomial1D *innerMinor = NULL; 111 112 112 113 113 pmFPAview *view = pmFPAviewAlloc (0); 114 114 115 GET_1D_POLY ("GHOST.MIRROR.RAD", mirrorRad); 115 116 GET_2D_POLY ("GHOST.CENTER.X", centerX); 116 117 GET_2D_POLY ("GHOST.CENTER.Y", centerY); … … 178 179 ghost->srcFP->y = ref->FP->y; 179 180 180 // 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... 181 ghost->FP->x = -ref->FP->x + psPolynomial2DEval(centerX, -ref->FP->x, -ref->FP->y); 182 ghost->FP->y = -ref->FP->y + psPolynomial2DEval(centerY, -ref->FP->x, -ref->FP->y); 183 184 float rSrc = hypot (ref->FP->x, ref->FP->y); 181 //TdB: first mirror the reference star positions (around the 0,0 pixel) using the radial offset coefficients and the ghost/star angle 182 double rSrc = hypot (ref->FP->x, ref->FP->y); 183 double theta0 = atan2(ref->FP->y,ref->FP->x); 184 185 double ghost_offset_rad = psPolynomial1DEval (mirrorRad, rSrc); 186 double ghost_x_fpa_mirror = ref->FP->x + ((ref->FP->x*-1.)/abs(ref->FP->x)*abs(cos(theta0)*ghost_offset_rad)); 187 double ghost_y_fpa_mirror = ref->FP->y + ((ref->FP->y*-1.)/abs(ref->FP->y)*abs(sin(theta0)*ghost_offset_rad)); 188 189 // Now use the mirrored position together with the 2D ghost center fitting to get the actual ghost position in FPA coords 190 ghost->FP->x = ghost_x_fpa_mirror + psPolynomial2DEval(centerX, ghost_x_fpa_mirror, ghost_y_fpa_mirror); 191 ghost->FP->y = ghost_y_fpa_mirror + psPolynomial2DEval(centerY, ghost_x_fpa_mirror, ghost_y_fpa_mirror); 185 192 186 193 ghost->inner.major = psPolynomial1DEval (innerMajor, rSrc); … … 203 210 ghostChip = psastroFindChip (&ghost->chip->x, &ghost->chip->y, fpa, ghost->FP->x, ghost->FP->y); 204 211 // fprintf (stderr, "-> model chip position: %f, %f\n", ghost->chip->x, ghost->chip->y); 205 206 psPlane coordFPA,ptCH2;207 psPlane coordCell,ptFP2;208 coordCell.x = ghost->chip->x;209 coordCell.y = ghost->chip->y;210 psPlaneTransformApply(&coordFPA,ghostChip->toFPA,&coordCell);211 ptCH2.x = ghost->chip->x;212 ptCH2.y = ghost->chip->y;213 psPlaneTransformApply(&ptFP2,ghostChip->toFPA,&ptCH2);214 215 psPlane ptCH, ptFP;216 ptFP.x = ghost->FP->x;217 ptFP.y = ghost->FP->y;218 psPlaneTransformApply (&ptCH, ghostChip->fromFPA, &ptFP);219 220 psastroUpdateChipToFPA (fpa, ghostChip);221 psPlane ptCH3, ptFP3;222 ptCH3.x = ghost->chip->x;223 ptCH3.y = ghost->chip->y;224 psPlaneTransformApply(&ptFP3,ghostChip->toFPA,&ptCH3);225 226 227 228 psLogMsg ("psastro", 3, "Ghost refpos: %f %f %s pos: %f %f %f %f %f %f %f %f %f %f %f %f mag: %f inshape: %f %f %f outshape: %f %f %f \n", ref->FP->x,ref->FP->y,psMetadataLookupStr(NULL,chip->concepts,"CHIP.NAME"), ghost->FP->x,ghost->FP->y,coordFPA.x,coordFPA.y,ghost->chip->x, ghost->chip->y,ptCH.x,ptCH.y,ptFP2.x,ptFP2.y,ptFP3.x,ptFP3.y, ghost->Mag,ghost->inner.major,ghost->inner.minor,ghost->inner.theta/PM_RAD_DEG,ghost->outer.major,ghost->outer.minor,ghost->outer.theta/PM_RAD_DEG);229 212 230 213 if (ghostChip) { … … 257 240 ghost->outer.major,ghost->outer.minor,ghost->outer.theta); 258 241 } 259 260 261 242 262 243 if (!ghostChip) goto skip; 263 244 if (!ghostChip->cells) goto skip; -
trunk/psastro/src/psastroLoadGlints.c
r41338 r41348 152 152 } 153 153 154 //do a rudimentary check of whether the glint enters the pixel FPA 155 if (!strcasecmp(glintType, "TOP") && ((star->FP->y - glintLength) > 20000.)) continue; 156 if (!strcasecmp(glintType, "BOTTOM") && ((star->FP->y + glintLength) < -20000.)) continue; 157 if (!strcasecmp(glintType, "LEFT") && ((star->FP->x + glintLength) < -20000.)) continue; 158 if (!strcasecmp(glintType, "RIGHT") && ((star->FP->x - glintLength) > 20000.)) continue; 154 159 155 160 psVector *x_glint = psVectorAlloc(2,PS_TYPE_F32); … … 179 184 double yFPAs, yFPAe; 180 185 psastroFindChipYedges (&yFPAs, &yFPAe, fpa, nChip); 186 if (yFPAs > yFPAe) PS_SWAP (yFPAs, yFPAe); 181 187 182 188 xFPA0 = star->FP->x; … … 204 210 double yFPAs, yFPAe; 205 211 psastroFindChipYedges (&yFPAs, &yFPAe, fpa, nChip); 212 if (yFPAs > yFPAe) PS_SWAP (yFPAs, yFPAe); 206 213 207 214 xFPA0 = star->FP->x; … … 218 225 x_glint->data.F32[1] = xFPA1; 219 226 y_glint->data.F32[1] = yFPA1; 227 220 228 221 229 //we need to loop over each corner to select the chips that can have the glint on it … … 243 251 if (yFPA0 > yFPAe) continue; 244 252 if (yFPA1 < yFPAs) continue; 253 245 254 246 255 //find the y-coord positions for this chip … … 322 331 323 332 // FPA coordinates of intersections with chip edges 324 double yFPAs, yFPAe; 325 psastroFindChipYedges (&yFPAs, &yFPAe, fpa, nChip); 326 327 xFPA0 = yFPAe; 333 double xFPAs, xFPAe; 334 psastroFindChipXedges (&xFPAs, &xFPAe, fpa, nChip); 335 if (xFPAs > xFPAe) PS_SWAP (xFPAs, xFPAe); 336 337 xFPA0 = xFPAe; 328 338 yFPA0 = star->FP->y; 329 glintLength-= (star->FP->x- yFPAe);339 glintLength-= (star->FP->x-xFPAe); 330 340 } 331 341 … … 347 357 348 358 // FPA coordinates of intersections with chip edges 349 double yFPAs, yFPAe; 350 psastroFindChipYedges (&yFPAs, &yFPAe, fpa, nChip); 351 352 xFPA0 = yFPAs; 359 double xFPAs, xFPAe; 360 psastroFindChipXedges (&xFPAs, &xFPAe, fpa, nChip); 361 if (xFPAs > xFPAe) PS_SWAP (xFPAs, xFPAe); 362 363 xFPA0 = xFPAs; 353 364 yFPA0 = star->FP->y; 354 glintLength-= ( yFPAs-star->FP->x);365 glintLength-= (xFPAs-star->FP->x); 355 366 } 356 367 … … 431 442 432 443 fprintf (stderr, "glint %s : %d %f,%f to %f,%f (%f %f %f)\n", glintType, nChip, xChip0, yChip0, xChip1, yChip1, glint_length, glintWidth, chip_angle); 444 433 445 psVector *glint = psVectorAlloc(5,PS_TYPE_F32); 434 446 glint->data.F32[0] = xChip0; -
trunk/psastro/src/psastroMaskUpdates.c
r41342 r41348 424 424 psastroGhost *ghost = ghosts->data[i]; 425 425 //offset the ghost angles with the astrometric rotation angle 426 ghost->inner.theta -= (ROT_PARITY * ROTANGLE);427 ghost->outer.theta -= (ROT_PARITY * ROTANGLE);426 ghost->inner.theta = ghost->inner.theta - AST_T0; 427 ghost->outer.theta = ghost->outer.theta - AST_T0; 428 428 // XXX bright vs faint ghost bits? (OR with SUSPECT) 429 429 psastroMaskEllipticalAnnulus (readoutMask->mask, ghostMaskValue, ghost->chip->x, ghost->chip->y, ghost->inner, ghost->outer); … … 444 444 //psastroMaskRectangle (readoutMask->mask, glintMaskValue, glint->x0, glint->y0, glint->x1, glint->y1); 445 445 446 psLogMsg ("psastro", 3, "glint: %d %f %f %f %f %f\n",i, glint->data.F32[0], glint->data.F32[1],glint->data.F32[2], glint->data.F32[3], glint->data.F32[4]); 446 447 psastroMaskBox (readoutMask->mask, glintMaskValue, glint->data.F32[0], glint->data.F32[1], 447 448 glint->data.F32[2], glint->data.F32[3], glint->data.F32[4]);
Note:
See TracChangeset
for help on using the changeset viewer.
