IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jun 25, 2009, 2:00:56 PM (17 years ago)
Author:
eugene
Message:

merging changes from head

Location:
branches/eam_branches/20090522
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/20090522

  • branches/eam_branches/20090522/magic/remove/src

    • Property svn:ignore
      •  

        old new  
        33streakscompare
        44streaksrelease
         5makefile
  • branches/eam_branches/20090522/magic/remove/src/streaksastrom.c

    r21437 r24557  
    150150 
    151151bool
     152SkyToLocal(strkPt *outPt, strkAstrom *astrom, double ra, double dec)
     153{
     154    // generate a local project using the RA, DEC of the 0,0 pixel of the chip as the
     155    // projection center with the same plate scale as the nominal TP->Sky astrometry.
     156
     157    pmFPA *fpa   = (pmFPA *) astrom->fpa;
     158    pmChip *chip = (pmChip *) astrom->chip;
     159
     160    // find the RA,DEC coords of the 0,0 pixel for this chip:
     161
     162    psPlane ptTP;
     163    psSphere ptSky;
     164
     165    ptSky.r = ra;
     166    ptSky.d = dec;
     167    ptSky.rErr = 0.0;
     168    ptSky.dErr = 0.0;
     169
     170    psProject(&ptTP, &ptSky, fpa->toSky);
     171
     172    outPt->x = ptTP.x;
     173    outPt->y = ptTP.y;
     174
     175    return true;
     176}
     177
     178bool
     179LocalToSky(strkPt *outPt, strkAstrom *astrom, strkPt *inPt)
     180{
     181    // generate a local project using the RA, DEC of the 0,0 pixel of the chip as the
     182    // projection center with the same plate scale as the nominal TP->Sky astrometry.
     183
     184    pmFPA *fpa   = (pmFPA *) astrom->fpa;
     185    pmChip *chip = (pmChip *) astrom->chip;
     186
     187    // find the RA,DEC coords of the 0,0 pixel for this chip:
     188
     189    psPlane ptTP;
     190    psSphere ptSky;
     191
     192    ptTP.x = inPt->x;
     193    ptTP.y = inPt->y;
     194    ptTP.xErr = 0.0;
     195    ptTP.yErr = 0.0;
     196
     197    psDeproject(&ptSky, &ptTP, fpa->toSky);
     198
     199    outPt->x = ptSky.r;
     200    outPt->y = ptSky.d;
     201
     202    return true;
     203}
     204
     205bool
     206componentBounds(int *minX, int *minY, int *maxX, int *maxY, strkAstrom *astrom, int numCols, int numRows)
     207{
     208    // find the bounds of the (padded) chip region in tangent-plane coordinates
     209
     210    pmFPA *fpa   = (pmFPA *) astrom->fpa;
     211    pmChip *chip = (pmChip *) astrom->chip;
     212
     213    psPlane ptCH, ptFP, TPo, TPx, TPy;
     214
     215    // coordinate of the chip center:
     216    ptCH.x = 0.5*numCols;
     217    ptCH.y = 0.5*numRows;
     218    psPlaneTransformApply(&ptFP, chip->toFPA, &ptCH);
     219    psPlaneTransformApply(&TPo, fpa->toTPA,  &ptFP);
     220
     221    // coordinate of the chip center + dX/2:
     222    ptCH.x = numCols;
     223    ptCH.y = 0.5*numRows;
     224    psPlaneTransformApply(&ptFP, chip->toFPA, &ptCH);
     225    psPlaneTransformApply(&TPx, fpa->toTPA,  &ptFP);
     226
     227    // coordinate of the chip center + dY/2:
     228    ptCH.x = 0.5*numCols;
     229    ptCH.y = numRows;
     230    psPlaneTransformApply(&ptFP, chip->toFPA, &ptCH);
     231    psPlaneTransformApply(&TPy, fpa->toTPA,  &ptFP);
     232
     233    // half-lengths of the two sides in tangent-plane coords:
     234    double xSize = hypot (TPx.x - TPo.x, TPx.y - TPo.y);
     235    double ySize = hypot (TPy.x - TPo.x, TPy.y - TPo.y);
     236    double radius = hypot (xSize, ySize);
     237
     238    // define the region encompassed by the radius with some padding:
     239    *minX = TPo.x - 1.1*radius;
     240    *minY = TPo.y - 1.1*radius;
     241    *maxX = TPo.x + 1.1*radius;
     242    *maxY = TPo.y + 1.1*radius;
     243
     244    return true;
     245}
     246
     247bool
    152248skyToCell(strkPt *outPt, strkAstrom *astrom, double ra, double dec)
    153249{
Note: See TracChangeset for help on using the changeset viewer.