IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Mar 26, 2006, 10:46:32 AM (20 years ago)
Author:
eugene
Message:

adding proper motion and parallax to addstar, dropping _PS from RA and DEC in average

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/libohana/src/time.c

    r5926 r6683  
    4848  value += tmp / 3600.0;
    4949
    50  escape:
     50escape:
    5151  if (neg) {
    5252    value *= -1;
     
    6464  *ra = *dec = 0;
    6565  switch (dms_to_ddd (&Ra, str1)) {
    66   case 0:
    67     fprintf (stderr, "syntax error in RA\n");
    68     return (FALSE);
    69   case 1:
    70     break;
    71   case 2:
    72     Ra = Ra * 15;
    73     break;
     66    case 0:
     67      fprintf (stderr, "syntax error in RA\n");
     68      return (FALSE);
     69    case 1:
     70      break;
     71    case 2:
     72      Ra = Ra * 15;
     73      break;
    7474  }
    7575  switch (dms_to_ddd (&Dec, str2)) {
    76   case 0:
    77     fprintf (stderr, "syntax error in DEC\n");
    78     return (FALSE);
    79   case 1:
    80   case 2:
    81     break;
     76    case 0:
     77      fprintf (stderr, "syntax error in DEC\n");
     78      return (FALSE);
     79    case 1:
     80    case 2:
     81      break;
    8282  }
    8383  *ra = Ra;
     
    151151   
    152152  switch (chk_time (line)) {
    153   case 0:
    154     return (FALSE);
    155   case TIME_DATE:
    156     *second = date_to_sec (line);
    157     return (TRUE);
    158   case TIME_DAYS:
    159     *second = strtod (line, 0) * 86400.0;
    160     return (TRUE);
    161   case TIME_HOURS:
    162     *second = strtod (line, 0) * 3600.0;
    163     return (TRUE);
    164   case TIME_MINUTES:
    165     *second = strtod (line, 0) * 60.0;
    166     return (TRUE);
    167   case TIME_SECONDS:
    168     *second = strtod (line, 0);
    169     return (TRUE);
    170   case TIME_JD:
    171     jd = strtod (line, 0);
    172     *second = jd_to_sec (jd);
    173     return (TRUE);
    174   case TIME_MJD:
    175     jd = strtod (line, 0);
    176     *second = mjd_to_sec (jd);
    177     return (TRUE);
     153    case 0:
     154      return (FALSE);
     155    case TIME_DATE:
     156      *second = date_to_sec (line);
     157      return (TRUE);
     158    case TIME_DAYS:
     159      *second = strtod (line, 0) * 86400.0;
     160      return (TRUE);
     161    case TIME_HOURS:
     162      *second = strtod (line, 0) * 3600.0;
     163      return (TRUE);
     164    case TIME_MINUTES:
     165      *second = strtod (line, 0) * 60.0;
     166      return (TRUE);
     167    case TIME_SECONDS:
     168      *second = strtod (line, 0);
     169      return (TRUE);
     170    case TIME_JD:
     171      jd = strtod (line, 0);
     172      *second = jd_to_sec (jd);
     173      return (TRUE);
     174    case TIME_MJD:
     175      jd = strtod (line, 0);
     176      *second = mjd_to_sec (jd);
     177      return (TRUE);
    178178  }
    179179  return (FALSE);
     
    185185 
    186186  switch (chk_time (line)) {
    187   case 0:
    188   case TIME_JD:
    189   case TIME_MJD:
    190   case TIME_DATE:
    191     return (FALSE);
    192   case TIME_DAYS:
    193     *second = strtod (line, 0) * 86400.0;
    194     return (TRUE);
    195   case TIME_HOURS:
    196     *second = strtod (line, 0) * 3600.0;
    197     return (TRUE);
    198   case TIME_MINUTES:
    199     *second = strtod (line, 0) * 60.0;
    200     return (TRUE);
    201   case TIME_SECONDS:
    202     *second = strtod (line, 0);
    203     return (TRUE);
     187    case 0:
     188    case TIME_JD:
     189    case TIME_MJD:
     190    case TIME_DATE:
     191      return (FALSE);
     192    case TIME_DAYS:
     193      *second = strtod (line, 0) * 86400.0;
     194      return (TRUE);
     195    case TIME_HOURS:
     196      *second = strtod (line, 0) * 3600.0;
     197      return (TRUE);
     198    case TIME_MINUTES:
     199      *second = strtod (line, 0) * 60.0;
     200      return (TRUE);
     201    case TIME_SECONDS:
     202      *second = strtod (line, 0);
     203      return (TRUE);
    204204  }
    205205  return (FALSE);
     
    312312  p1 = p2 + 1;
    313313
    314  escape:
     314escape:
    315315  jd = now.tm_mday - 32075 + (int)(1461*(1900 + now.tm_year + 4800 + (int)(((now.tm_mon+1)-14)/12))/4)
    316316    + (int)(367*((now.tm_mon+1) - 2 - (int)(((now.tm_mon+1) - 14)/12)*12)/12)
Note: See TracChangeset for help on using the changeset viewer.