IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Dec 7, 2008, 3:31:01 PM (18 years ago)
Author:
eugene
Message:

big update from eam_branch_20081124 with updates to Opihi math

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/opihi/cmd.astro/precess.c

    r7917 r20936  
    9090  }
    9191 
    92   for (i = 0; i < xvec[0].Nelements; i++) {
    93     A = xvec[0].elements[i];
    94     D = yvec[0].elements[i];
     92  // cast xvec or yvec to FLT if it is type INT
     93  CastVector (xvec, OPIHI_FLT);
     94  CastVector (yvec, OPIHI_FLT);
     95
     96  opihi_flt *Av = xvec[0].elements.Flt;
     97  opihi_flt *Dv = yvec[0].elements.Flt;
     98
     99  for (i = 0; i < xvec[0].Nelements; i++, Av, Dv) {
     100    A = *Av;
     101    D = *Dv;
    95102    SD =  cos(RAD_DEG*A + zeta)*sin(theta)*cos(RAD_DEG*D) + cos(theta)*sin(RAD_DEG*D);
    96103    CD = sqrt (1 - SD*SD);
     
    101108    RA  = DEG_RAD*atan2(SA, CA) + z;
    102109
    103     if (RA < 0)
    104       RA += 360;
     110    if (RA < 0) RA += 360;
    105111   
    106     xvec[0].elements[i] = RA;
    107     yvec[0].elements[i] = DEC;
     112    *Av = RA;
     113    *Dv = DEC;
    108114  }
    109115
Note: See TracChangeset for help on using the changeset viewer.