IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 12050


Ignore:
Timestamp:
Feb 25, 2007, 4:33:39 PM (19 years ago)
Author:
eugene
Message:

more pm work

Location:
branches/dvo-mods-2007-02/Ohana/src/relastro
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • branches/dvo-mods-2007-02/Ohana/src/relastro/include/relastro.h

    r12049 r12050  
    44# include <signal.h>
    55
    6 /* # define GRID_V1 */
    7 # define GRID_V2
    8 
    9 # if (0)
    106typedef 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;
    1615
    1716typedef struct {
  • branches/dvo-mods-2007-02/Ohana/src/relastro/src/FitPM.c

    r12047 r12050  
    22
    33/* do we want an init function which does the alloc and a clear function to free? */
    4 
    54FitPM (double *X, double *dX, double *Y, double *dY, double *T, double *pR, double *pD, int Npts) {
    65
     6  PFfit *fit;
    77  double **A, **B;
    88
    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);
    1314    ALLOCATE (B[i], double, 1);
    14     bzero (A[i], 5*sizeof(double));
     15    bzero (A[i], 4*sizeof(double));
    1516    bzero (B[i], 1*sizeof(double));
    1617  }
     
    3031    Ty2 += SQ(T[i])*wy;
    3132   
    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 
    4433    Xs += X[i]*wx;
    4534    Ys += Y[i]*wy;
     
    5140  A[0][0] = Wx;
    5241  A[0][1] = Tx;
    53   A[0][4] = PR;
    5442
    5543  A[1][0] = Tx;
    5644  A[1][1] = Tx2;
    57   A[1][4] = PRT;
    5845
    5946  A[2][2] = Wy;
    6047  A[2][3] = Ty;
    61   A[2][4] = PD;
    6248
    6349  A[3][2] = Ty;
    6450  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;
    7251
    7352  B[0][0] = Xs;
     
    7554  B[2][0] = Ys;
    7655  B[3][0] = YT;
    77   B[4][0] = PRX + PDY;
    7856
    79   dgaussj (A, 5, B, 1);
     57  dgaussj (A, 4, B, 1);
    8058
    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;
    8666 
    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;
    9272 
    93   for (i = 0; i < 5; i++) {
     73  for (i = 0; i < 4; i++) {
    9474    free (A[i]);
    9575    free (B[i]);
  • branches/dvo-mods-2007-02/Ohana/src/relastro/src/UpdateObjects.c

    r12047 r12050  
    8686      }
    8787
     88      if (FitProperMotion) {
     89          fit = FitPMandPar (listX, dlistX, listY, dlistY, listT, pR, pD, N);
     90      }
     91
    8892      if (AverageCoords) {
    8993          liststats (listR, dlistR, N, &statsR);
Note: See TracChangeset for help on using the changeset viewer.