IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Feb 25, 2020, 9:55:36 AM (6 years ago)
Author:
eugene
Message:

handle HSC vs GPC style ghost models. Allow both in ghost model file (code loads GPC and/or HSC ghost models if file contains corresponding elements)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psastro/src/psastroLoadGlints.c

    r40552 r41290  
    364364              if (star_radius_deg < 0.8831) {
    365365                outer_edge_angle = 0.0;
    366               }
    367               else if (star_radius_deg < 0.9368) {
     366              } else if (star_radius_deg < 0.9368) {
    368367                outer_edge_angle = 46.2985 * sqrt(star_radius_deg - 0.8831);
    369               }
    370               else {
     368              } else {
    371369                outer_edge_angle = -2.67 + 14.3 * star_radius_deg;
    372370              }
    373371              if (star_radius_deg < 0.964) {
    374372                inner_edge_angle = -243.866 * pow(star_radius_deg - 0.932,2) + 2.4636;
    375               }
    376               else {
     373              } else {
    377374                inner_edge_angle = 66.2061 * sqrt(star_radius_deg - 0.9635);
    378375              }
     
    383380              // These define the ends of a single arc in arc-centric coordinates
    384381              double x1 = C - R * cos(inner_edge_angle);
    385               double y1 = R * sin(inner_edge_angle);
     382              double y1 =     R * sin(inner_edge_angle);
    386383              double x2 = C - R * cos(outer_edge_angle);
    387               double y2 = R * sin(outer_edge_angle);
     384              double y2 =     R * sin(outer_edge_angle);
    388385
    389386              // Create the endpoints for the pair of arcs in device coordinates (in millimeters)
     
    414411                      x2s,y2s,x2e,y2e);
    415412                     
    416              
     413              // NOTE: the calculations below appear to expect (x1s, y1s) in millimeters, as mentioned above.
     414              // They are then scaled to camera pixel units using 0.015 millimeters / pixel, and then to
     415              // TPA units using 13.5 pixels / pixel.  I do not know where the (12.78, 57.75) mm offsets
     416              // come from (displacement of reference chip?)
     417               
    417418              tp->x = 13.5 * (y1s / 0.015 + 12.78);
    418419              tp->y = 13.5 * (x1s / -0.015 + 57.74);
     
    420421              x_start->data.F32[0] = fp->x;
    421422              y_start->data.F32[0] = fp->y;
    422               //              x_start->data.F32[0] = tp->x;
    423               //              y_start->data.F32[0] = tp->y;
    424423
    425424              tp->x = 13.5 * (y1e / 0.015 + 12.78);
     
    428427              x_end->data.F32[0]   = fp->x;
    429428              y_end->data.F32[0]   = fp->y;
    430               //              x_end->data.F32[0]   = tp->x;
    431               //              y_end->data.F32[0]   = tp->y;
    432429
    433430              x_start->data.F32[1] = x_end->data.F32[0]; 
     
    441438              x_start->data.F32[2] = fp->x;
    442439              y_start->data.F32[2] = fp->y;
    443               //              x_start->data.F32[2] = tp->x;
    444               //              y_start->data.F32[2] = tp->y;
    445440
    446441              tp->x = 13.5 * (y2e / 0.015 + 12.78);
     
    449444              x_end->data.F32[2]   = fp->x;
    450445              y_end->data.F32[2]   = fp->y;
    451               //              x_end->data.F32[2]   = tp->x;
    452               //              y_end->data.F32[2]   = tp->y;
    453446             
    454447              x_start->data.F32[3] = x_end->data.F32[2]; 
Note: See TracChangeset for help on using the changeset viewer.