IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Aug 10, 2004, 1:59:41 PM (22 years ago)
Author:
gusciora
Message:

This is the first compiling version of astometry.c

File:
1 edited

Legend:

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

    r1440 r1463  
    1 
    21/** @file  psAstrometry.c
    32*
     
    98*  @author George Gusciora, MHPCC
    109*
    11 *  @version $Revision: 1.7 $ $Name: not supported by cvs2svn $
    12 *  @date $Date: 2004-08-09 23:34:57 $
     10*  @version $Revision: 1.8 $ $Name: not supported by cvs2svn $
     11*  @date $Date: 2004-08-10 23:59:41 $
    1312*
    1413*  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    2120#include "psMemory.h"
    2221
    23 static void grommitFree(psGrommit* grommit);
    2422static int checkValidChipCoords(double x, double y, psChip* tmpChip);
    2523static int checkValidImageCoords(double x, double y, psImage* tmpImage);
     
    4947}
    5048
     49/*
     50    Several members of the psGrommit data structure have no direct counterpart
     51    in the psExposure structure.  How are we to determine them?
     52*/
    5153psGrommit* psGrommitAlloc(const psExposure* exp)
    5254{
     
    7981}
    8082
    81 void p_psGrommitFree(psGrommit* grommit)
     83void psGrommitFree(psGrommit* grommit)
    8284{
    8385    psFree(grommit);
     
    9496}
    9597
     98/*
     99    XXX: do this
     100*/
    96101int checkValidChipCoords(double x, double y, psChip* tmpChip)
    97102{
     
    120125}
    121126
     127/*
     128    XXX: do this
     129*/
    122130int checkValidImageCoords(double x, double y, psImage* tmpImage)
    123131{
     
    142150psCell* psCellinChip(psCell* out, const psPlane* coord, const psChip* chip)
    143151{
     152    int i = 0;
    144153    psPlane* tmpCoord = NULL;
    145154    psArray* cells;
     
    155164    }
    156165
    157     for (int i = 0; i < cells->n; i++) {
     166    for (i = 0; i < cells->n; i++) {
    158167        psCell* tmpCell = (psCell* ) cells->data[i];
    159168        psArray* readouts = tmpCell->readouts;
     
    210219// transformation, as well as a few psPlane structs.  Can this be implemented
    211220// better?
    212 psSphere* psCoordCelltoSky(psSphere* out, const psPlane* in, const psCell* cell)
     221psSphere* psCoordCelltoSky(psSphere* out,
     222                           const psPlane* in,
     223                           const psCell* cell)
    213224{
    214225    psPlane* tmp1 = NULL;
     
    216227    psFPA* parFPA = (cell->parent)->parent;
    217228    psGrommit* tmpGrommit = NULL;
     229    float XXX1 = 0.0;
     230    float XXX2 = 0.0;
     231
    218232
    219233    tmp1 = psPlaneTransformApply(tmp1, cell->toFPA, in);
    220     tmp2 = psPlaneTransformApply(tmp2, parFPA->toTangentPlane, tmp1);
     234    // XXX:
     235    //
     236    tmp2 = psPlaneDistortApply(tmp2, parFPA->toTangentPlane, tmp1, XXX1, XXX2);
    221237    tmpGrommit = psGrommitAlloc(parFPA->exposure);
    222     tmp3 = psCoordTPtoSky(out, tmp2, psGrommit);
    223 
    224238    psFree(tmp1);
    225239    psFree(tmp2);
    226240    psFree(tmpGrommit);
    227241
    228     return (psCoordTPtoSky(out, tmp2, psGrommit));
    229 
     242    return(psCoordTPtoSky(out, tmp2, tmpGrommit));
    230243}
    231244
     
    247260psPlane* psCoordSkytoTP(psPlane* out, const psSphere* in, const psGrommit* grommit)
    248261{
    249     extern void sla_AOPQK(RAP, DAP, AOPRMS, AOB, ZOB, HOB, DOB, ROB);
    250     double AOB;
    251     double ZOB;
    252     double HOB;
    253     double DOB;
    254     double ROB;
    255 
    256     if (out == NULL) {
    257         out = (psPlane* ) psAlloc(sizeof(psPlane));
    258     }
    259 
    260     sla_AOPQK(psSphere->r, psSphere->d, *grommit, &AOB, &ZOB, &HOB, &DOB, &ROB);
    261     out->x = XXX;
    262     out->y = XXX;
    263     return (out);
    264 }
    265 
     262    /*
     263        extern void sla_AOPQK(RAP, DAP, AOPRMS, AOB, ZOB, HOB, DOB, ROB);
     264        double AOB;
     265        double ZOB;
     266        double HOB;
     267        double DOB;
     268        double ROB;
     269     
     270        if (out == NULL) {
     271            out = (psPlane* ) psAlloc(sizeof(psPlane));
     272        }
     273     
     274        sla_AOPQK(psSphere->r, psSphere->d, *grommit, &AOB, &ZOB, &HOB, &DOB, &ROB);
     275        out->x = XXX;
     276        out->y = XXX;
     277        return (out);
     278    */
     279    return(NULL);
     280}
     281
     282
     283/*
     284    XXX: What are the XXX1 and XXX2 args supposed to be?
     285*/
    266286psPlane* psCoordTPtoFPA(psPlane* out, const psPlane* in, const psFPA* fpa)
    267287{
    268     return (psPlaneTransformApply(out, fpa->fromTangentPlane, in));
     288    float XXX1 = 0.0;
     289    float XXX2 = 0.0;
     290
     291    return (psPlaneDistortApply(out, fpa->fromTangentPlane, in, XXX1, XXX2));
    269292}
    270293
     
    281304psPlane* psCoordSkytoCell(psPlane* out, const psSphere* in, const psCell* cell)
    282305{
    283     out = psCoordSkytoTP(out, in, tmpGrommit);
     306    psGrommit* XXXGrommit = NULL;
     307    psFPA *whichFPA = NULL;
     308    psChip *whichChip = NULL;
     309    psCell *whichCell = NULL;
     310
     311    out = psCoordSkytoTP(out, in, XXXGrommit);
    284312    out = psCoordTPtoFPA(out, out, whichFPA);
    285313    out = psCoordFPAtoChip(out, out, whichChip);
Note: See TracChangeset for help on using the changeset viewer.