IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Feb 9, 2005, 4:36:42 PM (21 years ago)
Author:
desonia
Message:

prepared the config/data directories to be installed into standard areas.

Location:
trunk/psLib/src/astronomy
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/src/astronomy/astronomy.i

    r3169 r3182  
    1717// add a method to add primitives to metadata
    1818%inline %{
    19 psBool psMetadataAddStr(psMetadata* md, psS32 where, const char* name, const char* comment, const char* value) {
     19psBool psMetadataAddStr(psMetadata* md, psS32 where, const char* name,
     20const char* comment, const char* value) {
    2021    return psMetadataAdd(md,where,name,PS_TYPE_PTR, PS_META_STR,comment,value);
    2122}
    22 psBool psMetadataAddF32(psMetadata* md, psS32 where, const char* name, const char* comment, psF32 value) {
     23psBool psMetadataAddF32(psMetadata* md,
     24                        psS32 where,
     25                        const char* name,
     26                        const char* comment,
     27                        psF32 value)
     28{
    2329    return psMetadataAdd(md,where,name,PS_TYPE_F32, PS_META_PRIMITIVE,comment,value);
    2430}
    25 psBool psMetadataAddF64(psMetadata* md, psS32 where, const char* name, const char* comment, psF64 value) {
     31
     32psBool psMetadataAddF64(psMetadata* md,
     33                        psS32 where,
     34                        const char* name,
     35                        const char* comment,
     36                        psF64 value)
     37{
    2638    return psMetadataAdd(md,where,name,PS_TYPE_F64, PS_META_PRIMITIVE,comment,value);
    2739}
    28 psBool psMetadataAddS32(psMetadata* md, psS32 where, const char* name, const char* comment, psS32 value) {
     40
     41psBool psMetadataAddS32(psMetadata* md,
     42                        psS32 where,
     43                        const char* name,
     44                        const char* comment,
     45                        psS32 value)
     46{
    2947    return psMetadataAdd(md,where,name,PS_TYPE_S32, PS_META_PRIMITIVE,comment,value);
    3048}
    3149
    32 psMetadataItem* psMetadataItemAllocStr(const char* name, const char* comment, const char* value) {
     50psMetadataItem* psMetadataItemAllocStr(const char* name,
     51                                       const char* comment,
     52                                       const char* value)
     53{
    3354    return psMetadataItemAlloc(name, PS_TYPE_PTR, PS_META_STR, comment, value);
    3455}
    35 psMetadataItem* psMetadataItemAllocF32(const char* name, const char* comment, psF32 value) {
     56
     57psMetadataItem* psMetadataItemAllocF32(const char* name,
     58                                       const char* comment,
     59                                       psF32 value)
     60{
    3661    return psMetadataItemAlloc(name, PS_TYPE_F32, PS_META_PRIMITIVE, comment, value);
    3762}
    38 psMetadataItem* psMetadataItemAllocF64(const char* name, const char* comment, psF64 value) {
     63
     64psMetadataItem* psMetadataItemAllocF64(const char* name,
     65                                       const char* comment,
     66                                       psF64 value)
     67{
    3968    return psMetadataItemAlloc(name, PS_TYPE_F64, PS_META_PRIMITIVE, comment, value);
    4069}
    41 psMetadataItem* psMetadataItemAllocS32(const char* name, const char* comment, psS32 value) {
     70
     71psMetadataItem* psMetadataItemAllocS32(const char* name,
     72                                       const char* comment,
     73                                       psS32 value)
     74{
    4275    return psMetadataItemAlloc(name, PS_TYPE_S32, PS_META_PRIMITIVE, comment, value);
    4376}
  • trunk/psLib/src/astronomy/psCoord.c

    r3114 r3182  
    1010*  @author GLG, MHPCC
    1111*
    12 *  @version $Revision: 1.49 $ $Name: not supported by cvs2svn $
    13 *  @date $Date: 2005-02-03 00:45:06 $
     12*  @version $Revision: 1.50 $ $Name: not supported by cvs2svn $
     13*  @date $Date: 2005-02-10 02:36:41 $
    1414*
    1515*  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    267267{
    268268    while (angle < FLT_EPSILON) {
    269         angle+=M_PI;
    270     }
    271 
    272     while (angle >= M_PI) {
    273         angle-=M_PI;
     269        angle+=PS_PI;
     270    }
     271
     272    while (angle >= PS_PI) {
     273        angle-=PS_PI;
    274274    }
    275275    return(angle);
     
    547547        R = PS_SQRT_F32((coord->x * coord->x) + (coord->y * coord->y));
    548548        tmp->d = atan2(-coord->y, coord->x);
    549         tmp->r = acos((R * M_PI) / 180.0);
     549        tmp->r = acos((R * PS_PI) / 180.0);
    550550
    551551    } else if (projection->type == PS_PROJ_CAR) {
     
    555555    } else if (projection->type == PS_PROJ_MER) {
    556556        tmp->d = coord->x;
    557         tmp->r = (2.0 * atan(exp((coord->y * M_PI / 180.0)))) - 180.0;
     557        tmp->r = (2.0 * atan(exp((coord->y * PS_PI / 180.0)))) - 180.0;
    558558
    559559    } else if (projection->type == PS_PROJ_AIT) {
    560         chu1 = (coord->x * M_PI) / 720.0;
     560        chu1 = (coord->x * PS_PI) / 720.0;
    561561        chu1 *= chu1;
    562         chu2 = (coord->y * M_PI) / 360.0;
     562        chu2 = (coord->y * PS_PI) / 360.0;
    563563        chu2 *= chu2;
    564564        chu = PS_SQRT_F32(1.0 - chu1 - chu2);
    565         tmp->d = 2.0 * atan2((2.0 * chu * chu) - 1.0, (coord->x * chu * M_PI) / 360.0);
    566         tmp->r = asin((coord->y * chu * M_PI) / 180.0);
     565        tmp->d = 2.0 * atan2((2.0 * chu * chu) - 1.0, (coord->x * chu * PS_PI) / 360.0);
     566        tmp->r = asin((coord->y * chu * PS_PI) / 180.0);
    567567
    568568    } else if (projection->type == PS_PROJ_PAR) {
     
    640640        // Wrap these to an acceptable range.  This assumes that all
    641641        // angles are in radians.
    642         tmp->r = fmod(tmp->r, 2*M_PI);
    643         tmp->d = fmod(tmp->d, 2*M_PI);
     642        tmp->r = fmod(tmp->r, 2*PS_PI);
     643        tmp->d = fmod(tmp->d, 2*PS_PI);
    644644        tmp->rErr = 0.0;
    645645        tmp->dErr = 0.0;
     
    731731        tmp = (psSphere* ) psAlloc(sizeof(psSphere));
    732732        tmp->r = position->r + tmpR;
    733         tmp->r = fmod(tmp->r, 2.0*M_PI);
     733        tmp->r = fmod(tmp->r, 2.0*PS_PI);
    734734        tmp->d = position->d + tmpD;
    735         tmp->d = fmod(tmp->d, 2.0*M_PI);
     735        tmp->d = fmod(tmp->d, 2.0*PS_PI);
    736736        tmp->rErr = 0.0;
    737737        tmp->dErr = 0.0;
  • trunk/psLib/src/astronomy/psTime.c

    r3114 r3182  
    1010 *  @author Ross Harman, MHPCC
    1111 *
    12  *  @version $Revision: 1.50 $ $Name: not supported by cvs2svn $
    13  *  @date $Date: 2005-02-03 00:45:06 $
     12 *  @version $Revision: 1.51 $ $Name: not supported by cvs2svn $
     13 *  @date $Date: 2005-02-10 02:36:41 $
    1414 *
    1515 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    4343
    4444/** Two times pi with double precision accuracy */
    45 #define TWOPI (2.0*M_PI)
     45#define TWOPI (2.0*PS_PI)
    4646
    4747/** Conversion from radians to degrees */
    48 #define R2DEG = (180.0/M_PI)
     48#define R2DEG = (180.0/PS_PI)
    4949
    5050                /** Maximum length of time string */
     
    548548
    549549        t = 2000.0 + (mjd - 51544.03)/365.2422;
    550         dut2ut1 = 0.022*sin(TWOPI*t) - 0.012*cos(TWOPI*t) - 0.006*sin(4.0*M_PI*t) + 0.007*cos(4.0*M_PI*t);
     550        dut2ut1 = 0.022*sin(TWOPI*t) - 0.012*cos(TWOPI*t) - 0.006*sin(4.0*PS_PI*t) + 0.007*cos(4.0*PS_PI*t);
    551551        result = dut->data.F64[0] + dut->data.F64[1]*(mjd - dut->data.F64[2]) - dut2ut1;
    552552
     
    677677    }
    678678
    679     // Create output sphere and convert arcsec to radians (i.e. x/60/60*M_PI/180)
     679    // Create output sphere and convert arcsec to radians (i.e. x/60/60*PS_PI/180)
    680680    output = psAlloc(sizeof(psSphere));
    681     output->r = x * M_PI / 648000.0;
    682     output->d = y * M_PI / 648000.0;
     681    output->r = x * PS_PI / 648000.0;
     682    output->d = y * PS_PI / 648000.0;
    683683
    684684    return output;
Note: See TracChangeset for help on using the changeset viewer.