IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 3263


Ignore:
Timestamp:
Feb 17, 2005, 8:35:27 AM (21 years ago)
Author:
eugene
Message:

cleaned up time types

Location:
trunk/Ohana/src/skycalc
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/skycalc/Makefile

    r2833 r3263  
    2222
    2323install: $(DESTINC)/skycalc.h $(DESTLIB)/libskycalc.a
     24
     25all: moondata dusktime sundata
    2426
    2527OBJ =   $(SRC)/time.$(ARCH).o           $(SRC)/geometry.$(ARCH).o \
  • trunk/Ohana/src/skycalc/include/skycalc_internal.h

    r2496 r3263  
    9090       double *topora, double *topodec, double *topodist);
    9191double jd_moon_alt (double alt, double jdguess, double lat, double longit, double elevsea);
     92
     93double sunset_tonight (struct SC_date_time date, double lat, double longit, double elev);
     94double sunrise_tonight (struct SC_date_time date, double lat, double longit, double elev);
     95
     96int dms_to_ddd (double *Value, char *string);
     97int str_to_radec (double *ra, double *dec, char *str1, char *str2);
     98int chk_time (char *line);
     99double sec_to_jd (time_t second);
     100time_t jd_to_sec (double jd);
     101char *sec_to_date (time_t second);
     102time_t date_to_sec (char *date);
     103int str_to_time (char *line, time_t *second);
     104int str_to_dtime (char *line, double *second);
  • trunk/Ohana/src/skycalc/src/dusktime.c

    r2496 r3263  
    22# include <math.h>
    33# include <skycalc_internal.h>
     4# define VERBOSE 0
    45
    56void set_site (double *longit, double *lat, double *elevsea, double *elev) {
     
    1718  double longit, lat, elevsea, elev;
    1819  double jdnow, jdset, jdrise, d1, d2;
    19   unsigned long int tzero;
     20  time_t tzero;
    2021  struct tm *stm;
    2122
     
    3738  date.s  = (float) (stm->tm_sec);
    3839
    39   /*
    40   fprintf (stderr, "%4d/%02d/%02d %02d:%02d:%02f\n", date.y, date.mo, date.d, date.h, date.mn, date.s);
    41   */
     40  if (VERBOSE) fprintf (stderr, "%4d/%02d/%02d %02d:%02d:%02f\n", date.y, date.mo, date.d, date.h, date.mn, date.s);
    4241
    4342  set_site (&longit, &lat, &elevsea, &elev);
     
    5958  }   
    6059
    61   /*
    62   jd_to_date (jdnow, &tmpdate);
    63   fprintf (stderr, "%4d/%02d/%02d %02d:%02d:%02f\n", tmpdate.y, tmpdate.mo, tmpdate.d, tmpdate.h, tmpdate.mn, tmpdate.s);
    64   */
     60  if (VERBOSE) {
     61    jd_to_date (jdnow, &tmpdate);
     62    fprintf (stderr, "%4d/%02d/%02d %02d:%02d:%02f\n", tmpdate.y, tmpdate.mo, tmpdate.d, tmpdate.h, tmpdate.mn, tmpdate.s);
     63  }
    6564  exit (0);
    66 
    6765}
    6866
  • trunk/Ohana/src/skycalc/src/misc.c

    r2496 r3263  
    11# include <ohana.h>
    2 
    3 int dms_to_ddd (double *Value, char *string);
    4 int str_to_radec (double *ra, double *dec, char *str1, char *str2);
    5 int chk_time (char *line);
    6 double sec_to_jd (unsigned long second);
    7 unsigned long int jd_to_sec (double jd);
    8 char *sec_to_date (unsigned long second);
    9 unsigned long date_to_sec (char *date);
    10  
     2# include <skycalc_internal.h>
     3
    114/***** convert [-]00:00:00 to 0.0000 ****/
    125int dms_to_ddd (double *Value, char *string) {
     
    133126
    134127/**********/
    135 int str_to_time (char *line, unsigned int *second) {
     128int str_to_time (char *line, time_t *second) {
    136129 
    137130  struct timeval now;
     
    201194
    202195/**********/
    203 double sec_to_jd (unsigned long second) {
     196double sec_to_jd (time_t second) {
    204197
    205198  double jd;
     
    210203
    211204/**********/
    212 unsigned long int jd_to_sec (double jd) {
    213 
    214   unsigned long int second;
     205time_t jd_to_sec (double jd) {
     206
     207  time_t second;
    215208
    216209  second = (jd - 2440587.5)*86400;
     
    219212
    220213/**********/
    221 char *sec_to_date (unsigned long second) {
     214char *sec_to_date (time_t second) {
    222215 
    223216  struct tm *gmt;
     
    232225
    233226/***** date in format yyyy/mm/dd,hh:mm:ss *****/
    234 unsigned long date_to_sec (char *date) {
    235  
    236   unsigned long second;
     227time_t date_to_sec (char *date) {
     228 
     229  time_t second;
    237230  double tmp, jd;
    238231  struct tm now;
  • trunk/Ohana/src/skycalc/src/moondata.c

    r2496 r3263  
    2525  double RAo, DECo, abx, aby, abz, cs, theta;
    2626  double Rsun, Dsun, days;
    27   unsigned long int tzero;
     27  time_t tzero;
    2828  struct tm *stm;
    2929
  • trunk/Ohana/src/skycalc/src/sundata.c

    r2496 r3263  
    2727  double RAo, DECo, abx, aby, abz, cs, theta;
    2828  double Rsun, Dsun, days, Hsun;
    29   unsigned long int tzero;
     29  time_t tzero;
    3030  struct tm *stm;
    3131
Note: See TracChangeset for help on using the changeset viewer.