IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jan 26, 2005, 10:24:17 AM (21 years ago)
Author:
gusciora
Message:

Added function prototypes for invert, combine, fit. Create the alloc
functions.

File:
1 edited

Legend:

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

    r3000 r3095  
    1010*  @author GLG, MHPCC
    1111*
    12 *  @version $Revision: 1.46 $ $Name: not supported by cvs2svn $
    13 *  @date $Date: 2005-01-14 23:27:55 $
     12*  @version $Revision: 1.47 $ $Name: not supported by cvs2svn $
     13*  @date $Date: 2005-01-26 20:24:16 $
    1414*
    1515*  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    5959/* FUNCTION IMPLEMENTATION - PUBLIC                                          */
    6060/*****************************************************************************/
     61static void planeFree(psPlane *p)
     62{
     63    psFree(p);
     64}
     65
     66// XXX: Must test psPlaneAlloc() and planeFree().
     67// XXX: Must rewrite code and tests to use these functions.
     68psPlane* psPlaneAlloc(void)
     69{
     70    psPlane *p = psAlloc(sizeof(psPlane));
     71
     72    p_psMemSetDeallocator(p, (psFreeFcn) planeFree);
     73    return(p);
     74}
     75
     76
     77static void sphereFree(psSphere *s)
     78{
     79    psFree(s);
     80}
     81
     82// XXX: Must test psSphereAlloc() and sphereFree().
     83// XXX: Must rewrite code and tests to use these functions.
     84psSphere* psSphereAlloc(void)
     85{
     86    psSphere *s = psAlloc(sizeof(psSphere));
     87
     88    p_psMemSetDeallocator(s, (psFreeFcn) sphereFree);
     89    return(s);
     90}
     91
    6192static void planeTransformFree(psPlaneTransform *pt)
    6293{
     
    159190}
    160191
     192// XXX: Must code this.
     193psPlaneTransform *psPlaneTransformInvert(
     194    psPlaneTransform *out,
     195    const psPlaneTransform *in,
     196    psRegion *region,
     197    int nSamples)
     198{
     199    PS_PTR_CHECK_NULL(in, NULL);
     200    PS_PTR_CHECK_NULL(region, NULL);
     201
     202    return(NULL);
     203}
     204
     205
     206// XXX: Must code this.
     207psPlaneTransform *psPlaneTransformCombine(
     208    psPlaneTransform *out,
     209    const psPlaneTransform *trans1,
     210    const psPlaneTransform *trans2)
     211{
     212    PS_PTR_CHECK_NULL(trans1, NULL);
     213    PS_PTR_CHECK_NULL(trans2, NULL);
     214
     215    return(NULL);
     216}
     217
     218
     219// XXX: Must code this.
     220bool psPlaneTranformFit(
     221    psPlaneTransform *trans,
     222    const psArray *source,
     223    const psArray *dest,
     224    int nRejIter,
     225    float sigmaClip)
     226{
     227    PS_PTR_CHECK_NULL(trans, NULL);
     228    PS_PTR_CHECK_NULL(source, NULL);
     229    PS_PTR_CHECK_NULL(dest, NULL);
     230
     231    return(NULL);
     232}
     233
     234
    161235/******************************************************************************
    162236alpha is LONGITUDE
     
    299373}
    300374
     375void projectionFree(psProjection *p)
     376{
     377    psFree(p);
     378}
     379
     380// XXX: Must test psProjectionAlloc() and projectionFree().
     381// XXX: Must rewrite code and tests to use these functions.
     382psProjection* psProjectionAlloc(
     383    psF64 R,
     384    psF64 D,
     385    psF64 Xs,
     386    psF64 Ys,
     387    psProjectionType type)
     388{
     389    psProjection *p = psAlloc(sizeof(psProjection));
     390    p->D = D;
     391    p->R = R;
     392    p->Xs = Xs;
     393    p->Ys = Ys;
     394    p->type = type;
     395
     396    p_psMemSetDeallocator(p, (psFreeFcn) planeFree);
     397    return(p);
     398}
     399
     400
    301401/******************************************************************************
    302402XXX: Waiting for the definition of the PS_PROJ_PAR projection.
     
    323423                psF32 cosThetaSinPhi;
    324424         
    325                 sinTheta = (sin(coord->d) * sin(projection->D)) +
    326                            (cos(coord->d) * cos(projection->D) * (cos(coord->r - projection->R)));
    327                 cosThetaCosPhi = (sin(coord->d) * cos(projection->D)) -
    328                                  (cos(coord->d) * sin(projection->D) * (cos(coord->r - projection->R)));
    329                 cosThetaSinPhi = - cos(coord->d) * sin(coord->r - projection->R);
     425        sinTheta = (sin(coord->d) * sin(projection->D)) +
     426             (cos(coord->d) * cos(projection->D) * (cos(coord->r - projection->R)));
     427        cosThetaCosPhi = (sin(coord->d) * cos(projection->D)) -
     428                   (cos(coord->d) * sin(projection->D) * (cos(coord->r - projection->R)));
     429        cosThetaSinPhi = - cos(coord->d) * sin(coord->r - projection->R);
    330430         
    331431                tmp->x =  -cosThetaSinPhi / sinTheta;
Note: See TracChangeset for help on using the changeset viewer.