Changeset 4937
- Timestamp:
- Aug 31, 2005, 12:28:35 PM (21 years ago)
- Location:
- trunk/psLib/src
- Files:
-
- 6 edited
-
astro/psCoord.h (modified) (3 diffs)
-
astro/psSphereOps.h (modified) (2 diffs)
-
astro/psTime.c (modified) (8 diffs)
-
astro/psTime.h (modified) (3 diffs)
-
math/psFunctions.c (modified) (18 diffs)
-
math/psFunctions.h (modified) (13 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/astro/psCoord.h
r4898 r4937 10 10 * @author GLG, MHPCC 11 11 * 12 * @version $Revision: 1.4 2$ $Name: not supported by cvs2svn $13 * @date $Date: 2005-08-3 0 01:14:10$12 * @version $Revision: 1.43 $ $Name: not supported by cvs2svn $ 13 * @date $Date: 2005-08-31 22:28:35 $ 14 14 * 15 15 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 24 24 #include "psList.h" 25 25 #include "psFunctions.h" 26 #include "psTime.h"26 //#include "psTime.h" 27 27 28 28 /// @addtogroup CoordinateTransform … … 52 52 * 53 53 */ 54 typedef struct psSphere54 typedef struct 55 55 { 56 56 double r; ///< RA -
trunk/psLib/src/astro/psSphereOps.h
r4898 r4937 7 7 * @author Robert DeSonia, MHPCC 8 8 * 9 * @version $Revision: 1. 2$ $Name: not supported by cvs2svn $10 * @date $Date: 2005-08-3 0 01:14:10$9 * @version $Revision: 1.3 $ $Name: not supported by cvs2svn $ 10 * @date $Date: 2005-08-31 22:28:35 $ 11 11 * 12 12 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 19 19 /// @{ 20 20 21 #include "psCoord.h" 21 //#include "psCoord.h" 22 #include "psTime.h" 22 23 23 24 /** Spherical Rotation Definition -
trunk/psLib/src/astro/psTime.c
r4898 r4937 10 10 * @author Ross Harman, MHPCC 11 11 * 12 * @version $Revision: 1.6 7$ $Name: not supported by cvs2svn $13 * @date $Date: 2005-08-3 0 01:14:10$12 * @version $Revision: 1.68 $ $Name: not supported by cvs2svn $ 13 * @date $Date: 2005-08-31 22:28:35 $ 14 14 * 15 15 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 28 28 #include "psAbort.h" 29 29 #include "psImage.h" 30 #include "psCoord.h"31 30 #include "psString.h" 32 31 #include "psMetadata.h" … … 899 898 } 900 899 901 structpsSphere* p_psTimeGetPoleCoords(const psTime* time)900 psSphere* p_psTimeGetPoleCoords(const psTime* time) 902 901 { 903 902 psU32 nTables = 3; … … 908 907 psF64 c = 0.0; 909 908 psF64 mjdPred = 0.0; 910 structpsSphere* output = NULL;909 psSphere* output = NULL; 911 910 psLookupStatusType xStatus = PS_LOOKUP_SUCCESS; 912 911 psLookupStatusType yStatus = PS_LOOKUP_SUCCESS; … … 920 919 PS_ASSERT_INT_WITHIN_RANGE(time->nsec,0,(psU32)((1e9)-1),NULL); 921 920 922 if(time->type != PS_TIME_TAI) 923 { 921 if(time->type != PS_TIME_TAI) { 924 922 psError(PS_ERR_BAD_PARAMETER_VALUE, true, PS_ERRORTEXT_psTime_TYPE_INCORRECT, time->type); 925 923 return NULL; … … 934 932 935 933 // Value could not be found through table lookup and interpolation 936 if(xStatus==PS_LOOKUP_PAST_TOP && yStatus==PS_LOOKUP_PAST_TOP) 937 { 934 if(xStatus==PS_LOOKUP_PAST_TOP && yStatus==PS_LOOKUP_PAST_TOP) { 938 935 939 936 // Date too earlier for tables. Get default polar coodinate values from metadata, and issue warning. … … 954 951 y = tableMetadataItem->data.F64; 955 952 956 } else if(xStatus==PS_LOOKUP_PAST_BOTTOM && yStatus==PS_LOOKUP_PAST_BOTTOM) 957 { 953 } else if(xStatus==PS_LOOKUP_PAST_BOTTOM && yStatus==PS_LOOKUP_PAST_BOTTOM) { 958 954 959 955 /* Date too late for tables. Issue warning and use following formulae for predicting … … 1012 1008 yp->data.F64[4]*sin(c); 1013 1009 1014 } else if(xStatus!=PS_LOOKUP_SUCCESS || yStatus!=PS_LOOKUP_SUCCESS) 1015 { 1010 } else if(xStatus!=PS_LOOKUP_SUCCESS || yStatus!=PS_LOOKUP_SUCCESS) { 1016 1011 psError(PS_ERR_BAD_PARAMETER_VALUE, true, PS_ERRORTEXT_psTime_INTERPOLATION_FAILED); 1017 1012 return NULL; -
trunk/psLib/src/astro/psTime.h
r4920 r4937 11 11 * @author Ross Harman, MHPCC 12 12 * 13 * @version $Revision: 1.3 6$ $Name: not supported by cvs2svn $14 * @date $Date: 2005-08-31 02:07:09$13 * @version $Revision: 1.37 $ $Name: not supported by cvs2svn $ 14 * @date $Date: 2005-08-31 22:28:35 $ 15 15 * 16 16 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 26 26 #include "psType.h" 27 27 #include "psImage.h" 28 #include "psCoord.h" 28 29 29 30 struct psSphere; … … 173 174 * @return psSphere*: Spherical coordinates of Earth's polar axias. 174 175 */ 175 structpsSphere* p_psTimeGetPoleCoords(176 const psTime *time ///< psTime determine polar orientation.177 );176 psSphere* p_psTimeGetPoleCoords( 177 const psTime *time ///< psTime determine polar orientation. 178 ); 178 179 179 180 /** Calculate the number of leapseconds between two times. -
trunk/psLib/src/math/psFunctions.c
r4898 r4937 7 7 * polynomials. It also contains a Gaussian functions. 8 8 * 9 * @version $Revision: 1. 9$ $Name: not supported by cvs2svn $10 * @date $Date: 2005-08-3 0 01:14:13$9 * @version $Revision: 1.10 $ $Name: not supported by cvs2svn $ 10 * @date $Date: 2005-08-31 22:28:35 $ 11 11 * 12 12 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 709 709 This routine must allocate memory for the polynomial structures. 710 710 *****************************************************************************/ 711 psPolynomial1D* psPolynomial1DAlloc( int n,711 psPolynomial1D* psPolynomial1DAlloc(unsigned int n, 712 712 psPolynomialType type) 713 713 { 714 714 PS_ASSERT_INT_POSITIVE(n, NULL); 715 715 716 int i = 0;716 unsigned int i = 0; 717 717 psPolynomial1D* newPoly = NULL; 718 718 … … 734 734 } 735 735 736 psPolynomial2D* psPolynomial2DAlloc( int nX, int nY, 736 psPolynomial2D* psPolynomial2DAlloc( unsigned int nX, 737 unsigned int nY, 737 738 psPolynomialType type) 738 739 { … … 740 741 PS_ASSERT_INT_POSITIVE(nY, NULL); 741 742 742 int x = 0;743 int y = 0;743 unsigned int x = 0; 744 unsigned int y = 0; 744 745 psPolynomial2D* newPoly = NULL; 745 746 … … 770 771 } 771 772 772 psPolynomial3D* psPolynomial3DAlloc( int nX, int nY, int nZ, 773 psPolynomial3D* psPolynomial3DAlloc( unsigned int nX, 774 unsigned int nY, 775 unsigned int nZ, 773 776 psPolynomialType type) 774 777 { … … 777 780 PS_ASSERT_INT_POSITIVE(nZ, NULL); 778 781 779 psS32x = 0;780 psS32y = 0;781 psS32z = 0;782 unsigned int x = 0; 783 unsigned int y = 0; 784 unsigned int z = 0; 782 785 psPolynomial3D* newPoly = NULL; 783 786 … … 816 819 } 817 820 818 psPolynomial4D* psPolynomial4DAlloc( int nX, int nY, int nZ, int nT, 821 psPolynomial4D* psPolynomial4DAlloc( unsigned int nX, 822 unsigned int nY, 823 unsigned int nZ, 824 unsigned int nT, 819 825 psPolynomialType type) 820 826 { … … 824 830 PS_ASSERT_INT_POSITIVE(nT, NULL); 825 831 826 psS32x = 0;827 psS32y = 0;828 psS32z = 0;829 psS32t = 0;832 unsigned int x = 0; 833 unsigned int y = 0; 834 unsigned int z = 0; 835 unsigned int t = 0; 830 836 psPolynomial4D* newPoly = NULL; 831 837 … … 899 905 900 906 901 psF64 psPolynomial1DEval(const psPolynomial1D* poly, psF64 x) 907 psF64 psPolynomial1DEval(const psPolynomial1D* poly, 908 psF64 x) 902 909 { 903 910 PS_ASSERT_POLY_NON_NULL(poly, NAN); … … 932 939 } 933 940 934 psF64 psPolynomial2DEval(const psPolynomial2D* poly, psF64 x, psF64 y) 941 psF64 psPolynomial2DEval(const psPolynomial2D* poly, 942 psF64 x, 943 psF64 y) 935 944 { 936 945 PS_ASSERT_POLY_NON_NULL(poly, NAN); … … 979 988 } 980 989 981 psF64 psPolynomial3DEval(const psPolynomial3D* poly, psF64 x, psF64 y, psF64 z) 990 psF64 psPolynomial3DEval(const psPolynomial3D* poly, 991 psF64 x, 992 psF64 y, 993 psF64 z) 982 994 { 983 995 PS_ASSERT_POLY_NON_NULL(poly, NAN); … … 1035 1047 } 1036 1048 1037 psF64 psPolynomial4DEval(const psPolynomial4D* poly, psF64 x, psF64 y, psF64 z, psF64 t) 1049 psF64 psPolynomial4DEval(const psPolynomial4D* poly, 1050 psF64 x, 1051 psF64 y, 1052 psF64 z, 1053 psF64 t) 1038 1054 { 1039 1055 PS_ASSERT_POLY_NON_NULL(poly, NAN); … … 1114 1130 XXX: What should be the default type for knots be? psF32 is assumed. 1115 1131 *****************************************************************************/ 1116 psSpline1D *psSpline1DAlloc( int numSplines,1117 int order,1132 psSpline1D *psSpline1DAlloc(unsigned int numSplines, 1133 unsigned int order, 1118 1134 float min, 1119 1135 float max) … … 1131 1147 // 1132 1148 tmpSpline->spline = (psPolynomial1D **) psAlloc(numSplines * sizeof(psPolynomial1D *)); 1133 for ( psS32 i=0;i<numSplines;i++) {1149 for (unsigned int i=0; i < numSplines; i++) { 1134 1150 (tmpSpline->spline)[i] = psPolynomial1DAlloc(order+1, PS_POLYNOMIAL_ORD); 1135 1151 } … … 1144 1160 psF32 width = (max - min) / ((psF32) numSplines); 1145 1161 tmpSpline->knots->data.F32[0] = min; 1146 for ( psS32 i=1;i<numSplines;i++) {1162 for (unsigned int i=1; i < numSplines; i++) { 1147 1163 tmpSpline->knots->data.F32[i] = min + (width * (psF32) i); 1148 1164 } … … 1179 1195 *****************************************************************************/ 1180 1196 psSpline1D *psSpline1DAllocGeneric(const psVector *bounds, 1181 int order)1197 unsigned int order) 1182 1198 { 1183 1199 PS_ASSERT_VECTOR_NON_NULL(bounds, NULL); … … 1195 1211 // 1196 1212 tmpSpline->spline = (psPolynomial1D **) psAlloc(numSplines * sizeof(psPolynomial1D *)); 1197 for ( psS32 i=0;i<numSplines;i++) {1213 for (unsigned int i=0; i < numSplines; i++) { 1198 1214 (tmpSpline->spline)[i] = psPolynomial1DAlloc(order+1, PS_POLYNOMIAL_ORD); 1199 1215 } … … 1206 1222 // XXX:Ensure that the knots are monotonic. 1207 1223 // 1208 for ( psS32 i=0;i<bounds->n-1;i++) {1224 for (unsigned int i=0; i < bounds->n-1; i++) { 1209 1225 if (FLT_EPSILON >= fabs(bounds->data.F32[i+1]-bounds->data.F32[i])) { 1210 1226 psError(PS_ERR_UNKNOWN, true, "data points must be distinct ([%d] %f %f)\n", i, bounds->data.F32[i], bounds->data.F32[i+1]); -
trunk/psLib/src/math/psFunctions.h
r4898 r4937 12 12 * @author GLG, MHPCC 13 13 * 14 * @version $Revision: 1. 4$ $Name: not supported by cvs2svn $15 * @date $Date: 2005-08-3 0 01:14:13$14 * @version $Revision: 1.5 $ $Name: not supported by cvs2svn $ 15 * @date $Date: 2005-08-31 22:28:35 $ 16 16 * 17 17 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 74 74 { 75 75 psPolynomialType type; ///< Polynomial type 76 int n;///< Number of terms76 unsigned int n; ///< Number of terms 77 77 psF64 *coeff; ///< Coefficients 78 78 psF64 *coeffErr; ///< Error in coefficients … … 85 85 { 86 86 psPolynomialType type; ///< Polynomial type 87 int nX;///< Number of terms in x88 int nY;///< Number of terms in y87 unsigned int nX; ///< Number of terms in x 88 unsigned int nY; ///< Number of terms in y 89 89 psF64 **coeff; ///< Coefficients 90 90 psF64 **coeffErr; ///< Error in coefficients … … 97 97 { 98 98 psPolynomialType type; ///< Polynomial type 99 int nX;///< Number of terms in x100 int nY;///< Number of terms in y101 int nZ;///< Number of terms in z99 unsigned int nX; ///< Number of terms in x 100 unsigned int nY; ///< Number of terms in y 101 unsigned int nZ; ///< Number of terms in z 102 102 psF64 ***coeff; ///< Coefficients 103 103 psF64 ***coeffErr; ///< Error in coefficients … … 110 110 { 111 111 psPolynomialType type; ///< Polynomial type 112 int nX;///< Number of terms in x113 int nY;///< Number of terms in y114 int nZ;///< Number of terms in z115 int nT;///< Number of terms in t112 unsigned int nX; ///< Number of terms in x 113 unsigned int nY; ///< Number of terms in y 114 unsigned int nZ; ///< Number of terms in z 115 unsigned int nT; ///< Number of terms in t 116 116 psF64 ****coeff; ///< Coefficients 117 117 psF64 ****coeffErr; ///< Error in coefficients … … 126 126 */ 127 127 psPolynomial1D* psPolynomial1DAlloc( 128 int n,///< Number of terms128 unsigned int n, ///< Number of terms 129 129 psPolynomialType type ///< Polynomial Type 130 130 ); … … 135 135 */ 136 136 psPolynomial2D* psPolynomial2DAlloc( 137 int nX, ///< Number of terms in x138 int nY, ///< Number of terms in y137 unsigned int nX, ///< Number of terms in x 138 unsigned int nY, ///< Number of terms in y 139 139 psPolynomialType type ///< Polynomial Type 140 140 ); … … 145 145 */ 146 146 psPolynomial3D* psPolynomial3DAlloc( 147 int nX,///< Number of terms in x148 int nY,///< Number of terms in y149 int nZ,///< Number of terms in z147 unsigned int nX, ///< Number of terms in x 148 unsigned int nY, ///< Number of terms in y 149 unsigned int nZ, ///< Number of terms in z 150 150 psPolynomialType type ///< Polynomial Type 151 151 ); … … 156 156 */ 157 157 psPolynomial4D* psPolynomial4DAlloc( 158 int nX,///< Number of terms in x159 int nY,///< Number of terms in y160 int nZ,///< Number of terms in z161 int nT,///< Number of terms in t158 unsigned int nX, ///< Number of terms in x 159 unsigned int nY, ///< Number of terms in y 160 unsigned int nZ, ///< Number of terms in z 161 unsigned int nT, ///< Number of terms in t 162 162 psPolynomialType type ///< Polynomial Type 163 163 ); … … 212 212 psPtr ptr ///< the pointer whose type to check 213 213 ); 214 215 216 214 217 215 /** Evaluates a 1-D polynomial at specific coordinates. … … 299 297 ); 300 298 301 302 299 /** One-Dimensional Spline */ 303 300 typedef struct 304 301 { 305 int n;///< The number of spline pieces302 unsigned int n; ///< The number of spline pieces 306 303 psPolynomial1D **spline; ///< An array of n pointers to the spline polynomials 307 304 psVector *knots; ///< The boundaries between each spline piece. Size is n+1. … … 319 316 */ 320 317 psSpline1D *psSpline1DAlloc( 321 int n, ///< Number of spline polynomials322 int order, ///< Order of spline polynomials318 unsigned int n, ///< Number of spline polynomials 319 unsigned int order, ///< Order of spline polynomials 323 320 float min, ///< Lower boundary value of spline polynomials 324 321 float max ///< Upper boundary value of spline polynomials … … 333 330 psSpline1D *psSpline1DAllocGeneric( 334 331 const psVector *bounds, ///< Bounds for spline polynomials 335 int order///< Order of spline polynomials332 unsigned int order ///< Order of spline polynomials 336 333 ); 337 334
Note:
See TracChangeset
for help on using the changeset viewer.
