Changeset 12050
- Timestamp:
- Feb 25, 2007, 4:33:39 PM (19 years ago)
- Location:
- branches/dvo-mods-2007-02/Ohana/src/relastro
- Files:
-
- 1 added
- 3 edited
-
include/relastro.h (modified) (1 diff)
-
src/FitPM.c (modified) (4 diffs)
-
src/FitPMandPar.c (added)
-
src/UpdateObjects.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/dvo-mods-2007-02/Ohana/src/relastro/include/relastro.h
r12049 r12050 4 4 # include <signal.h> 5 5 6 /* # define GRID_V1 */7 # define GRID_V28 9 # if (0)10 6 typedef struct { 11 double xmin, xmax, ymin, ymax; 12 int style, ptype, ltype, etype, color; 13 double lweight, size; 14 } Graphdata; 15 # endif 7 double Ro, dRo; 8 double Do, dDo; 9 10 double uR, duR; 11 double uD, duD; 12 13 double p, dp; 14 } PMfit; 16 15 17 16 typedef struct { -
branches/dvo-mods-2007-02/Ohana/src/relastro/src/FitPM.c
r12047 r12050 2 2 3 3 /* do we want an init function which does the alloc and a clear function to free? */ 4 5 4 FitPM (double *X, double *dX, double *Y, double *dY, double *T, double *pR, double *pD, int Npts) { 6 5 6 PFfit *fit; 7 7 double **A, **B; 8 8 9 ALLOCATE (A, double *, 5); 10 ALLOCATE (B, double *, 5); 11 for (i = 0; i < 5; i++) { 12 ALLOCATE (A[i], double, 5); 9 /* do I need to do this as 2 2x2 matrix equations? */ 10 ALLOCATE (A, double *, 4); 11 ALLOCATE (B, double *, 4); 12 for (i = 0; i < 4; i++) { 13 ALLOCATE (A[i], double, 4); 13 14 ALLOCATE (B[i], double, 1); 14 bzero (A[i], 5*sizeof(double));15 bzero (A[i], 4*sizeof(double)); 15 16 bzero (B[i], 1*sizeof(double)); 16 17 } … … 30 31 Ty2 += SQ(T[i])*wy; 31 32 32 PR += pR[i]*wx;33 PD += pD[i]*wy;34 35 PRT += pR[i]*T[i]*wx;36 PDT += pD[i]*T[i]*wy;37 38 PRX += pR[i]*X[i]*wx;39 PDY += pD[i]*Y[i]*wy;40 41 PR2 += SQ(pR[i])*wx;42 PD2 += SQ(pD[i])*wy;43 44 33 Xs += X[i]*wx; 45 34 Ys += Y[i]*wy; … … 51 40 A[0][0] = Wx; 52 41 A[0][1] = Tx; 53 A[0][4] = PR;54 42 55 43 A[1][0] = Tx; 56 44 A[1][1] = Tx2; 57 A[1][4] = PRT;58 45 59 46 A[2][2] = Wy; 60 47 A[2][3] = Ty; 61 A[2][4] = PD;62 48 63 49 A[3][2] = Ty; 64 50 A[3][3] = Ty2; 65 A[3][4] = PDT;66 67 A[4][0] = PR;68 A[4][1] = PRT;69 A[4][2] = PD;70 A[4][3] = PDT;71 A[4][4] = PR2 + PD2;72 51 73 52 B[0][0] = Xs; … … 75 54 B[2][0] = Ys; 76 55 B[3][0] = YT; 77 B[4][0] = PRX + PDY;78 56 79 dgaussj (A, 5, B, 1);57 dgaussj (A, 4, B, 1); 80 58 81 Ro = B[0]; 82 uR = B[1]; 83 Do = B[2]; 84 uD = B[3]; 85 p = B[4]; 59 ALLOCATE (fit, PMfit, 1); 60 61 fit[0].Ro = B[0]; 62 fit[0].uR = B[1]; 63 fit[0].Do = B[2]; 64 fit[0].uD = B[3]; 65 fit[0].p = 0.0; 86 66 87 dRo = sqrt(A[0][0]);88 duR = sqrt(A[1][1]);89 dDo = sqrt(A[2][2]);90 duD = sqrt(A[3][3]);91 dp = sqrt(A[4][4]);67 fit[0].dRo = sqrt(A[0][0]); 68 fit[0].duR = sqrt(A[1][1]); 69 fit[0].dDo = sqrt(A[2][2]); 70 fit[0].duD = sqrt(A[3][3]); 71 fit[0].dp = 0.0; 92 72 93 for (i = 0; i < 5; i++) {73 for (i = 0; i < 4; i++) { 94 74 free (A[i]); 95 75 free (B[i]); -
branches/dvo-mods-2007-02/Ohana/src/relastro/src/UpdateObjects.c
r12047 r12050 86 86 } 87 87 88 if (FitProperMotion) { 89 fit = FitPMandPar (listX, dlistX, listY, dlistY, listT, pR, pD, N); 90 } 91 88 92 if (AverageCoords) { 89 93 liststats (listR, dlistR, N, &statsR);
Note:
See TracChangeset
for help on using the changeset viewer.
