IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Aug 16, 2007, 8:52:31 AM (19 years ago)
Author:
eugene
Message:

adding input psf

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ppSim/src/ppSimLoadStars.c

    r14463 r14531  
    2222    float radius = 0.5 * PS_MAX(bounds->x1 - bounds->x0, bounds->y1 - bounds->y0) * scale;
    2323    psFree(bounds);
     24
     25    float x0fpa = 0.5*(bounds->x0 + bounds->x1);
     26    float y0fpa = 0.5*(bounds->y0 + bounds->y1);
    2427
    2528    psMetadataAdd(astroRecipe, PS_LIST_TAIL, "RA_MIN",  PS_DATA_F32 | PS_META_REPLACE, "", ra0 - radius);
     
    4750
    4851        // Convert to x,y position on tangent plane, in pixels
    49         float div = sin(star->ra) * sin(dec0) + cos(star->dec) * cos(dec0) * cos(star->ra - ra0) / scale;
     52        float div = (sin(star->ra) * sin(dec0) + cos(star->dec) * cos(dec0) * cos(star->ra - ra0)) * scale;
    5053        float xi = cos(star->dec) * sin(star->ra - ra0) / div;
    5154        float eta = (sin(star->dec) * cos(dec0) - cos(star->dec) * sin(dec0) * cos(star->ra - ra0)) / div;
    5255
    53         // Apply rotation
    54         star->x = cos(pa) * xi - sin(pa) * eta;
    55         star->y = sin(pa) * xi + cos(pa) * eta;
     56        // Apply rotation, make FPA center of boresite
     57        star->x = cos(pa) * xi - sin(pa) * eta + x0fpa;
     58        star->y = sin(pa) * xi + cos(pa) * eta + y0fpa;
    5659
    5760        // Convert magnitude to peak flux
Note: See TracChangeset for help on using the changeset viewer.