Changeset 3182
- Timestamp:
- Feb 9, 2005, 4:36:42 PM (21 years ago)
- Location:
- trunk/psLib
- Files:
-
- 41 added
- 2 deleted
- 23 edited
-
Makefile.am (modified) (2 diffs)
-
config (added)
-
config/psTime.config.template (added)
-
config/psTime.xml (added)
-
configure.in (modified) (4 diffs)
-
data (added)
-
data/eopc01_1900_2004.dat (added)
-
data/eopc01_1900_2004.raw (added)
-
data/finals_all.dat (added)
-
data/finals_all.raw (added)
-
data/readme.eopc01 (added)
-
data/readme.ser7 (added)
-
data/readme.tai_utc (added)
-
data/ser7.dat (added)
-
data/ser7.raw (added)
-
data/tai_utc.dat (added)
-
data/tai_utc.raw (added)
-
etc (added)
-
etc/pslib (added)
-
etc/pslib/Makefile.am (added)
-
etc/pslib/psTime.config.template (added)
-
etc/pslib/psTime.xml (added)
-
pslib.kdevelop.pcs (modified) ( previous)
-
pslib.kdevses (modified) (1 diff)
-
share (added)
-
share/pslib (added)
-
share/pslib/eopc01_1900_2004.dat (added)
-
share/pslib/eopc01_1900_2004.raw (added)
-
share/pslib/finals_all.dat (added)
-
share/pslib/finals_all.raw (added)
-
share/pslib/readme.eopc01 (added)
-
share/pslib/readme.ser7 (added)
-
share/pslib/readme.tai_utc (added)
-
share/pslib/ser7.dat (added)
-
share/pslib/ser7.raw (added)
-
share/pslib/tai_utc.dat (added)
-
share/pslib/tai_utc.raw (added)
-
src/astro/psCoord.c (modified) (6 diffs)
-
src/astro/psTime.c (modified) (4 diffs)
-
src/astronomy/astronomy.i (modified) (1 diff)
-
src/astronomy/psCoord.c (modified) (6 diffs)
-
src/astronomy/psTime.c (modified) (4 diffs)
-
src/dataManip/Makefile.am (modified) (2 diffs)
-
src/dataManip/psBinaryOp.c (added)
-
src/dataManip/psBinaryOp.h (added)
-
src/dataManip/psConstants.h (modified) (2 diffs)
-
src/dataManip/psFunctions.c (modified) (2 diffs)
-
src/dataManip/psMatrixVectorArithmetic.c (deleted)
-
src/dataManip/psMatrixVectorArithmetic.h (deleted)
-
src/dataManip/psMinimize.c (modified) (4 diffs)
-
src/dataManip/psUnaryOp.c (added)
-
src/dataManip/psUnaryOp.h (added)
-
src/image/psImageStats.c (modified) (3 diffs)
-
src/imageops/psImageStats.c (modified) (3 diffs)
-
src/math/psBinaryOp.c (added)
-
src/math/psBinaryOp.h (added)
-
src/math/psConstants.h (modified) (2 diffs)
-
src/math/psMinimize.c (modified) (4 diffs)
-
src/math/psPolynomial.c (modified) (2 diffs)
-
src/math/psSpline.c (modified) (2 diffs)
-
src/math/psUnaryOp.c (added)
-
src/math/psUnaryOp.h (added)
-
src/psTest.c (modified) (1 diff)
-
src/pslib.h (modified) (2 diffs)
-
src/sys/psTrace.c (modified) (6 diffs)
-
src/sysUtils/psTrace.c (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/Makefile.am
r3153 r3182 1 SUBDIRS = src configtest swig1 SUBDIRS = etc src test swig 2 2 3 3 bin_SCRIPTS = pslib-config … … 10 10 docs: 11 11 $(DOXYGEN) 12 13 install-data-hook: 14 $(INSTALL) share/* $(datadir) -
trunk/psLib/configure.in
r3153 r3182 6 6 AC_SUBST(PSLIB_LT_VERSION,$PSLIB_LT_VERSION) 7 7 8 dnl Setup CFLAGS with project-particulars 9 CFLAGS="${CFLAGS=} -Wall -Werror -std=c99 -D_GNU_SOURCE" 10 8 11 AC_DISABLE_STATIC 9 12 AC_PROG_MAKE_SET 13 14 dnl handle debug building 15 AC_ARG_ENABLE(debug, 16 [AC_HELP_STRING([--enable-debug],[Enable debug information in compilation])], 17 [AC_MSG_RESULT(debug information enabled) 18 AC_DEFINE(DEBUG) 19 CFLAGS="${CFLAGS=} -O0 -g2"], 20 [AC_MSG_RESULT(debug information disabled)] 21 ) 10 22 11 23 AC_LANG(C) … … 16 28 AC_PROG_INSTALL 17 29 AC_PROG_LIBTOOL 30 AC_CHECK_FUNC(strtoll) 31 AC_CHECK_FUNC(strtoull) 18 32 19 33 AC_PREFIX_DEFAULT([`pwd`]) 20 34 test "$prefix" = NONE && prefix=`pwd` 21 35 22 dnl Setup CFLAGS/FFLAGS/LDFLAGS with project-particulars23 CFLAGS="${CFLAGS=} -Wall -std=c99 -D_GNU_SOURCE"24 36 25 37 dnl Setup the info for psLib for pkg-config … … 112 124 AC_SUBST(PERL_PREFIX,$PERL_PREFIX) 113 125 114 dnl ---------------- config dir options ------------------ 115 AC_ARG_WITH(configdir, 116 [AS_HELP_STRING([--with-configdir=DIR],[Specify location of psLib's config directory. [default=PREFIX/config]])], 117 [CONFIG_FILE="$withval/psTime.config" 118 XML_CONFIG_FILE="$withval/psTime.xml"], 119 [CONFIG_FILE="${prefix}/config/psTime.config" 120 XML_CONFIG_FILE="${prefix}/config/psTime.xml"]) 121 AC_DEFINE_UNQUOTED(CONFIG_FILE, "$CONFIG_FILE", [Location of the psTime.config file]) 122 AC_DEFINE_UNQUOTED(XML_CONFIG_FILE, "$XML_CONFIG_FILE", [Location of the psTime.xml file]) 123 124 dnl ----------------- data dir options ------------------- 125 AC_ARG_WITH(datadir, 126 [AS_HELP_STRING([--with-datadir=DIR],[Specify location of psLib's data directory. [default=PREFIX/data]])], 127 [UTC_DAT_FILE="$withval/tai_utc.dat"], 128 [UTC_DAT_FILE="${prefix}/data/tai_utc.dat"]) 129 AC_DEFINE_UNQUOTED(UTC_DAT_FILE, "$UTC_DAT_FILE", [Location of the tai_utc.dat file]) 126 dnl --------- set config/data file location -------------- 127 AC_DEFINE_UNQUOTED(CONFIG_FILE, "$sysconfdir/psTime.config", [Location of the psTime.config file]) 128 AC_DEFINE_UNQUOTED(XML_CONFIG_FILE, "$sysconfdir/psTime.xml", [Location of the psTime.xml file]) 129 AC_DEFINE_UNQUOTED(UTC_DAT_FILE, "$datadir/tai_utc.dat", [Location of the tai_utc.dat file]) 130 130 131 131 dnl for MacOSX, where sqrtf is in mx … … 158 158 AC_CONFIG_FILES([ test/image/Makefile ]) 159 159 AC_CONFIG_FILES([ test/sysUtils/Makefile ]) 160 AC_CONFIG_FILES([ config/Makefile ])160 AC_CONFIG_FILES([ etc/pslib/Makefile ]) 161 161 AC_CONFIG_FILES([ pslib-config ]) 162 162 AC_CONFIG_FILES([ pslib.pc ]) -
trunk/psLib/pslib.kdevses
r3115 r3182 1 <?xml version ="1.0" encoding="UTF-8"?>1 <?xml version = '1.0' encoding = 'UTF-8'?> 2 2 <!DOCTYPE KDevPrjSession> 3 3 <KDevPrjSession> 4 4 <DocsAndViews NumberOfDocuments="1" > 5 <Doc0 NumberOfViews="1" URL="file:/home/desonia/p slib/src/pslib.c" >6 <View0 line=" 0" Type="Source" />5 <Doc0 NumberOfViews="1" URL="file:/home/desonia/panstarrs/psLib/configure.in" > 6 <View0 line="15" Type="Source" /> 7 7 </Doc0> 8 8 </DocsAndViews> -
trunk/psLib/src/astro/psCoord.c
r3114 r3182 10 10 * @author GLG, MHPCC 11 11 * 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 $ 14 14 * 15 15 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 267 267 { 268 268 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; 274 274 } 275 275 return(angle); … … 547 547 R = PS_SQRT_F32((coord->x * coord->x) + (coord->y * coord->y)); 548 548 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); 550 550 551 551 } else if (projection->type == PS_PROJ_CAR) { … … 555 555 } else if (projection->type == PS_PROJ_MER) { 556 556 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; 558 558 559 559 } else if (projection->type == PS_PROJ_AIT) { 560 chu1 = (coord->x * M_PI) / 720.0;560 chu1 = (coord->x * PS_PI) / 720.0; 561 561 chu1 *= chu1; 562 chu2 = (coord->y * M_PI) / 360.0;562 chu2 = (coord->y * PS_PI) / 360.0; 563 563 chu2 *= chu2; 564 564 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); 567 567 568 568 } else if (projection->type == PS_PROJ_PAR) { … … 640 640 // Wrap these to an acceptable range. This assumes that all 641 641 // 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); 644 644 tmp->rErr = 0.0; 645 645 tmp->dErr = 0.0; … … 731 731 tmp = (psSphere* ) psAlloc(sizeof(psSphere)); 732 732 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); 734 734 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); 736 736 tmp->rErr = 0.0; 737 737 tmp->dErr = 0.0; -
trunk/psLib/src/astro/psTime.c
r3114 r3182 10 10 * @author Ross Harman, MHPCC 11 11 * 12 * @version $Revision: 1.5 0$ $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 $ 14 14 * 15 15 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 43 43 44 44 /** Two times pi with double precision accuracy */ 45 #define TWOPI (2.0* M_PI)45 #define TWOPI (2.0*PS_PI) 46 46 47 47 /** Conversion from radians to degrees */ 48 #define R2DEG = (180.0/ M_PI)48 #define R2DEG = (180.0/PS_PI) 49 49 50 50 /** Maximum length of time string */ … … 548 548 549 549 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); 551 551 result = dut->data.F64[0] + dut->data.F64[1]*(mjd - dut->data.F64[2]) - dut2ut1; 552 552 … … 677 677 } 678 678 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) 680 680 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; 683 683 684 684 return output; -
trunk/psLib/src/astronomy/astronomy.i
r3169 r3182 17 17 // add a method to add primitives to metadata 18 18 %inline %{ 19 psBool psMetadataAddStr(psMetadata* md, psS32 where, const char* name, const char* comment, const char* value) { 19 psBool psMetadataAddStr(psMetadata* md, psS32 where, const char* name, 20 const char* comment, const char* value) { 20 21 return psMetadataAdd(md,where,name,PS_TYPE_PTR, PS_META_STR,comment,value); 21 22 } 22 psBool psMetadataAddF32(psMetadata* md, psS32 where, const char* name, const char* comment, psF32 value) { 23 psBool psMetadataAddF32(psMetadata* md, 24 psS32 where, 25 const char* name, 26 const char* comment, 27 psF32 value) 28 { 23 29 return psMetadataAdd(md,where,name,PS_TYPE_F32, PS_META_PRIMITIVE,comment,value); 24 30 } 25 psBool psMetadataAddF64(psMetadata* md, psS32 where, const char* name, const char* comment, psF64 value) { 31 32 psBool psMetadataAddF64(psMetadata* md, 33 psS32 where, 34 const char* name, 35 const char* comment, 36 psF64 value) 37 { 26 38 return psMetadataAdd(md,where,name,PS_TYPE_F64, PS_META_PRIMITIVE,comment,value); 27 39 } 28 psBool psMetadataAddS32(psMetadata* md, psS32 where, const char* name, const char* comment, psS32 value) { 40 41 psBool psMetadataAddS32(psMetadata* md, 42 psS32 where, 43 const char* name, 44 const char* comment, 45 psS32 value) 46 { 29 47 return psMetadataAdd(md,where,name,PS_TYPE_S32, PS_META_PRIMITIVE,comment,value); 30 48 } 31 49 32 psMetadataItem* psMetadataItemAllocStr(const char* name, const char* comment, const char* value) { 50 psMetadataItem* psMetadataItemAllocStr(const char* name, 51 const char* comment, 52 const char* value) 53 { 33 54 return psMetadataItemAlloc(name, PS_TYPE_PTR, PS_META_STR, comment, value); 34 55 } 35 psMetadataItem* psMetadataItemAllocF32(const char* name, const char* comment, psF32 value) { 56 57 psMetadataItem* psMetadataItemAllocF32(const char* name, 58 const char* comment, 59 psF32 value) 60 { 36 61 return psMetadataItemAlloc(name, PS_TYPE_F32, PS_META_PRIMITIVE, comment, value); 37 62 } 38 psMetadataItem* psMetadataItemAllocF64(const char* name, const char* comment, psF64 value) { 63 64 psMetadataItem* psMetadataItemAllocF64(const char* name, 65 const char* comment, 66 psF64 value) 67 { 39 68 return psMetadataItemAlloc(name, PS_TYPE_F64, PS_META_PRIMITIVE, comment, value); 40 69 } 41 psMetadataItem* psMetadataItemAllocS32(const char* name, const char* comment, psS32 value) { 70 71 psMetadataItem* psMetadataItemAllocS32(const char* name, 72 const char* comment, 73 psS32 value) 74 { 42 75 return psMetadataItemAlloc(name, PS_TYPE_S32, PS_META_PRIMITIVE, comment, value); 43 76 } -
trunk/psLib/src/astronomy/psCoord.c
r3114 r3182 10 10 * @author GLG, MHPCC 11 11 * 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 $ 14 14 * 15 15 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 267 267 { 268 268 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; 274 274 } 275 275 return(angle); … … 547 547 R = PS_SQRT_F32((coord->x * coord->x) + (coord->y * coord->y)); 548 548 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); 550 550 551 551 } else if (projection->type == PS_PROJ_CAR) { … … 555 555 } else if (projection->type == PS_PROJ_MER) { 556 556 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; 558 558 559 559 } else if (projection->type == PS_PROJ_AIT) { 560 chu1 = (coord->x * M_PI) / 720.0;560 chu1 = (coord->x * PS_PI) / 720.0; 561 561 chu1 *= chu1; 562 chu2 = (coord->y * M_PI) / 360.0;562 chu2 = (coord->y * PS_PI) / 360.0; 563 563 chu2 *= chu2; 564 564 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); 567 567 568 568 } else if (projection->type == PS_PROJ_PAR) { … … 640 640 // Wrap these to an acceptable range. This assumes that all 641 641 // 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); 644 644 tmp->rErr = 0.0; 645 645 tmp->dErr = 0.0; … … 731 731 tmp = (psSphere* ) psAlloc(sizeof(psSphere)); 732 732 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); 734 734 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); 736 736 tmp->rErr = 0.0; 737 737 tmp->dErr = 0.0; -
trunk/psLib/src/astronomy/psTime.c
r3114 r3182 10 10 * @author Ross Harman, MHPCC 11 11 * 12 * @version $Revision: 1.5 0$ $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 $ 14 14 * 15 15 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 43 43 44 44 /** Two times pi with double precision accuracy */ 45 #define TWOPI (2.0* M_PI)45 #define TWOPI (2.0*PS_PI) 46 46 47 47 /** Conversion from radians to degrees */ 48 #define R2DEG = (180.0/ M_PI)48 #define R2DEG = (180.0/PS_PI) 49 49 50 50 /** Maximum length of time string */ … … 548 548 549 549 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); 551 551 result = dut->data.F64[0] + dut->data.F64[1]*(mjd - dut->data.F64[2]) - dut2ut1; 552 552 … … 677 677 } 678 678 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) 680 680 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; 683 683 684 684 return output; -
trunk/psLib/src/dataManip/Makefile.am
r3131 r3182 11 11 noinst_LTLIBRARIES = libpslibdataManip.la 12 12 13 libpslibdataManip_la_SOURCES = \ 14 psMatrixVectorArithmetic.c \ 15 psStats.c \ 16 psFunctions.c \ 17 psMatrix.c \ 18 psVectorFFT.c \ 19 psMinimize.c \ 20 psRandom.c 13 libpslibdataManip_la_SOURCES = psUnaryOp.c psBinaryOp.c psStats.c \ 14 psFunctions.c psMatrix.c psVectorFFT.c psMinimize.c psRandom.c 21 15 22 16 BUILT_SOURCES = psDataManipErrors.h … … 32 26 psFunctions.h \ 33 27 psMatrix.h \ 34 psMatrixVectorArithmetic.h \ 28 psBinaryOp.h \ 29 psUnaryOp.h \ 35 30 psVectorFFT.h \ 36 31 psMinimize.h \ -
trunk/psLib/src/dataManip/psConstants.h
r2941 r3182 6 6 * @author GLG, MHPCC 7 7 * 8 * @version $Revision: 1.5 3$ $Name: not supported by cvs2svn $9 * @date $Date: 2005-0 1-10 19:47:11 $8 * @version $Revision: 1.54 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2005-02-10 02:36:41 $ 10 10 * 11 11 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 37 37 38 38 #define PS_COT(X) (1.0 / atan(X)) 39 #define DEG_TO_RAD(DEGREES) ((DEGREES) * M_PI / 180.0)40 #define MIN_TO_RAD(MINUTES) ((MINUTES) * M_PI / (180.0 * 60.0))41 #define SEC_TO_RAD(SECONDS) ((SECONDS) * M_PI / (180.0 * 60.0 * 60.0))42 #define RAD_TO_DEG(RADIANS) ((RADIANS) * 180.0 / M_PI)43 #define RAD_TO_MIN(RADIANS) ((RADIANS) * 180.0 * 60.0 / M_PI)44 #define RAD_TO_SEC(RADIANS) ((RADIANS) * 180.0 * 60.0 * 60.0 / M_PI)39 #define DEG_TO_RAD(DEGREES) ((DEGREES) * PS_PI / 180.0) 40 #define MIN_TO_RAD(MINUTES) ((MINUTES) * PS_PI / (180.0 * 60.0)) 41 #define SEC_TO_RAD(SECONDS) ((SECONDS) * PS_PI / (180.0 * 60.0 * 60.0)) 42 #define RAD_TO_DEG(RADIANS) ((RADIANS) * 180.0 / PS_PI) 43 #define RAD_TO_MIN(RADIANS) ((RADIANS) * 180.0 * 60.0 / PS_PI) 44 #define RAD_TO_SEC(RADIANS) ((RADIANS) * 180.0 * 60.0 * 60.0 / PS_PI) 45 45 46 46 /***************************************************************************** -
trunk/psLib/src/dataManip/psFunctions.c
r3171 r3182 7 7 * polynomials. It also contains a Gaussian functions. 8 8 * 9 * @version $Revision: 1.8 7$ $Name: not supported by cvs2svn $10 * @date $Date: 2005-02- 09 20:56:17$9 * @version $Revision: 1.88 $ $Name: not supported by cvs2svn $ 10 * @date $Date: 2005-02-10 02:36:41 $ 11 11 * 12 12 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 975 975 976 976 if (normal == true) { 977 tmp = 1.0 / PS_SQRT_F32(2.0 * M_PI * (sigma * sigma));977 tmp = 1.0 / PS_SQRT_F32(2.0 * PS_PI * (sigma * sigma)); 978 978 } 979 979 -
trunk/psLib/src/dataManip/psMinimize.c
r3115 r3182 9 9 * @author GLG, MHPCC 10 10 * 11 * @version $Revision: 1.10 4$ $Name: not supported by cvs2svn $12 * @date $Date: 2005-02- 03 00:54:10$11 * @version $Revision: 1.105 $ $Name: not supported by cvs2svn $ 12 * @date $Date: 2005-02-10 02:36:41 $ 13 13 * 14 14 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 538 538 psF64 flux = normalization * exp(-( u*u/(2.0 * sigmaX * sigmaX) + 539 539 v*v/(2.0 * sigmaY * sigmaY)))/ 540 (2.0 * M_PI * sigmaX * sigmaY);540 (2.0 * PS_PI * sigmaX * sigmaY); 541 541 out->data.F32[i] = flux; 542 542 … … 865 865 for (psS32 i=0;i<n;i++) { 866 866 // NR 5.8.4 867 psF64 Y = cos( M_PI * (0.5 + ((psF32) i)) / ((psF32) n));867 psF64 Y = cos(PS_PI * (0.5 + ((psF32) i)) / ((psF32) n)); 868 868 psF64 X = (Y + bma + bpa) - 1.0; 869 869 tmpScalar.data.F64 = X; … … 893 893 for (k=0;k<n;k++) { 894 894 sum+= f->data.F64[k] * 895 cos( M_PI * ((psF32) j) * (0.5 + ((psF32) k)) / ((psF32) n));895 cos(PS_PI * ((psF32) j) * (0.5 + ((psF32) k)) / ((psF32) n)); 896 896 } 897 897 -
trunk/psLib/src/image/psImageStats.c
r3115 r3182 9 9 * @author GLG, MHPCC 10 10 * 11 * @version $Revision: 1.6 4$ $Name: not supported by cvs2svn $12 * @date $Date: 2005-02- 03 00:54:11$11 * @version $Revision: 1.65 $ $Name: not supported by cvs2svn $ 12 * @date $Date: 2005-02-10 02:36:42 $ 13 13 * 14 14 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 139 139 for (i = 0; i < n; i++) { 140 140 tmp = (double)(n - i); 141 tmp = ( M_PI * (tmp - 0.5)) / ((double)n);141 tmp = (PS_PI * (tmp - 0.5)) / ((double)n); 142 142 scalingFactors[i] = cos(tmp); 143 143 } … … 348 348 // Chebyshev polynomials are 0. 349 349 for (x = 0; x < input->numRows; x++) { 350 double xTmp = cos( M_PI * (0.5 + ((float) x)) / ((float) input->numRows));350 double xTmp = cos(PS_PI * (0.5 + ((float) x)) / ((float) input->numRows)); 351 351 double xNode = - ((xTmp + bma + bpa) - 1.0); 352 352 double xOrig = ((float) input->numRows) * (xNode - min) / (max - min); 353 353 354 354 for (y = 0; y < input->numCols; y++) { 355 double yTmp = cos( M_PI * (0.5 + ((float) y)) / ((float) input->numCols));355 double yTmp = cos(PS_PI * (0.5 + ((float) y)) / ((float) input->numCols)); 356 356 double yNode = - ((yTmp + bma + bpa) - 1.0); 357 357 double yOrig = ((float) input->numCols) * (yNode - min) / (max - min); -
trunk/psLib/src/imageops/psImageStats.c
r3115 r3182 9 9 * @author GLG, MHPCC 10 10 * 11 * @version $Revision: 1.6 4$ $Name: not supported by cvs2svn $12 * @date $Date: 2005-02- 03 00:54:11$11 * @version $Revision: 1.65 $ $Name: not supported by cvs2svn $ 12 * @date $Date: 2005-02-10 02:36:42 $ 13 13 * 14 14 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 139 139 for (i = 0; i < n; i++) { 140 140 tmp = (double)(n - i); 141 tmp = ( M_PI * (tmp - 0.5)) / ((double)n);141 tmp = (PS_PI * (tmp - 0.5)) / ((double)n); 142 142 scalingFactors[i] = cos(tmp); 143 143 } … … 348 348 // Chebyshev polynomials are 0. 349 349 for (x = 0; x < input->numRows; x++) { 350 double xTmp = cos( M_PI * (0.5 + ((float) x)) / ((float) input->numRows));350 double xTmp = cos(PS_PI * (0.5 + ((float) x)) / ((float) input->numRows)); 351 351 double xNode = - ((xTmp + bma + bpa) - 1.0); 352 352 double xOrig = ((float) input->numRows) * (xNode - min) / (max - min); 353 353 354 354 for (y = 0; y < input->numCols; y++) { 355 double yTmp = cos( M_PI * (0.5 + ((float) y)) / ((float) input->numCols));355 double yTmp = cos(PS_PI * (0.5 + ((float) y)) / ((float) input->numCols)); 356 356 double yNode = - ((yTmp + bma + bpa) - 1.0); 357 357 double yOrig = ((float) input->numCols) * (yNode - min) / (max - min); -
trunk/psLib/src/math/psConstants.h
r2941 r3182 6 6 * @author GLG, MHPCC 7 7 * 8 * @version $Revision: 1.5 3$ $Name: not supported by cvs2svn $9 * @date $Date: 2005-0 1-10 19:47:11 $8 * @version $Revision: 1.54 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2005-02-10 02:36:41 $ 10 10 * 11 11 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 37 37 38 38 #define PS_COT(X) (1.0 / atan(X)) 39 #define DEG_TO_RAD(DEGREES) ((DEGREES) * M_PI / 180.0)40 #define MIN_TO_RAD(MINUTES) ((MINUTES) * M_PI / (180.0 * 60.0))41 #define SEC_TO_RAD(SECONDS) ((SECONDS) * M_PI / (180.0 * 60.0 * 60.0))42 #define RAD_TO_DEG(RADIANS) ((RADIANS) * 180.0 / M_PI)43 #define RAD_TO_MIN(RADIANS) ((RADIANS) * 180.0 * 60.0 / M_PI)44 #define RAD_TO_SEC(RADIANS) ((RADIANS) * 180.0 * 60.0 * 60.0 / M_PI)39 #define DEG_TO_RAD(DEGREES) ((DEGREES) * PS_PI / 180.0) 40 #define MIN_TO_RAD(MINUTES) ((MINUTES) * PS_PI / (180.0 * 60.0)) 41 #define SEC_TO_RAD(SECONDS) ((SECONDS) * PS_PI / (180.0 * 60.0 * 60.0)) 42 #define RAD_TO_DEG(RADIANS) ((RADIANS) * 180.0 / PS_PI) 43 #define RAD_TO_MIN(RADIANS) ((RADIANS) * 180.0 * 60.0 / PS_PI) 44 #define RAD_TO_SEC(RADIANS) ((RADIANS) * 180.0 * 60.0 * 60.0 / PS_PI) 45 45 46 46 /***************************************************************************** -
trunk/psLib/src/math/psMinimize.c
r3115 r3182 9 9 * @author GLG, MHPCC 10 10 * 11 * @version $Revision: 1.10 4$ $Name: not supported by cvs2svn $12 * @date $Date: 2005-02- 03 00:54:10$11 * @version $Revision: 1.105 $ $Name: not supported by cvs2svn $ 12 * @date $Date: 2005-02-10 02:36:41 $ 13 13 * 14 14 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 538 538 psF64 flux = normalization * exp(-( u*u/(2.0 * sigmaX * sigmaX) + 539 539 v*v/(2.0 * sigmaY * sigmaY)))/ 540 (2.0 * M_PI * sigmaX * sigmaY);540 (2.0 * PS_PI * sigmaX * sigmaY); 541 541 out->data.F32[i] = flux; 542 542 … … 865 865 for (psS32 i=0;i<n;i++) { 866 866 // NR 5.8.4 867 psF64 Y = cos( M_PI * (0.5 + ((psF32) i)) / ((psF32) n));867 psF64 Y = cos(PS_PI * (0.5 + ((psF32) i)) / ((psF32) n)); 868 868 psF64 X = (Y + bma + bpa) - 1.0; 869 869 tmpScalar.data.F64 = X; … … 893 893 for (k=0;k<n;k++) { 894 894 sum+= f->data.F64[k] * 895 cos( M_PI * ((psF32) j) * (0.5 + ((psF32) k)) / ((psF32) n));895 cos(PS_PI * ((psF32) j) * (0.5 + ((psF32) k)) / ((psF32) n)); 896 896 } 897 897 -
trunk/psLib/src/math/psPolynomial.c
r3171 r3182 7 7 * polynomials. It also contains a Gaussian functions. 8 8 * 9 * @version $Revision: 1.8 7$ $Name: not supported by cvs2svn $10 * @date $Date: 2005-02- 09 20:56:17$9 * @version $Revision: 1.88 $ $Name: not supported by cvs2svn $ 10 * @date $Date: 2005-02-10 02:36:41 $ 11 11 * 12 12 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 975 975 976 976 if (normal == true) { 977 tmp = 1.0 / PS_SQRT_F32(2.0 * M_PI * (sigma * sigma));977 tmp = 1.0 / PS_SQRT_F32(2.0 * PS_PI * (sigma * sigma)); 978 978 } 979 979 -
trunk/psLib/src/math/psSpline.c
r3171 r3182 7 7 * polynomials. It also contains a Gaussian functions. 8 8 * 9 * @version $Revision: 1.8 7$ $Name: not supported by cvs2svn $10 * @date $Date: 2005-02- 09 20:56:17$9 * @version $Revision: 1.88 $ $Name: not supported by cvs2svn $ 10 * @date $Date: 2005-02-10 02:36:41 $ 11 11 * 12 12 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 975 975 976 976 if (normal == true) { 977 tmp = 1.0 / PS_SQRT_F32(2.0 * M_PI * (sigma * sigma));977 tmp = 1.0 / PS_SQRT_F32(2.0 * PS_PI * (sigma * sigma)); 978 978 } 979 979 -
trunk/psLib/src/psTest.c
r3127 r3182 11 11 // 12 12 13 13 #include <sys/types.h> 14 #include <unistd.h> 14 15 #include <stdlib.h> 15 #include <unistd.h>16 16 #include <sys/wait.h> 17 17 #include <stdbool.h> -
trunk/psLib/src/pslib.h
r3115 r3182 9 9 * @author Eric Van Alst, MHPCC 10 10 * 11 * @version $Revision: 1.3 0$ $Name: not supported by cvs2svn $12 * @date $Date: 2005-02- 03 00:54:10$11 * @version $Revision: 1.31 $ $Name: not supported by cvs2svn $ 12 * @date $Date: 2005-02-10 02:36:41 $ 13 13 * 14 14 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 126 126 #include "psMatrix.h" 127 127 128 /// @defgroup Matrix VectorArithmetic Matrix VectorArithmetic Operations128 /// @defgroup MatrixArithmetic Matrix Arithmetic Operations 129 129 /// @ingroup DataManip 130 #include "psMatrixVectorArithmetic.h" 130 #include "psBinaryOp.h" 131 #include "psUnaryOp.h" 131 132 132 133 #include "psRandom.h" -
trunk/psLib/src/sys/psTrace.c
r3115 r3182 9 9 * @author GLG, MHPCC 10 10 * 11 * @version $Revision: 1.4 1$ $Name: not supported by cvs2svn $12 * @date $Date: 2005-02- 03 00:54:11$11 * @version $Revision: 1.42 $ $Name: not supported by cvs2svn $ 12 * @date $Date: 2005-02-10 02:36:42 $ 13 13 * 14 14 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 40 40 #ifndef PS_NO_TRACE 41 41 42 #include <unistd.h> 42 43 #include <stdlib.h> 43 44 #include <stdio.h> … … 146 147 /***************************************************************************** 147 148 componentAdd(): Adds the component named "addNodeName" to the root tree. 148 149 NOTE: replace the call to strsep() with a call to strtok(), which conforms150 to ANSI-C.151 149 *****************************************************************************/ 152 150 static psBool componentAdd(const char *addNodeName, psS32 level) … … 180 178 181 179 strcpy(name, addNodeName); 182 pname = &name[1];180 pname = name+1; 183 181 // Iterate through the components of addNodeName. Strip off the first 184 182 // component of the name, find that in the root tree, or add it if it … … 186 184 187 185 while (pname != NULL) { 188 firstComponent = strsep(&pname, "."); 186 firstComponent = pname; 187 pname = strtok(pname, "."); 188 if (pname != NULL) { 189 *pname = '\0'; 190 pname++; 191 } 189 192 nodeExists = 0; 190 193 for (i = 0; i < currentNode->n; i++) { … … 324 327 pname = &name[1]; 325 328 while (pname != NULL) { 326 firstComponent = strsep(&pname, "."); 329 firstComponent = pname; 330 pname = strtok(pname, "."); 331 if (pname != NULL) { 332 *pname = '\0'; 333 pname++; 334 } 327 335 for (i = 0; i < currentNode->n; i++) { 328 336 if (NULL == currentNode->subcomp[i]) { -
trunk/psLib/src/sysUtils/psTrace.c
r3115 r3182 9 9 * @author GLG, MHPCC 10 10 * 11 * @version $Revision: 1.4 1$ $Name: not supported by cvs2svn $12 * @date $Date: 2005-02- 03 00:54:11$11 * @version $Revision: 1.42 $ $Name: not supported by cvs2svn $ 12 * @date $Date: 2005-02-10 02:36:42 $ 13 13 * 14 14 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 40 40 #ifndef PS_NO_TRACE 41 41 42 #include <unistd.h> 42 43 #include <stdlib.h> 43 44 #include <stdio.h> … … 146 147 /***************************************************************************** 147 148 componentAdd(): Adds the component named "addNodeName" to the root tree. 148 149 NOTE: replace the call to strsep() with a call to strtok(), which conforms150 to ANSI-C.151 149 *****************************************************************************/ 152 150 static psBool componentAdd(const char *addNodeName, psS32 level) … … 180 178 181 179 strcpy(name, addNodeName); 182 pname = &name[1];180 pname = name+1; 183 181 // Iterate through the components of addNodeName. Strip off the first 184 182 // component of the name, find that in the root tree, or add it if it … … 186 184 187 185 while (pname != NULL) { 188 firstComponent = strsep(&pname, "."); 186 firstComponent = pname; 187 pname = strtok(pname, "."); 188 if (pname != NULL) { 189 *pname = '\0'; 190 pname++; 191 } 189 192 nodeExists = 0; 190 193 for (i = 0; i < currentNode->n; i++) { … … 324 327 pname = &name[1]; 325 328 while (pname != NULL) { 326 firstComponent = strsep(&pname, "."); 329 firstComponent = pname; 330 pname = strtok(pname, "."); 331 if (pname != NULL) { 332 *pname = '\0'; 333 pname++; 334 } 327 335 for (i = 0; i < currentNode->n; i++) { 328 336 if (NULL == currentNode->subcomp[i]) {
Note:
See TracChangeset
for help on using the changeset viewer.
