Changeset 41348 for trunk/psastro/src/psastroLoadGlints.c
- Timestamp:
- Apr 28, 2020, 1:26:07 PM (6 years ago)
- File:
-
- 1 edited
-
trunk/psastro/src/psastroLoadGlints.c (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
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;
Note:
See TracChangeset
for help on using the changeset viewer.
