IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jul 18, 2005, 3:44:48 PM (21 years ago)
Author:
drobbin
Message:

psModules now works with the reorganized version of psLib

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psModules/src/psAstrometry.c

    r4577 r4579  
    88 *  @author GLG, MHPCC
    99 *
    10  *  @version $Revision: 1.1 $ $Name: not supported by cvs2svn $
    11  *  @date $Date: 2005-07-18 18:48:29 $
     10 *  @version $Revision: 1.2 $ $Name: not supported by cvs2svn $
     11 *  @date $Date: 2005-07-19 01:44:48 $
    1212 *
    1313 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    2525#include "psError.h"
    2626#include "psConstants.h"
    27 #include "psAstronomyErrors.h"
     27//#include "psAstronomyErrors.h"
    2828#include "psMatrix.h"
    2929#include "psTrace.h"
    3030#include "psLogMsg.h"
     31
    3132
    3233/*****************************************************************************
     
    3536psImage.
    3637 *****************************************************************************/
     38/*
    3739static psS32 checkValidImageCoords(double x,
    3840                                   double y,
     
    4042{
    4143    PS_ASSERT_IMAGE_NON_NULL(tmpImage, 0);
    42 
     44 
    4345    if ((x < 0.0) || (x > (double)tmpImage->numCols) ||
    4446            (y < 0.0) || (y > (double)tmpImage->numRows)) {
    4547        return (0);
    4648    }
    47 
     49 
    4850    return (1);
    4951}
    50 
    51 
     52*/
     53/*
    5254static void FPAFree(psFPA* fpa)
    5355{
     
    6567    }
    6668}
    67 
     69*/
     70
     71/*
    6872static void chipFree(psChip* chip)
    6973{
     
    7579    }
    7680}
    77 
     81*/
     82
     83/*
    7884static void cellFree(psCell* cell)
    7985{
     
    8894    }
    8995}
     96*/
    9097
    9198static void readoutFree(psReadout* readout)
     
    99106}
    100107
     108/*
    101109static void observatoryFree(psObservatory* obs)
    102110{
     
    105113    }
    106114}
    107 
     115*/
     116/*
    108117static void exposureFree(psExposure* exp)
    109118{
     
    115124    }
    116125}
    117 
     126*/
     127/*
    118128static void fixedPatternFree(psFixedPattern* fp)
    119129{
     
    122132            psFree(fp->x[i]);
    123133        }
    124 
     134 
    125135        for (psS32 j = 0; j < fp->p_ps_yRows; j++) {
    126136            psFree(fp->y[j]);
    127137        }
    128 
     138 
    129139        psFree(fp->x);
    130140        psFree(fp->y);
    131141    }
    132142}
    133 
     143*/
    134144/*****************************************************************************/
    135145/* FUNCTION IMPLEMENTATION - PUBLIC                                          */
     
    141151 * XXX: This assumes that x,y must be of type F64
    142152 */
     153/*
    143154psFixedPattern* psFixedPatternAlloc(double x0,
    144                                     double y0,
    145                                     double xScale,
    146                                     double yScale,
    147                                     const psImage *x,
    148                                     const psImage *y)
    149 {
    150     psFixedPattern *tmp;
    151     psS32 i;
    152     psS32 j;
    153 
    154     PS_ASSERT_IMAGE_NON_NULL(x, NULL);
    155     PS_ASSERT_IMAGE_NON_NULL(y, NULL);
    156     PS_ASSERT_IMAGE_TYPE(x, PS_TYPE_F64, NULL);
    157     PS_ASSERT_IMAGE_TYPE(y, PS_TYPE_F64, NULL);
    158 
    159     tmp = (psFixedPattern *) psAlloc(sizeof(psFixedPattern));
    160     // XXX: Is this correct?
    161     tmp->nX = (x->numCols * x->numRows);
    162     tmp->nY = (y->numCols * y->numRows);
    163     tmp->x0 = x0;
    164     tmp->y0 = y0;
    165     tmp->xScale = xScale;
    166     tmp->yScale = yScale;
    167     tmp->p_ps_xRows = x->numRows;
    168     tmp->p_ps_xCols = x->numCols;
    169     tmp->p_ps_yRows = y->numRows;
    170     tmp->p_ps_yCols = y->numCols;
    171     tmp->x = (double **) psAlloc(x->numRows * sizeof(double *));
    172     for (i=0;i<x->numRows;i++) {
    173         (tmp->x)[i] = (double *) psAlloc(x->numCols * sizeof(double));
    174     }
    175     for (i=0;i<x->numRows;i++) {
    176         for (j=0;j<x->numCols;j++) {
    177             (tmp->x)[i][j] = x->data.F64[i][j];
    178         }
    179     }
    180 
    181     tmp->y = (double **) psAlloc(y->numRows * sizeof(double *));
    182     for (i=0;i<y->numRows;i++) {
    183         (tmp->y)[i] = (double *) psAlloc(y->numCols * sizeof(double));
    184     }
    185     for (i=0;i<y->numRows;i++) {
    186         for (j=0;j<y->numCols;j++) {
    187             (tmp->y)[i][j] = y->data.F64[i][j];
    188         }
    189     }
    190 
    191     psMemSetDeallocator(tmp,(psFreeFunc)fixedPatternFree);
    192 
    193     return(tmp);
    194 }
    195 
    196 
     155                                   double y0,
     156                                   double xScale,
     157                                   double yScale,
     158                                   const psImage *x,
     159                                   const psImage *y)
     160{
     161   psFixedPattern *tmp;
     162   psS32 i;
     163   psS32 j;
     164
     165   PS_ASSERT_IMAGE_NON_NULL(x, NULL);
     166   PS_ASSERT_IMAGE_NON_NULL(y, NULL);
     167   PS_ASSERT_IMAGE_TYPE(x, PS_TYPE_F64, NULL);
     168   PS_ASSERT_IMAGE_TYPE(y, PS_TYPE_F64, NULL);
     169
     170   tmp = (psFixedPattern *) psAlloc(sizeof(psFixedPattern));
     171   // XXX: Is this correct?
     172   tmp->nX = (x->numCols * x->numRows);
     173   tmp->nY = (y->numCols * y->numRows);
     174   tmp->x0 = x0;
     175   tmp->y0 = y0;
     176   tmp->xScale = xScale;
     177   tmp->yScale = yScale;
     178   tmp->p_ps_xRows = x->numRows;
     179   tmp->p_ps_xCols = x->numCols;
     180   tmp->p_ps_yRows = y->numRows;
     181   tmp->p_ps_yCols = y->numCols;
     182   tmp->x = (double **) psAlloc(x->numRows * sizeof(double *));
     183   for (i=0;i<x->numRows;i++) {
     184       (tmp->x)[i] = (double *) psAlloc(x->numCols * sizeof(double));
     185   }
     186   for (i=0;i<x->numRows;i++) {
     187       for (j=0;j<x->numCols;j++) {
     188           (tmp->x)[i][j] = x->data.F64[i][j];
     189       }
     190   }
     191
     192   tmp->y = (double **) psAlloc(y->numRows * sizeof(double *));
     193   for (i=0;i<y->numRows;i++) {
     194       (tmp->y)[i] = (double *) psAlloc(y->numCols * sizeof(double));
     195   }
     196   for (i=0;i<y->numRows;i++) {
     197       for (j=0;j<y->numCols;j++) {
     198           (tmp->y)[i][j] = y->data.F64[i][j];
     199       }
     200   }
     201
     202   psMemSetDeallocator(tmp,(psFreeFunc)fixedPatternFree);
     203
     204   return(tmp);
     205}
     206*/
     207/*
    197208psExposure* psExposureAlloc(double ra,
    198209                            double dec,
     
    210221{
    211222    PS_ASSERT_PTR_NON_NULL(observatory, NULL);
    212 
     223 
    213224    psExposure* exp = psAlloc(sizeof(psExposure));
    214225    *(double *)&exp->ra = ra;
     
    223234    *(float *)&exp->exposureTime = exposureTime;
    224235    *(float *)&exp->wavelength = wavelength;
    225 
     236 
    226237    exp->time = psMemIncrRefCounter((psPtr)time);
    227238    exp->observatory = psMemIncrRefCounter((psPtr)observatory);
    228 
     239 
    229240    // XXX: how is this value derived?
    230241    *(double *)&exp->lst = psTimeToLMST((psTime*)time,observatory->longitude);
     
    235246    exp->cameraName = NULL;
    236247    exp->telescopeName = NULL;
    237 
     248 
    238249    psMemSetDeallocator(exp,(psFreeFunc)exposureFree);
    239 
     250 
    240251    return exp;
    241252}
    242 
     253*/
     254/*
    243255psObservatory* psObservatoryAlloc(const char* name,
    244256                                  double latitude,
     
    248260{
    249261    psObservatory* obs = psAlloc(sizeof(psObservatory));
    250 
     262 
    251263    if (name == NULL) {
    252264        obs->name = NULL;
     
    255267        strcpy((char*)obs->name, name);
    256268    }
    257 
     269 
    258270    *(double *)&obs->latitude = latitude;
    259271    *(double *)&obs->longitude = longitude;
    260272    *(double *)&obs->height = height;
    261273    *(double *)&obs->tlr = tlr;
    262 
     274 
    263275    psMemSetDeallocator(obs,(psFreeFunc)observatoryFree);
    264 
     276 
    265277    return obs;
    266278}
    267 
     279*/
     280/*
    268281psFPA* psFPAAlloc(psS32 nChips,
    269282                  const psExposure* exp)
    270283{
    271284    PS_ASSERT_INT_NONNEGATIVE(nChips, NULL);
    272 
     285 
    273286    psFPA* newFPA = psAlloc(sizeof(psFPA));
    274 
     287 
    275288    // create array of NULL chips of the size nChips
    276289    newFPA->chips = psArrayAlloc(nChips);
     
    280293    }
    281294    newFPA->chips->n = 0; // per requirement
    282 
     295 
    283296    newFPA->metadata = NULL;
    284297    newFPA->fromTangentPlane = NULL;
    285298    newFPA->toTangentPlane = NULL;
    286299    newFPA->pattern = NULL;
    287 
     300 
    288301    if (exp != NULL) {
    289302        newFPA->exposure = psMemIncrRefCounter((psExposure*)exp);
     
    293306        newFPA->grommit = NULL;
    294307    }
    295 
     308 
    296309    newFPA->colorPlus = NULL;
    297310    newFPA->colorMinus = NULL;
    298311    newFPA->projection = NULL;
    299 
     312 
    300313    newFPA->rmsX = 0.0f;
    301314    newFPA->rmsY = 0.0f;
    302315    newFPA->chi2 = 0.0f;
    303 
     316 
    304317    psMemSetDeallocator(newFPA,(psFreeFunc)FPAFree);
    305 
     318 
    306319    return newFPA;
    307320}
    308 
     321*/
    309322/*
    310323 * psChip constructor
    311324 */
     325/*
    312326psChip* psChipAlloc(psS32 nCells,
    313327                    psFPA *parentFPA)
    314328{
    315329    PS_ASSERT_INT_NONNEGATIVE(nCells, NULL);
    316 
     330 
    317331    psChip* chip = psAlloc(sizeof(psChip));
    318 
     332 
    319333    // create array of NULL psCells
    320334    int n = (nCells > 0) ? nCells : 1;
     
    325339    }
    326340    chip->cells->n = 0; // per requirement
    327 
     341 
    328342    *(int*)&chip->row0 = 0;
    329343    *(int*)&chip->col0 = 0;
    330 
     344 
    331345    chip->metadata = NULL;
    332 
     346 
    333347    chip->toFPA = NULL;
    334348    chip->fromFPA = NULL;
    335 
     349 
    336350    chip->parent = parentFPA;
    337 
     351 
    338352    psMemSetDeallocator(chip,(psFreeFunc)chipFree);
    339 
     353 
    340354    return chip;
    341 
    342 }
    343 
     355 
     356}
     357*/
    344358/*
    345359 * psCell constructor
    346360 */
     361/*
    347362psCell* psCellAlloc(psS32 nReadouts,
    348363                    psChip* parentChip)
    349364{
    350365    PS_ASSERT_INT_NONNEGATIVE(nReadouts, NULL);
    351 
     366 
    352367    psCell* cell = psAlloc(sizeof(psCell));
    353 
     368 
    354369    // create array of NULL psReadouts
    355370    int n = (nReadouts > 0) ? nReadouts : 1;
     
    360375    }
    361376    cell->readouts->n = 0; // per requirement
    362 
     377 
    363378    *(int*)&cell->row0 = 0;
    364379    *(int*)&cell->col0 = 0;
    365 
     380 
    366381    cell->metadata = NULL;
    367 
     382 
    368383    cell->toChip = NULL;
    369384    cell->fromChip = NULL;
     
    371386    cell->toTP = NULL;
    372387    cell->toSky = NULL;
    373 
     388 
    374389    cell->parent = parentChip;
    375 
     390 
    376391    psMemSetDeallocator(cell,(psFreeFunc)cellFree);
    377 
     392 
    378393    return cell;
    379 
    380 
    381 }
    382 
     394 
     395 
     396}
     397*/
    383398psReadout* psReadoutAlloc()
    384399{
     
    402417}
    403418
     419/*
    404420psGrommit* psGrommitAlloc(const psExposure* exp)
    405421{
    406422    PS_ASSERT_PTR_NON_NULL(exp, NULL);
    407 
     423 
    408424    psSphere* polarMotion = p_psTimeGetPoleCoords(exp->time);
    409 
     425 
    410426    psGrommit* grommit = (psGrommit* ) psAlloc(sizeof(psGrommit));
    411 
     427 
    412428    *(double*)&grommit->latitude = exp->observatory->latitude;
    413429    *(double*)&grommit->longitude = exp->observatory->longitude;
     
    422438    *(double*)&grommit->refractB = polarMotion->d; // XXX: need to figure out what to set here too.
    423439    *(double*)&grommit->siderealTime = psTimeToMJD(exp->time); // XXX: this is probably not correct
    424 
     440 
    425441    psFree(polarMotion);
    426 
     442 
    427443    return (grommit);
    428444}
    429 
     445*/
     446/*
    430447psCell* psCellInFPA(const psPlane* fpaCoord,
    431448                    const psFPA* FPA)
     
    433450    PS_ASSERT_PTR_NON_NULL(fpaCoord, NULL);
    434451    PS_ASSERT_PTR_NON_NULL(FPA, NULL);
    435 
     452 
    436453    psChip* tmpChip = NULL;
    437454    psPlane chipCoord;
    438455    psCell* outCell = NULL;
    439 
     456 
    440457    // Determine which chip contains the fpaCoords.
    441458    tmpChip = psChipInFPA(fpaCoord, FPA);
     
    443460        return(NULL);
    444461    }
    445 
     462 
    446463    // Convert to those chip coordinates.
    447464    psCoordFPAToChip(&chipCoord, fpaCoord, tmpChip);
    448 
     465 
    449466    // Determine which cell contains those chip coordinates.
    450467    outCell = psCellInChip(&chipCoord, tmpChip);
    451 
     468 
    452469    return (outCell);
    453470}
    454 
     471*/
     472/*
    455473psChip* psChipInFPA(const psPlane* fpaCoord,
    456474                    const psFPA* FPA)
     
    459477    PS_ASSERT_PTR_NON_NULL(FPA, NULL);
    460478    PS_ASSERT_PTR_NON_NULL(FPA->chips, NULL);
    461 
     479 
    462480    psArray* chips = FPA->chips;
    463481    psS32 nChips = chips->n;
    464482    psPlane chipCoord;
    465483    psCell *tmpCell = NULL;
    466 
     484 
    467485    // Loop through every chip in this FPA.  Convert the original FPA
    468486    // coordinates to chip coordinates for that chip.  Then, determine if any
    469487    // cells in that chip contain those chip coordinates.
    470 
     488 
    471489    for (psS32 i = 0; i < nChips; i++) {
    472490        psChip* tmpChip = chips->data[i];
    473491        PS_ASSERT_PTR_NON_NULL(tmpChip, NULL);
    474492        PS_ASSERT_PTR_NON_NULL(tmpChip->fromFPA, NULL);
    475 
     493 
    476494        psPlaneTransformApply(&chipCoord, tmpChip->fromFPA, fpaCoord);
    477 
     495 
    478496        tmpCell = psCellInChip(&chipCoord, tmpChip);
    479497        if (tmpCell != NULL) {
     
    481499        }
    482500    }
    483 
     501 
    484502    // XXX: Print warning here?
    485503    return (NULL);
    486504}
    487 
     505*/
     506/*
    488507psCell* psCellInChip(const psPlane* chipCoord,
    489508                     const psChip* chip)
     
    491510    PS_ASSERT_PTR_NON_NULL(chipCoord, NULL);
    492511    PS_ASSERT_PTR_NON_NULL(chip, NULL);
    493 
     512 
    494513    psPlane cellCoord;
    495514    psArray* cells;
    496 
     515 
    497516    cells = chip->cells;
    498517    if (cells == NULL) {
    499518        return NULL;
    500519    }
    501 
     520 
    502521    // We loop over each cell in the chip.  We transform the chipCoord into
    503522    // a cellCoord for that cell and determine if that cellCoord is valid.
    504523    // If so, then we return that cell.
    505 
     524 
    506525    for (psS32 i = 0; i < cells->n; i++) {
    507526        psCell* tmpCell = (psCell* ) cells->data[i];
     
    509528        PS_ASSERT_PTR_NON_NULL(tmpCell->fromChip, NULL);
    510529        psArray* readouts = tmpCell->readouts;
    511 
     530 
    512531        if (readouts != NULL) {
    513532            for (psS32 j = 0; j < readouts->n; j++) {
    514533                psReadout* tmpReadout = readouts->data[j];
    515534                PS_ASSERT_READOUT_NON_NULL(tmpReadout, NULL);
    516 
     535 
    517536                psPlaneTransformApply(&cellCoord,
    518537                                      tmpCell->fromChip,
    519538                                      chipCoord);
    520 
     539 
    521540                if (checkValidImageCoords(cellCoord.x,
    522541                                          cellCoord.y,
     
    527546        }
    528547    }
    529 
     548 
    530549    return (NULL);
    531550}
    532 
     551*/
     552/*
    533553psPlane* psCoordCellToChip(psPlane* outCoord,
    534554                           const psPlane* inCoord,
     
    537557    PS_ASSERT_PTR_NON_NULL(inCoord, NULL);
    538558    PS_ASSERT_PTR_NON_NULL(cell, NULL);
    539 
     559 
    540560    return (psPlaneTransformApply(outCoord, cell->toChip, inCoord));
    541561}
    542 
     562*/
     563/*
    543564psPlane* psCoordChipToFPA(psPlane* outCoord,
    544565                          const psPlane* inCoord,
     
    547568    PS_ASSERT_PTR_NON_NULL(inCoord, NULL);
    548569    PS_ASSERT_PTR_NON_NULL(chip, NULL);
    549 
     570 
    550571    return (psPlaneTransformApply(outCoord, chip->toFPA, inCoord));
    551572}
    552 
     573*/
     574/*
    553575psPlane* psCoordFPAToTP(psPlane* outCoord,
    554576                        const psPlane* inCoord,
     
    559581    PS_ASSERT_PTR_NON_NULL(inCoord, NULL);
    560582    PS_ASSERT_PTR_NON_NULL(fpa, NULL);
    561 
     583 
    562584    return(psPlaneDistortApply(outCoord, fpa->toTangentPlane, inCoord,
    563585                               color, magnitude));
    564586}
    565 
     587*/
    566588/*****************************************************************************
    567589XXX: What about units for the (x,y) coords?
    568590 *****************************************************************************/
     591/*
    569592psSphere* psCoordTPToSky(psSphere* outSphere,
    570593                         const psPlane* tpCoord,
     
    573596    PS_ASSERT_PTR_NON_NULL(tpCoord, NULL);
    574597    PS_ASSERT_PTR_NON_NULL(grommit, NULL);
    575 
     598 
    576599    if (outSphere == NULL) {
    577600        outSphere = (psSphere* ) psAlloc(sizeof(psSphere));
    578601    }
    579 
     602 
    580603    // XXX: this was done by a SLALIB call -- needs to be reimplemented
    581604    psWarning("Warning!  psCoordTPToSky functionality is no longer implemented");
    582     /* slaAopqk(tpCoord->x, tpCoord->y, (double*)grommit,
    583              &AOB, &ZOB, &HOB, &outSphere->r, &outSphere->d); */
    584 
     605    // slaAopqk(tpCoord->x, tpCoord->y, (double*)grommit,
     606    //         &AOB, &ZOB, &HOB, &outSphere->r, &outSphere->d);
     607 
    585608    return (outSphere);
    586609}
    587 
     610*/
     611/*
    588612psPlane* psCoordCellToFPA(psPlane* fpaCoord,
    589613                          const psPlane* cellCoord,
     
    592616    PS_ASSERT_PTR_NON_NULL(cellCoord, NULL);
    593617    PS_ASSERT_PTR_NON_NULL(cell, NULL);
    594 
     618 
    595619    return (psPlaneTransformApply(fpaCoord, cell->toFPA, cellCoord));
    596620}
    597 
     621*/
     622/*
    598623psSphere* psCoordCellToSky(psSphere* skyCoord,
    599624                           const psPlane* cellCoord,
     
    609634    PS_ASSERT_PTR_NON_NULL(cell->parent->parent->toTangentPlane, NULL);
    610635    PS_ASSERT_PTR_NON_NULL(cell->parent->parent->exposure, NULL);
    611 
     636 
    612637    psPlane* fpaCoord = NULL;
    613638    psPlane* tpCoord = NULL;
    614639    psFPA* parFPA = (cell->parent)->parent;
    615640    psGrommit* tmpGrommit = NULL;
    616 
     641 
    617642    // Convert the input cell coordinates to FPA coordinates.
    618643    fpaCoord = psPlaneTransformApply(fpaCoord, cell->toFPA, cellCoord);
    619 
     644 
    620645    // Convert the FPA coordinates to tangent plane Coordinates.
    621646    tpCoord = psPlaneDistortApply(tpCoord, parFPA->toTangentPlane,
    622647                                  fpaCoord, color, magnitude);
    623 
     648 
    624649    // Generate a grommit for this FPA.
    625650    tmpGrommit = psGrommitAlloc(parFPA->exposure);
    626 
     651 
    627652    // Convert the tangent plane Coordinates to sky coordinates.
    628653    skyCoord = psCoordTPToSky(skyCoord, tpCoord, tmpGrommit);
    629 
     654 
    630655    psFree(fpaCoord);
    631656    psFree(tpCoord);
    632657    psFree(tmpGrommit);
    633 
     658 
    634659    return(skyCoord);
    635660}
    636 
     661 
     662*/
     663/*
    637664psSphere* psCoordCellToSkyQuick(psSphere* outSphere,
    638665                                const psPlane* cellCoord,
     
    650677                 "WARNING: psCoordCellToSkyQuick(): The cell->toSky transform is ignored.  The cell->toTP transform is being used.");
    651678    }
    652 
     679 
    653680    psPlane *tpCoord = NULL;
    654681    psChip *chip = cell->parent;
    655682    psFPA *FPA = chip->parent;
    656683    psProjectionType oldProjectionType;
    657 
     684 
    658685    if (outSphere == NULL) {
    659686        outSphere = (psSphere* ) psAlloc(sizeof(psSphere));
    660687    }
    661 
     688 
    662689    // Determine the tangent plane coordinates.
    663690    tpCoord = psPlaneTransformApply(NULL, cell->toTP, cellCoord);
    664 
     691 
    665692    // Save the old projection type and set the new projection type to TAN.
    666693    oldProjectionType = FPA->projection->type;
    667694    FPA->projection->type = PS_PROJ_TAN;
    668 
     695 
    669696    // Deproject the tangent plane coordinates a sphere.
    670697    outSphere = psDeproject(tpCoord, FPA->projection);
    671 
     698 
    672699    // Restore old projection type.  Free memory.
    673700    FPA->projection->type = oldProjectionType;
    674701    psFree(tpCoord);
    675 
     702 
    676703    return (outSphere);
    677704}
     705*/
    678706
    679707/*****************************************************************************
    680708XXX: What about units for the (x,y) coords?
    681709 *****************************************************************************/
     710/*
    682711psPlane* psCoordSkyToTP(psPlane* tpCoord,
    683712                        const psSphere* in,
     
    686715    PS_ASSERT_PTR_NON_NULL(in, NULL);
    687716    PS_ASSERT_PTR_NON_NULL(grommit, NULL);
    688 
     717 
    689718    // char* type = "RA";
    690 
     719 
    691720    if (tpCoord == NULL) {
    692721        tpCoord = (psPlane* ) psAlloc(sizeof(psPlane));
    693722    }
    694 
     723 
    695724    // XXX: this was done by a SLALIB call -- needs to be reimplemented
    696725    psWarning("Warning!  psCoordSkyToTP functionality is no longer implemented");
    697     /* slaOapqk(type, in->r, in->d, (double*)grommit, &tpCoord->x, &tpCoord->y); */
    698 
     726    // slaOapqk(type, in->r, in->d, (double*)grommit, &tpCoord->x, &tpCoord->y);
     727 
    699728    return(tpCoord);
    700729}
    701 
    702 
     730*/
     731/*
    703732psPlane* psCoordTPToFPA(psPlane* fpaCoord,
    704733                        const psPlane* tpCoord,
     
    710739    PS_ASSERT_PTR_NON_NULL(fpa, NULL);
    711740    PS_ASSERT_PTR_NON_NULL(fpa->fromTangentPlane, NULL);
    712 
     741 
    713742    return (psPlaneDistortApply(fpaCoord, fpa->fromTangentPlane,
    714743                                tpCoord, color, magnitude));
    715744}
    716 
     745*/
     746/*
    717747psPlane* psCoordFPAToChip(psPlane* chipCoord,
    718748                          const psPlane* fpaCoord,
     
    722752    PS_ASSERT_PTR_NON_NULL(chip, NULL);
    723753    PS_ASSERT_PTR_NON_NULL(chip->fromFPA, NULL);
    724 
     754 
    725755    chipCoord = psPlaneTransformApply(chipCoord, chip->fromFPA, fpaCoord);
    726756    return(chipCoord);
    727757}
    728 
     758*/
     759/*
    729760psPlane* psCoordChipToCell(psPlane* cellCoord,
    730761                           const psPlane* chipCoord,
     
    734765    PS_ASSERT_PTR_NON_NULL(cell, NULL);
    735766    PS_ASSERT_PTR_NON_NULL(cell->fromChip, NULL);
    736 
     767 
    737768    cellCoord = psPlaneTransformApply(cellCoord, cell->fromChip, chipCoord);
    738769    return(cellCoord);
    739770}
    740 
     771*/
     772/*
    741773psPlane* psCoordSkyToCell(psPlane* cellCoord,
    742774                          const psSphere* skyCoord,
     
    750782    PS_ASSERT_PTR_NON_NULL(cell->parent->parent, NULL);
    751783    PS_ASSERT_PTR_NON_NULL(cell->parent->parent->grommit, NULL);
    752 
     784 
    753785    psChip *parChip = cell->parent;
    754786    psFPA *parFPA = parChip->parent;
    755787    psGrommit* grommit = parFPA->grommit;
    756 
     788 
    757789    // Convert the skyCoords to tangent plane coords.
    758790    psPlane *tpCoord = psCoordSkyToTP(tpCoord, skyCoord, grommit);
    759 
     791 
    760792    // Convert the tangent plane coords to FPA coords.
    761793    psPlane *fpaCoord = psCoordTPToFPA(fpaCoord, tpCoord, color,
    762794                                       magnitude, parFPA);
    763 
     795 
    764796    // Convert the FPA coords to chip coords.
    765797    psPlane *chipCoord = psCoordFPAToChip(chipCoord, fpaCoord, parChip);
    766 
     798 
    767799    // Convert the chip coords to cell coords.
    768800    cellCoord = psCoordChipToCell(cellCoord, chipCoord, cell);
    769 
     801 
    770802    psFree(tpCoord);
    771803    psFree(fpaCoord);
    772804    psFree(chipCoord);
    773 
     805 
    774806    return (cellCoord);
    775807}
    776 
     808*/
     809/*
    777810psPlane* psCoordSkyToCellQuick(psPlane* cellCoord,
    778811                               const psSphere* skyCoord,
     
    790823                 "WARNING: psCoordSkyToCellQuick(): The cell->toSky transform is ignored.  The cell->toTP transform is being used.");
    791824    }
    792 
     825 
    793826    psPlane *tpCoord = NULL;
    794827    psChip *whichChip = cell->parent;
     
    796829    psProjectionType oldProjectionType;
    797830    psPlaneTransform *TPtoCell = NULL;
    798 
     831 
    799832    // Save the old projection type and set the new projection type to TAN.
    800833    oldProjectionType = whichFPA->projection->type;
    801834    whichFPA->projection->type = PS_PROJ_TAN;
    802 
     835 
    803836    if (cellCoord == NULL) {
    804837        cellCoord = (psPlane* ) psAlloc(sizeof(psPlane));
    805838    }
    806 
     839 
    807840    tpCoord = psProject(skyCoord, whichFPA->projection);
    808 
     841 
    809842    // generate an error if cell->toTP is not linear.
    810843    if (0 == p_psIsProjectionLinear(cell->toTP)) {
     
    813846                "cell to tangent plane");
    814847    }
    815 
     848 
    816849    TPtoCell = p_psPlaneTransformLinearInvert(cell->toTP);
    817850    cellCoord = psPlaneTransformApply(cellCoord, TPtoCell, tpCoord);
    818 
     851 
    819852    // Restore old projection type.  Free memory.
    820853    whichFPA->projection->type = oldProjectionType;
     
    822855    return (cellCoord);
    823856}
    824 
    825 
    826 
     857*/
     858
     859
Note: See TracChangeset for help on using the changeset viewer.