IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 7964


Ignore:
Timestamp:
Jul 24, 2006, 3:17:36 PM (20 years ago)
Author:
eugene
Message:

added LST function

Location:
trunk/Ohana/src
Files:
1 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/libohana/include/ohana.h

    r7929 r7964  
    156156double  sec_to_mjd             PROTO((time_t second));
    157157time_t  mjd_to_sec             PROTO((double mjd));
     158double  ohana_lst              PROTO((double jd, double longitude));
    158159
    159160int     hstgsc_hms_to_deg      PROTO((double *h0, double *h1, double *d0, double *d1, char *string));
  • trunk/Ohana/src/libohana/src/time.c

    r6683 r7964  
    395395 * 99:02:15:12h23m30s
    396396 */
     397
     398
     399/* returns the local MEAN sidereal time (dec hrs) at julian date jd
     400   at west longitude long (decimal hours).  Follows
     401   definitions in 1992 Astronomical Almanac, pp. B7 and L2.
     402   Expression for GMST at 0h ut referenced to Aoki et al, A&A 105,
     403   p.359, 1982.  On workstations, accuracy (numerical only!)
     404   is about a millisecond in the 1990s.
     405   EAM: function from skycalc (thorstensen)
     406*/
     407#define  J2000             2451545.        /* Julian date at standard epoch */
     408#define  SEC_IN_DAY        86400.
     409
     410double ohana_lst (double jd, double longitude) {
     411
     412  double t, ut, jdmid, jdint, jdfrac, sid_g, sid;
     413  long sid_int;
     414
     415  jdint = (int) jd;
     416  jdfrac = jd - jdint;
     417
     418  if (jdfrac < 0.5) {
     419    jdmid = jdint - 0.5;
     420    ut = jdfrac + 0.5;
     421  } else {
     422    jdmid = jdint + 0.5;
     423    ut = jdfrac - 0.5;
     424  }
     425
     426  t = (jdmid - J2000)/36525;
     427  sid_g = (24110.54841+8640184.812866*t+0.093104*t*t-6.2e-6*t*t*t)/SEC_IN_DAY;
     428  sid_int = sid_g;
     429  sid_g = sid_g - (double) sid_int;
     430  sid_g = sid_g + 1.0027379093 * ut - longitude/24.;
     431  sid_int = sid_g;
     432  sid_g = (sid_g - (double) sid_int) * 24.;
     433  if (sid_g < 0.) sid_g = sid_g + 24.;
     434  return (sid_g);
     435}
  • trunk/Ohana/src/opihi/cmd.astro/Makefile

    r6642 r7964  
    3333$(SDIR)/gauss.$(ARCH).o            \
    3434$(SDIR)/getvel.$(ARCH).o           \
     35$(SDIR)/getlst.$(ARCH).o           \
    3536$(SDIR)/medianmap.$(ARCH).o        \
    3637$(SDIR)/mkgauss.$(ARCH).o          \
  • trunk/Ohana/src/opihi/cmd.astro/init.c

    r6642 r7964  
    1515int gaussfit                PROTO((int, char **));
    1616int getvel                  PROTO((int, char **));
     17int getlst                  PROTO((int, char **));
    1718int imfit                   PROTO((int, char **));
    1819int imsub                   PROTO((int, char **));
     
    4849  {"gauss",       gauss,        "get statistics on a star, assuming gaussian profile"},
    4950  {"getvel",      getvel,       "rotcurve to velocities"},
     51  {"getlst",      getlst,       "return LST given time and longitude"},
    5052  {"imfit",       imfit,        "fit function"},
    5153  {"imsub",       imsub,        "subtract function"},
Note: See TracChangeset for help on using the changeset viewer.