IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 1463


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

This is the first compiling version of astometry.c

Location:
trunk/psLib/src
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/src/astro/psCoord.c

    r1440 r1463  
    1111*  @author George Gusciora, MHPCC
    1212*
    13 *  @version $Revision: 1.13 $ $Name: not supported by cvs2svn $
    14 *  @date $Date: 2004-08-09 23:34:57 $
     13*  @version $Revision: 1.14 $ $Name: not supported by cvs2svn $
     14*  @date $Date: 2004-08-10 23:59:41 $
    1515*
    1616*  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    3131static float arg(float x, float y);
    3232
    33 // This is the only function in this file which I understand.
    34 psPlane* psPlaneTransformApply(psPlane* out, const psPlaneTransform* transform, const psPlane* coords)
     33psPlane* psPlaneTransformApply(psPlane* out,
     34                               const psPlaneTransform* transform,
     35                               const psPlane* coords)
    3536{
    3637    if (out == NULL) {
     
    5051psPlane* psPlaneDistortApply(psPlane* out,
    5152                             const psPlaneDistort* transform,
    52                              const psPlane* coords, float term3, float term4)
     53                             const psPlane* coords,
     54                             float term3,
     55                             float term4)
    5356{
    5457    if (out == NULL) {
     
    5962             (transform->x->coeff[1][0][0][0] * coords->x) +
    6063             (transform->x->coeff[0][1][0][0] * coords->y) +
    61              (transform->x->coeff[0][0][1][0] * term3) + (transform->x->coeff[0][0][0][1] * term4);
     64             (transform->x->coeff[0][0][1][0] * term3) +
     65             (transform->x->coeff[0][0][0][1] * term4);
    6266
    6367    out->y = transform->y->coeff[0][0][0][0] +
    6468             (transform->y->coeff[1][0][0][0] * coords->x) +
    6569             (transform->y->coeff[0][1][0][0] * coords->y) +
    66              (transform->y->coeff[0][0][1][0] * term3) + (transform->y->coeff[0][0][0][1] * term4);
     70             (transform->y->coeff[0][0][1][0] * term3) +
     71             (transform->y->coeff[0][0][0][1] * term4);
    6772
    6873    return (out);
  • trunk/psLib/src/astronomy/Makefile

    r1382 r1463  
    99SRC_OBJS = psTime.o \
    1010           psMetadata.o \
    11            psCoord.o
    12 #           psAstrometry.o             George, this is crap code!
     11           psCoord.o \
     12           psAstrometry.o
    1313
    1414OBJS = $(addprefix makedir/,$(SRC_OBJS))
  • 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);
  • trunk/psLib/src/astronomy/psAstrometry.h

    r1441 r1463  
    99*  @author George Gusciora, MHPCC
    1010*
    11 *  @version $Revision: 1.9 $ $Name: not supported by cvs2svn $
    12 *  @date $Date: 2004-08-09 23:40:54 $
     11*  @version $Revision: 1.10 $ $Name: not supported by cvs2svn $
     12*  @date $Date: 2004-08-10 23:59:41 $
    1313*
    1414*  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    132132 *
    133133 *  A chip consists of one or more cells (according to the number of amplifiers
    134  *  on the CCD). It contains a pointer to the chip's metadata, and a pointer   
    135  *  to the parent focal plane.  For astrometry, ot contains a coordinate
     134 *  on the CCD). It contains a pointer to the chip's metadata, and a pointer
     135 *  to the parent focal plane.  For astrometry, it contains a coordinate
    136136 *  transform from the chip to the focal plane, and vis-versa.
    137137 *
     
    238238                         );
    239239
     240void psGrommitFree(psGrommit *grommit);
     241
    240242psCell* psCellinFPA(psCell* out, const psPlane* coord, const psFPA* FPA);
    241243
  • trunk/psLib/src/astronomy/psCoord.c

    r1440 r1463  
    1111*  @author George Gusciora, MHPCC
    1212*
    13 *  @version $Revision: 1.13 $ $Name: not supported by cvs2svn $
    14 *  @date $Date: 2004-08-09 23:34:57 $
     13*  @version $Revision: 1.14 $ $Name: not supported by cvs2svn $
     14*  @date $Date: 2004-08-10 23:59:41 $
    1515*
    1616*  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    3131static float arg(float x, float y);
    3232
    33 // This is the only function in this file which I understand.
    34 psPlane* psPlaneTransformApply(psPlane* out, const psPlaneTransform* transform, const psPlane* coords)
     33psPlane* psPlaneTransformApply(psPlane* out,
     34                               const psPlaneTransform* transform,
     35                               const psPlane* coords)
    3536{
    3637    if (out == NULL) {
     
    5051psPlane* psPlaneDistortApply(psPlane* out,
    5152                             const psPlaneDistort* transform,
    52                              const psPlane* coords, float term3, float term4)
     53                             const psPlane* coords,
     54                             float term3,
     55                             float term4)
    5356{
    5457    if (out == NULL) {
     
    5962             (transform->x->coeff[1][0][0][0] * coords->x) +
    6063             (transform->x->coeff[0][1][0][0] * coords->y) +
    61              (transform->x->coeff[0][0][1][0] * term3) + (transform->x->coeff[0][0][0][1] * term4);
     64             (transform->x->coeff[0][0][1][0] * term3) +
     65             (transform->x->coeff[0][0][0][1] * term4);
    6266
    6367    out->y = transform->y->coeff[0][0][0][0] +
    6468             (transform->y->coeff[1][0][0][0] * coords->x) +
    6569             (transform->y->coeff[0][1][0][0] * coords->y) +
    66              (transform->y->coeff[0][0][1][0] * term3) + (transform->y->coeff[0][0][0][1] * term4);
     70             (transform->y->coeff[0][0][1][0] * term3) +
     71             (transform->y->coeff[0][0][0][1] * term4);
    6772
    6873    return (out);
Note: See TracChangeset for help on using the changeset viewer.