IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 8643


Ignore:
Timestamp:
Aug 27, 2006, 1:29:25 PM (20 years ago)
Author:
eugene
Message:

sidereal time from Keyword or from jd and longitude

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/addstar/src/gstars.c

    r8458 r8643  
    4646  }
    4747   
    48   /* get ST (used for airmass calculation) */
    49   gfits_scan (&header, STKeyword, "%s", 1, line);
    50   /* remove ':' characters */
    51   for (c = strchr (line, ':'); c != (char *) NULL; c = strchr (line, ':')) { *c = ' '; }
    52   sscanf (line, "%d %d %lf", &hour, &min, &sec);
    53   image[0].sidtime = hour + min/60.0 + sec/3600.0;
    54   image[0].latitude = Latitude;
    55 
    5648  /* CERROR in data file is in arcsec */
    5749  if (!gfits_scan (&header, "CERROR",   "%lf", 1, &tmp)) tmp = 1.0;
     
    111103    image[0].tzero = parse_time (&header);
    112104  }
     105
     106  if (STKeyword[0]) {
     107    /* get ST (used for airmass calculation) */
     108    gfits_scan (&header, STKeyword, "%s", 1, line);
     109    /* remove ':' characters */
     110    for (c = strchr (line, ':'); c != (char *) NULL; c = strchr (line, ':')) { *c = ' '; }
     111    sscanf (line, "%d %d %lf", &hour, &min, &sec);
     112    image[0].sidtime = hour + min/60.0 + sec/3600.0;
     113  } else {
     114    double jd;
     115    jd = sec_to_jd (image[0].tzero);
     116    image[0].sidtime  = ohana_lst (jd, Longitude);
     117  }
     118  image[0].latitude = Latitude;
    113119
    114120  tmp = 0;
     
    213219
    214220    XY_to_RD (&stars[N].R, &stars[N].D, stars[N].X, stars[N].Y, &image[0].coords);
    215     while (stars[N].R < 0.0) stars[N].R += 360.0;
     221    while (stars[N].R <    0.0) stars[N].R += 360.0;
    216222    while (stars[N].R >= 360.0) stars[N].R -= 360.0;
    217223    stars[N].found = -1;
Note: See TracChangeset for help on using the changeset viewer.