IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 3095


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.

Location:
trunk/psLib/src
Files:
6 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;
  • trunk/psLib/src/astro/psCoord.h

    r2664 r3095  
    1010*  @author GLG, MHPCC
    1111*
    12 *  @version $Revision: 1.23 $ $Name: not supported by cvs2svn $
    13 *  @date $Date: 2004-12-08 18:23:54 $
     12*  @version $Revision: 1.24 $ $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
     
    167167} psSphereOffsetUnit;
    168168
     169/** Allocates a psPlane
     170 *
     171 *  @return psPlane*     resulting plane structure.
     172 */
     173
     174psPlane* psPlaneAlloc(void);
     175
     176/** Allocates a psSphere
     177 *
     178 *  @return psSphere*     resulting sphere structure.
     179 */
     180
     181psSphere* psSphereAlloc(void);
     182
     183
    169184/** Allocates a psPlaneTransform transform.
    170185 *
     
    212227);
    213228
     229// XXX: Doxygenate.
     230psPlaneTransform *psPlaneTransformInvert(
     231    psPlaneTransform *out,
     232    const psPlaneTransform *in,
     233    psRegion *region,
     234    int nSamples
     235);
     236
     237// XXX: Doxygenate.
     238psPlaneTransform *psPlaneTransformCombine(
     239    psPlaneTransform *out,
     240    const psPlaneTransform *trans1,
     241    const psPlaneTransform *trans2
     242);
     243
     244// XXX: Doxygenate.
     245bool psPlaneTranformFit(
     246    psPlaneTransform *trans,
     247    const psArray *source,
     248    const psArray *dest,
     249    int nRejIter,
     250    float sigmaClip
     251);
     252
     253
     254
    214255/** Allocator for psSphereTransform
    215256 *
     
    262303 */
    263304psSphereTransform* psSphereTransformGalaticToICRS(void);
     305
     306/** Allocates memory for a psProjection structure
     307 *
     308 *  @return psProjection*    psProjection structure
     309 */
     310psProjection* psProjectionAlloc(
     311    psF64 R,                   ///< Right-ascension of projection center.
     312    psF64 D,                   ///< Declination of projection center.
     313    psF64 Xs,                  ///< Scale in x-dimension
     314    psF64 Ys,                  ///< Scale in y-dimension
     315    psProjectionType type
     316);
    264317
    265318/** Projects a spherical coordinate to a linear coordinate system
  • trunk/psLib/src/astronomy/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;
  • trunk/psLib/src/astronomy/psCoord.h

    r2664 r3095  
    1010*  @author GLG, MHPCC
    1111*
    12 *  @version $Revision: 1.23 $ $Name: not supported by cvs2svn $
    13 *  @date $Date: 2004-12-08 18:23:54 $
     12*  @version $Revision: 1.24 $ $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
     
    167167} psSphereOffsetUnit;
    168168
     169/** Allocates a psPlane
     170 *
     171 *  @return psPlane*     resulting plane structure.
     172 */
     173
     174psPlane* psPlaneAlloc(void);
     175
     176/** Allocates a psSphere
     177 *
     178 *  @return psSphere*     resulting sphere structure.
     179 */
     180
     181psSphere* psSphereAlloc(void);
     182
     183
    169184/** Allocates a psPlaneTransform transform.
    170185 *
     
    212227);
    213228
     229// XXX: Doxygenate.
     230psPlaneTransform *psPlaneTransformInvert(
     231    psPlaneTransform *out,
     232    const psPlaneTransform *in,
     233    psRegion *region,
     234    int nSamples
     235);
     236
     237// XXX: Doxygenate.
     238psPlaneTransform *psPlaneTransformCombine(
     239    psPlaneTransform *out,
     240    const psPlaneTransform *trans1,
     241    const psPlaneTransform *trans2
     242);
     243
     244// XXX: Doxygenate.
     245bool psPlaneTranformFit(
     246    psPlaneTransform *trans,
     247    const psArray *source,
     248    const psArray *dest,
     249    int nRejIter,
     250    float sigmaClip
     251);
     252
     253
     254
    214255/** Allocator for psSphereTransform
    215256 *
     
    262303 */
    263304psSphereTransform* psSphereTransformGalaticToICRS(void);
     305
     306/** Allocates memory for a psProjection structure
     307 *
     308 *  @return psProjection*    psProjection structure
     309 */
     310psProjection* psProjectionAlloc(
     311    psF64 R,                   ///< Right-ascension of projection center.
     312    psF64 D,                   ///< Declination of projection center.
     313    psF64 Xs,                  ///< Scale in x-dimension
     314    psF64 Ys,                  ///< Scale in y-dimension
     315    psProjectionType type
     316);
    264317
    265318/** Projects a spherical coordinate to a linear coordinate system
  • trunk/psLib/src/dataManip/psStats.c

    r3000 r3095  
    99 *  @author GLG, MHPCC
    1010 *
    11  *  @version $Revision: 1.110 $ $Name: not supported by cvs2svn $
    12  *  @date $Date: 2005-01-14 23:27:56 $
     11 *  @version $Revision: 1.111 $ $Name: not supported by cvs2svn $
     12 *  @date $Date: 2005-01-26 20:24:17 $
    1313 *
    1414 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    11191119These macros and functions define the following functions:
    11201120 
    1121     p_psNormalizeVectorRange(myData, low, high)
     1121<    p_psNormalizeVectorRange(myData, low, high)
    11221122 
    11231123That assumes that the low/high arguments are PS_TYPE_F64; the vector myData
  • trunk/psLib/src/math/psStats.c

    r3000 r3095  
    99 *  @author GLG, MHPCC
    1010 *
    11  *  @version $Revision: 1.110 $ $Name: not supported by cvs2svn $
    12  *  @date $Date: 2005-01-14 23:27:56 $
     11 *  @version $Revision: 1.111 $ $Name: not supported by cvs2svn $
     12 *  @date $Date: 2005-01-26 20:24:17 $
    1313 *
    1414 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    11191119These macros and functions define the following functions:
    11201120 
    1121     p_psNormalizeVectorRange(myData, low, high)
     1121<    p_psNormalizeVectorRange(myData, low, high)
    11221122 
    11231123That assumes that the low/high arguments are PS_TYPE_F64; the vector myData
Note: See TracChangeset for help on using the changeset viewer.