IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jan 6, 2017, 11:30:10 AM (10 years ago)
Author:
eugene
Message:

merging changes from czw dev branch (compare with r39924)

Location:
trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/Ohana

  • trunk/Ohana/src/opihi/cmd.astro/csystem.c

    r39591 r39926  
    125125  opihi_flt *yptr = yvec[0].elements.Flt;
    126126
    127   opihi_flt *uxptr = uxvec ? xvec[0].elements.Flt : NULL;
    128   opihi_flt *uyptr = uyvec ? yvec[0].elements.Flt : NULL;
     127  opihi_flt *uxptr = uxvec ? uxvec[0].elements.Flt : NULL;
     128  opihi_flt *uyptr = uyvec ? uyvec[0].elements.Flt : NULL;
    129129
    130130  for (i = 0; i < xvec[0].Nelements; i++, xptr++, yptr++) {
  • trunk/Ohana/src/opihi/cmd.astro/fitplx_irls.c

    r39610 r39926  
    158158    // now that the mask has been updated, we need to recalculate mean epoch and positions
    159159    // XXX make this conditional on actually masking unmasked points above
    160     PlxSetMeanEpoch (R, D, T, &Rmean, &Dmean, &Tmean, mask, Ntotal);
    161     PlxSetEpochPosition (&fitdata, R, D, dR, dD, T, mask, Ntotal, &coords, Tmean);
     160    // PlxSetMeanEpoch (R, D, T, &Rmean, &Dmean, &Tmean, mask, Ntotal);
     161    // PlxSetEpochPosition (&fitdata, R, D, dR, dD, T, mask, Ntotal, &coords, Tmean);
    162162
    163163    PlxFitData sample;
     
    218218  // fprintf (stderr, "%f +/- %f | %f %f\n", fit.p, fit.dp, fit.uR, fit.uD);
    219219
    220 /*
    221   FILE *f = fopen ("test.pf.dat", "w");
     220  Vector *dRresPMP, *dDresPMP, *dRresPLX, *dDresPLX;
     221
     222  // save fit residuals (with only pm removed, and pm and plx removed)
     223  if ((dRresPMP = SelectVector ("dRresPMP", ANYVECTOR, TRUE)) == NULL) ESCAPE ("cannot generate vector %s\n", "dRresPMP");
     224  if ((dDresPMP = SelectVector ("dDresPMP", ANYVECTOR, TRUE)) == NULL) ESCAPE ("cannot generate vector %s\n", "dDresPMP");
     225  if ((dRresPLX = SelectVector ("dRresPLX", ANYVECTOR, TRUE)) == NULL) ESCAPE ("cannot generate vector %s\n", "dRresPLX");
     226  if ((dDresPLX = SelectVector ("dDresPLX", ANYVECTOR, TRUE)) == NULL) ESCAPE ("cannot generate vector %s\n", "dDresPLX");
     227   
     228  ResetVector (dRresPMP, OPIHI_FLT, Ntotal);
     229  ResetVector (dDresPMP, OPIHI_FLT, Ntotal);
     230  ResetVector (dRresPLX, OPIHI_FLT, Ntotal);
     231  ResetVector (dDresPLX, OPIHI_FLT, Ntotal);
     232 
    222233  for (i = 0; i < Ntotal; i++) {
    223     double Xf = fit.Ro + fit.uR*fitdata.t[i] + fit.p*fitdata.pX[i];
    224     double Yf = fit.Do + fit.uD*fitdata.t[i] + fit.p*fitdata.pY[i];
    225     fprintf (f, "%f : %f %f : %f %f : %f : %f %f : %f %f\n", T[i], R[i], D[i], Xf, Yf, fitdata.t[i], fitdata.X[i], fitdata.Y[i], fitdata.pX[i], fitdata.pY[i]);
    226   }
    227   fclose (f);
    228 */
     234   
     235    double x0, y0;
     236    RD_to_XY (&x0, &y0, R[i], D[i], &coords);
     237
     238    double pX0, pY0;
     239    ParFactor (&pX0, &pY0, R[i], D[i], T[i]);
     240
     241    double t0 = (T[i] - Tmean)/365.25;
     242
     243    double Xpmp = fit.Ro + fit.uR*t0 + fit.p*pX0;
     244    double Ypmp = fit.Do + fit.uD*t0 + fit.p*pY0;
     245    double Xplx = fit.Ro + fit.uR*t0;
     246    double Yplx = fit.Do + fit.uD*t0;
     247
     248    dRresPMP->elements.Flt[i] = x0 - Xpmp;
     249    dDresPMP->elements.Flt[i] = y0 - Ypmp;
     250    dRresPLX->elements.Flt[i] = x0 - Xplx;
     251    dDresPLX->elements.Flt[i] = y0 - Yplx;
     252  }
    229253
    230254  // fprintf (stderr, "Roff, Doff: %f, %f; dRo, dDo: %f, %f\n", fit.Ro, fit.Do, fit.dRo, fit.dDo);
  • trunk/Ohana/src/opihi/cmd.astro/spex1dgas.c

    r33662 r39926  
    108108  IDList = NULL;
    109109  XoList = NULL;
    110   {
    111     // init random numbers
    112     long A, B;
    113     A = time(NULL);
    114     for (B = 0; A == time(NULL); B++);
    115     srand48(B);
    116   }
    117110 
     111  // srand48() is called by startup.c
     112
    118113  if (argc != 11) goto usage;
    119114
  • trunk/Ohana/src/opihi/cmd.astro/spex2dgas.c

    r33662 r39926  
    120120  float XoMax, YoMax;
    121121
    122   {
    123     // init random numbers
    124     long A, B;
    125     A = time(NULL);
    126     for (B = 0; A == time(NULL); B++);
    127     srand48(B);
    128   }
    129  
     122  // srand48() is called by startup.c
     123
    130124  if (argc != 9) goto usage;
    131125
  • trunk/Ohana/src/opihi/cmd.astro/spexseq.c

    r39457 r39926  
    9090  int Nobject = 0;
    9191
    92   {
    93     // init random numbers
    94     long A, B;
    95     A = time(NULL);
    96     for (B = 0; A == time(NULL); B++);
    97     srand48(B);
    98   }
    99  
    10092  if (argc != 6) goto usage;
     93
     94  // srand48() is called by startup.c
    10195
    10296  // XXX enforce matching lengths on the three vectors
Note: See TracChangeset for help on using the changeset viewer.