IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Aug 11, 2004, 1:53:54 PM (22 years ago)
Author:
gusciora
Message:

...

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/src/astronomy/psAstrometry.c

    r1487 r1491  
    88*  @author George Gusciora, MHPCC
    99*
    10 *  @version $Revision: 1.16 $ $Name: not supported by cvs2svn $
    11 *  @date $Date: 2004-08-11 23:25:18 $
     10*  @version $Revision: 1.17 $ $Name: not supported by cvs2svn $
     11*  @date $Date: 2004-08-11 23:53:42 $
    1212*
    1313*  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    313313
    314314/*****************************************************************************
    315 XXX: not done
     315XXX: After I deproject the tangent plane to a sphere, do I have to do a
     316spherical transformation to get it to the sky?
    316317 *****************************************************************************/
    317318psSphere* psCoordCellToSkyQuick(psSphere* outSphere,
     
    319320                                const psCell* cell)
    320321{
    321     psPlane* tmp1 = NULL;
     322    psPlane *tpCoord = NULL;
     323    psChip *chip = cell->parent;
     324    psFPA *FPA = chip->parent;
     325    psProjectionType oldProjectionType;
    322326
    323327    if (outSphere == NULL) {
     
    325329    }
    326330
    327     tmp1 = psPlaneTransformApply(tmp1, cell->toSky, cellCoord);
    328 
    329     // XXX: Do something to convert the linear coords in tmp1 to spherical
    330     // coords in outSphere.
    331 
    332     psFree(tmp1);
     331    // Determine the tangent plane coordinates.
     332    tpCoord = psPlaneTransformApply(tpCoord, cell->toTP, cellCoord);
     333
     334    // Save the old projection type and set the new projection type to TAN.
     335    oldProjectionType = FPA->projection->type;
     336    FPA->projection->type = PS_PROJ_TAN;
     337
     338    // Deproject the tangent plane coordinates a sphere.
     339    outSphere = psDeproject(tpCoord, FPA->projection);
     340
     341    // Restore old projection type.  Free memory.
     342    FPA->projection->type = oldProjectionType;
     343    psFree(tpCoord);
    333344
    334345    return (outSphere);
     
    430441
    431442/*****************************************************************************
    432 XXX: It is unclear how to perform this transformation.
     443XXX: hmmm
    433444 *****************************************************************************/
    434445psPlane* psCoordSkyToCellQuick(psPlane* cellCoord,
     
    436447                               const psCell* cell)
    437448{
     449    psPlane *tpCoord = NULL;
     450    psChip *whichChip = cell->parent;
     451    psFPA *whichFPA = whichChip->parent;
     452    psProjectionType oldProjectionType;
     453    psPlaneTransform *TPtoCell = NULL;
     454
     455    // Save the old projection type and set the new projection type to TAN.
     456    oldProjectionType = whichFPA->projection->type;
     457    whichFPA->projection->type = PS_PROJ_TAN;
     458
    438459    if (cellCoord == NULL) {
    439460        cellCoord = (psPlane* ) psAlloc(sizeof(psPlane));
    440461    }
    441462
     463    tpCoord = psProject(skyCoord, whichFPA->projection);
     464
     465    // XXX: generate an error if cell->toTP is not linear.
     466
     467    // XXX: Invert cell->toTP, store in TPtoCell.
     468    cellCoord = psPlaneTransformApply(cellCoord, TPtoCell, tpCoord);
     469
     470    // Restore old projection type.  Free memory.
     471    whichFPA->projection->type = oldProjectionType;
     472    psFree(tpCoord);
    442473    return (cellCoord);
    443474}
Note: See TracChangeset for help on using the changeset viewer.