IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 1287


Ignore:
Timestamp:
Jul 22, 2004, 5:13:39 PM (22 years ago)
Author:
gusciora
Message:

...

Location:
trunk/psLib/src
Files:
4 edited

Legend:

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

    r1285 r1287  
    1010 *  @author George Gusciora, MHPCC
    1111 *
    12  *  @version $Revision: 1.1 $ $Name: not supported by cvs2svn $
    13  *  @date $Date: 2004-07-23 00:40:36 $
     12 *  @version $Revision: 1.2 $ $Name: not supported by cvs2svn $
     13 *  @date $Date: 2004-07-23 03:13:39 $
    1414 *
    1515 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    2121#include "psList.h"
    2222#include "psCoord.h"
     23#include "psMemory.h"
    2324
    2425
     
    2728                               const psPlane *coords)
    2829{
    29     return(NULL);
     30    if (out == NULL) {
     31        out = (psPlane *) psAlloc(sizeof(psPlane));
     32    }
     33    out->x = transform->x->coeff[0][0] +
     34             (transform->x->coeff[1][0] * coords->x) +
     35             (transform->x->coeff[0][1] * coords->y);
     36
     37    out->y = transform->y->coeff[0][0] +
     38             (transform->y->coeff[1][0] * coords->x) +
     39             (transform->y->coeff[0][1] * coords->y);
     40
     41    return(out);
    3042}
    3143
     
    3749                             float term4)
    3850{
    39     return(NULL);
     51    if (out == NULL) {
     52        out = (psPlane *) psAlloc(sizeof(psPlane));
     53    }
     54
     55    out->x = transform->x->coeff[0][0][0][0] +
     56             (transform->x->coeff[1][0][0][0] * coords->x) +
     57             (transform->x->coeff[0][1][0][0] * coords->y) +
     58             (transform->x->coeff[0][0][1][0] * term3) +
     59             (transform->x->coeff[0][0][0][1] * term4);
     60
     61    out->y = transform->y->coeff[0][0][0][0] +
     62             (transform->y->coeff[1][0][0][0] * coords->x) +
     63             (transform->y->coeff[0][1][0][0] * coords->y) +
     64             (transform->y->coeff[0][0][1][0] * term3) +
     65             (transform->y->coeff[0][0][0][1] * term4);
     66
     67    return(out);
    4068}
    4169
    4270
    4371
    44 psSphereTransform *psSphereTransform(double NPlon,
    45                                      double NPlat;
    46                                      double ZP)
     72psSphereTransform *psSphereTransformAlloc(double NPlon,
     73        double NPlat,
     74        double ZP)
    4775{
    48     return(NULL);
     76    psSphereTransform *tmp = (psSphereTransform *) psAlloc(sizeof(psSphereTransform));
     77
     78    tmp->sinNPlon = sin(NPlon);
     79    tmp->cosNPlon = cos(NPlon);
     80    tmp->sinNPlat = sin(NPlat);
     81    tmp->cosNPlat = cos(NPlat);
     82    tmp->sinZP = sin(ZP);
     83    tmp->cosZP = cos(ZP);
     84
     85    return(tmp);
    4986}
    5087
     
    5289void p_psSphereTransformFree(psSphereTransform *trans)
    5390{
    54     return(NULL);
     91    psFree(trans);
    5592}
    5693
     
    68105psSphereTransform *psSphereTransformICRStoEcliptic(void)
    69106{
     107    // sla_EQECL();
    70108    return(NULL);
    71109}
     
    73111psSphereTransform *psSphereTransformEcliptictoICRS(void)
    74112{
     113    // sla_ECLEQ();
    75114    return(NULL);
    76115}
     
    78117psSphereTransform *psSphereTransformICRStoGalatic(void)
    79118{
     119    // sla_EQGAL();
    80120    return(NULL);
    81121}
     
    83123psSphereTransform *psSphereTransformGalatictoICRS(void)
    84124{
     125    // sla_GALEQL();
    85126    return(NULL);
    86127}
  • trunk/psLib/src/astro/psCoord.h

    r1285 r1287  
    1010 *  @author George Gusciora, MHPCC
    1111 *
    12  *  @version $Revision: 1.1 $ $Name: not supported by cvs2svn $
    13  *  @date $Date: 2004-07-23 00:40:36 $
     12 *  @version $Revision: 1.2 $ $Name: not supported by cvs2svn $
     13 *  @date $Date: 2004-07-23 03:13:39 $
    1414 *
    1515 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    2424#include "psList.h"
    2525#include "psFunctions.h"
    26 
    2726
    2827typedef struct
     
    6968psSphereTransform;
    7069
    71 psPlane *psPlaneTransformApply(psPlane *out,
    72                                const psPlaneTransform *transform,
    73                                const psPlane *coords);
    74 
    75 psPlane *psPlaneDistortApply(psPlane *out,
    76                              const psPlaneDistort *transform,
    77                              const psPlane *coords,
    78                              float term3,
    79                              float term4);
    80 
    81 
    82 psSphereTransform *psSphereTransform(double NPlon,
    83                                      double NPlat;
    84                                      double ZP);
    85 
    86 void p_psSphereTransformFree(psSphereTransform *trans);
    87 
    88 
    89 
    90 psSphere *psSphereTransformApply(psSphere *out,
    91                                  const psSphereTransform *transform,
    92                                  const psSphere *coord);
    93 
    94 psSphereTransform *psSphereTransformICRStoEcliptic(void);
    95 psSphereTransform *psSphereTransformEcliptictoICRS(void);
    96 psSphereTransform *psSphereTransformICRStoGalatic(void);
    97 psSphereTransform *psSphereTransformGalatictoICRS(void);
     70typedef enum {
     71    PS_PROJ_TAN,   ///< Tangent projection
     72    PS_PROJ_SIN,   ///< Sine projection
     73    PS_PROJ_AIT,   ///< Aitoff projection
     74    PS_PROJ_PAR,   ///< Par projection
     75    PS_PROJ_GLS,   ///< GLS projection
     76    PS_PROJ_NTYPE   ///< Number of types; must be last.
     77} psProjectionType;
    9878
    9979typedef struct
     
    10888
    10989typedef enum {
    110     PS_PROJ_TAN,   ///< Tangent projection
    111     PS_PROJ_SIN,   ///< Sine projection
    112     PS_PROJ_AIT,   ///< Aitoff projection
    113     PS_PROJ_PAR,   ///< Par projection
    114     PS_PROJ_GLS,   ///< GLS projection
    115     PS_PROJ_NTYPE   ///< Number of types; must be last.
    116 } psProjectionType;
     90    PS_SPHERICAL,
     91    PS_LINEAR
     92} psSphereOffsetMode;
     93
     94typedef enum {
     95    PS_ARCSEC,
     96    PS_ARCMIN,
     97    PS_DEGREE,
     98    PS_RADIAN
     99} psSphereOffsetUnit;
     100
     101psPlane *psPlaneTransformApply(psPlane *out,
     102                               const psPlaneTransform *transform,
     103                               const psPlane *coords);
     104
     105psPlane *psPlaneDistortApply(psPlane *out,
     106                             const psPlaneDistort *transform,
     107                             const psPlane *coords,
     108                             float term3,
     109                             float term4);
     110
     111
     112psSphereTransform *psSphereTransformAlloc(double NPlon,
     113        double NPlat,
     114        double ZP);
     115
     116void p_psSphereTransformFree(psSphereTransform *trans);
     117
     118psSphere *psSphereTransformApply(psSphere *out,
     119                                 const psSphereTransform *transform,
     120                                 const psSphere *coord);
     121
     122psSphereTransform *psSphereTransformICRStoEcliptic(void);
     123psSphereTransform *psSphereTransformEcliptictoICRS(void);
     124psSphereTransform *psSphereTransformICRStoGalatic(void);
     125psSphereTransform *psSphereTransformGalatictoICRS(void);
     126
     127psPlane *psProject(const psSphere *coord,
     128                   const psProjection *projection);
     129
     130psSphere *psProject(const psPlane *coord,
     131                    const psProjection *projection);
    117132
    118133psSphere *psSphereGetOffset(const psSphere *restrict position1,
     
    126141                            psSphereOffsetUnit unit);
    127142
    128 typedef enum {
    129     PS_SPHERICAL;
    130     PS_LINEAR;
    131 } psSphereOffsetMode;
    132143
    133 typedef enum {
    134     PS_ARCSEC;
    135     PS_ARCMIN;
    136     PS_DEGREE;
    137     PS_RADIAN;
    138 } psSphereOffsetUnit;
     144
    139145
    140146#endif
  • trunk/psLib/src/astronomy/psCoord.c

    r1285 r1287  
    1010 *  @author George Gusciora, MHPCC
    1111 *
    12  *  @version $Revision: 1.1 $ $Name: not supported by cvs2svn $
    13  *  @date $Date: 2004-07-23 00:40:36 $
     12 *  @version $Revision: 1.2 $ $Name: not supported by cvs2svn $
     13 *  @date $Date: 2004-07-23 03:13:39 $
    1414 *
    1515 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    2121#include "psList.h"
    2222#include "psCoord.h"
     23#include "psMemory.h"
    2324
    2425
     
    2728                               const psPlane *coords)
    2829{
    29     return(NULL);
     30    if (out == NULL) {
     31        out = (psPlane *) psAlloc(sizeof(psPlane));
     32    }
     33    out->x = transform->x->coeff[0][0] +
     34             (transform->x->coeff[1][0] * coords->x) +
     35             (transform->x->coeff[0][1] * coords->y);
     36
     37    out->y = transform->y->coeff[0][0] +
     38             (transform->y->coeff[1][0] * coords->x) +
     39             (transform->y->coeff[0][1] * coords->y);
     40
     41    return(out);
    3042}
    3143
     
    3749                             float term4)
    3850{
    39     return(NULL);
     51    if (out == NULL) {
     52        out = (psPlane *) psAlloc(sizeof(psPlane));
     53    }
     54
     55    out->x = transform->x->coeff[0][0][0][0] +
     56             (transform->x->coeff[1][0][0][0] * coords->x) +
     57             (transform->x->coeff[0][1][0][0] * coords->y) +
     58             (transform->x->coeff[0][0][1][0] * term3) +
     59             (transform->x->coeff[0][0][0][1] * term4);
     60
     61    out->y = transform->y->coeff[0][0][0][0] +
     62             (transform->y->coeff[1][0][0][0] * coords->x) +
     63             (transform->y->coeff[0][1][0][0] * coords->y) +
     64             (transform->y->coeff[0][0][1][0] * term3) +
     65             (transform->y->coeff[0][0][0][1] * term4);
     66
     67    return(out);
    4068}
    4169
    4270
    4371
    44 psSphereTransform *psSphereTransform(double NPlon,
    45                                      double NPlat;
    46                                      double ZP)
     72psSphereTransform *psSphereTransformAlloc(double NPlon,
     73        double NPlat,
     74        double ZP)
    4775{
    48     return(NULL);
     76    psSphereTransform *tmp = (psSphereTransform *) psAlloc(sizeof(psSphereTransform));
     77
     78    tmp->sinNPlon = sin(NPlon);
     79    tmp->cosNPlon = cos(NPlon);
     80    tmp->sinNPlat = sin(NPlat);
     81    tmp->cosNPlat = cos(NPlat);
     82    tmp->sinZP = sin(ZP);
     83    tmp->cosZP = cos(ZP);
     84
     85    return(tmp);
    4986}
    5087
     
    5289void p_psSphereTransformFree(psSphereTransform *trans)
    5390{
    54     return(NULL);
     91    psFree(trans);
    5592}
    5693
     
    68105psSphereTransform *psSphereTransformICRStoEcliptic(void)
    69106{
     107    // sla_EQECL();
    70108    return(NULL);
    71109}
     
    73111psSphereTransform *psSphereTransformEcliptictoICRS(void)
    74112{
     113    // sla_ECLEQ();
    75114    return(NULL);
    76115}
     
    78117psSphereTransform *psSphereTransformICRStoGalatic(void)
    79118{
     119    // sla_EQGAL();
    80120    return(NULL);
    81121}
     
    83123psSphereTransform *psSphereTransformGalatictoICRS(void)
    84124{
     125    // sla_GALEQL();
    85126    return(NULL);
    86127}
  • trunk/psLib/src/astronomy/psCoord.h

    r1285 r1287  
    1010 *  @author George Gusciora, MHPCC
    1111 *
    12  *  @version $Revision: 1.1 $ $Name: not supported by cvs2svn $
    13  *  @date $Date: 2004-07-23 00:40:36 $
     12 *  @version $Revision: 1.2 $ $Name: not supported by cvs2svn $
     13 *  @date $Date: 2004-07-23 03:13:39 $
    1414 *
    1515 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    2424#include "psList.h"
    2525#include "psFunctions.h"
    26 
    2726
    2827typedef struct
     
    6968psSphereTransform;
    7069
    71 psPlane *psPlaneTransformApply(psPlane *out,
    72                                const psPlaneTransform *transform,
    73                                const psPlane *coords);
    74 
    75 psPlane *psPlaneDistortApply(psPlane *out,
    76                              const psPlaneDistort *transform,
    77                              const psPlane *coords,
    78                              float term3,
    79                              float term4);
    80 
    81 
    82 psSphereTransform *psSphereTransform(double NPlon,
    83                                      double NPlat;
    84                                      double ZP);
    85 
    86 void p_psSphereTransformFree(psSphereTransform *trans);
    87 
    88 
    89 
    90 psSphere *psSphereTransformApply(psSphere *out,
    91                                  const psSphereTransform *transform,
    92                                  const psSphere *coord);
    93 
    94 psSphereTransform *psSphereTransformICRStoEcliptic(void);
    95 psSphereTransform *psSphereTransformEcliptictoICRS(void);
    96 psSphereTransform *psSphereTransformICRStoGalatic(void);
    97 psSphereTransform *psSphereTransformGalatictoICRS(void);
     70typedef enum {
     71    PS_PROJ_TAN,   ///< Tangent projection
     72    PS_PROJ_SIN,   ///< Sine projection
     73    PS_PROJ_AIT,   ///< Aitoff projection
     74    PS_PROJ_PAR,   ///< Par projection
     75    PS_PROJ_GLS,   ///< GLS projection
     76    PS_PROJ_NTYPE   ///< Number of types; must be last.
     77} psProjectionType;
    9878
    9979typedef struct
     
    10888
    10989typedef enum {
    110     PS_PROJ_TAN,   ///< Tangent projection
    111     PS_PROJ_SIN,   ///< Sine projection
    112     PS_PROJ_AIT,   ///< Aitoff projection
    113     PS_PROJ_PAR,   ///< Par projection
    114     PS_PROJ_GLS,   ///< GLS projection
    115     PS_PROJ_NTYPE   ///< Number of types; must be last.
    116 } psProjectionType;
     90    PS_SPHERICAL,
     91    PS_LINEAR
     92} psSphereOffsetMode;
     93
     94typedef enum {
     95    PS_ARCSEC,
     96    PS_ARCMIN,
     97    PS_DEGREE,
     98    PS_RADIAN
     99} psSphereOffsetUnit;
     100
     101psPlane *psPlaneTransformApply(psPlane *out,
     102                               const psPlaneTransform *transform,
     103                               const psPlane *coords);
     104
     105psPlane *psPlaneDistortApply(psPlane *out,
     106                             const psPlaneDistort *transform,
     107                             const psPlane *coords,
     108                             float term3,
     109                             float term4);
     110
     111
     112psSphereTransform *psSphereTransformAlloc(double NPlon,
     113        double NPlat,
     114        double ZP);
     115
     116void p_psSphereTransformFree(psSphereTransform *trans);
     117
     118psSphere *psSphereTransformApply(psSphere *out,
     119                                 const psSphereTransform *transform,
     120                                 const psSphere *coord);
     121
     122psSphereTransform *psSphereTransformICRStoEcliptic(void);
     123psSphereTransform *psSphereTransformEcliptictoICRS(void);
     124psSphereTransform *psSphereTransformICRStoGalatic(void);
     125psSphereTransform *psSphereTransformGalatictoICRS(void);
     126
     127psPlane *psProject(const psSphere *coord,
     128                   const psProjection *projection);
     129
     130psSphere *psProject(const psPlane *coord,
     131                    const psProjection *projection);
    117132
    118133psSphere *psSphereGetOffset(const psSphere *restrict position1,
     
    126141                            psSphereOffsetUnit unit);
    127142
    128 typedef enum {
    129     PS_SPHERICAL;
    130     PS_LINEAR;
    131 } psSphereOffsetMode;
    132143
    133 typedef enum {
    134     PS_ARCSEC;
    135     PS_ARCMIN;
    136     PS_DEGREE;
    137     PS_RADIAN;
    138 } psSphereOffsetUnit;
     144
    139145
    140146#endif
Note: See TracChangeset for help on using the changeset viewer.