Changeset 3263
- Timestamp:
- Feb 17, 2005, 8:35:27 AM (21 years ago)
- Location:
- trunk/Ohana/src/skycalc
- Files:
-
- 6 edited
-
Makefile (modified) (1 diff)
-
include/skycalc_internal.h (modified) (1 diff)
-
src/dusktime.c (modified) (4 diffs)
-
src/misc.c (modified) (6 diffs)
-
src/moondata.c (modified) (1 diff)
-
src/sundata.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/skycalc/Makefile
r2833 r3263 22 22 23 23 install: $(DESTINC)/skycalc.h $(DESTLIB)/libskycalc.a 24 25 all: moondata dusktime sundata 24 26 25 27 OBJ = $(SRC)/time.$(ARCH).o $(SRC)/geometry.$(ARCH).o \ -
trunk/Ohana/src/skycalc/include/skycalc_internal.h
r2496 r3263 90 90 double *topora, double *topodec, double *topodist); 91 91 double jd_moon_alt (double alt, double jdguess, double lat, double longit, double elevsea); 92 93 double sunset_tonight (struct SC_date_time date, double lat, double longit, double elev); 94 double sunrise_tonight (struct SC_date_time date, double lat, double longit, double elev); 95 96 int dms_to_ddd (double *Value, char *string); 97 int str_to_radec (double *ra, double *dec, char *str1, char *str2); 98 int chk_time (char *line); 99 double sec_to_jd (time_t second); 100 time_t jd_to_sec (double jd); 101 char *sec_to_date (time_t second); 102 time_t date_to_sec (char *date); 103 int str_to_time (char *line, time_t *second); 104 int str_to_dtime (char *line, double *second); -
trunk/Ohana/src/skycalc/src/dusktime.c
r2496 r3263 2 2 # include <math.h> 3 3 # include <skycalc_internal.h> 4 # define VERBOSE 0 4 5 5 6 void set_site (double *longit, double *lat, double *elevsea, double *elev) { … … 17 18 double longit, lat, elevsea, elev; 18 19 double jdnow, jdset, jdrise, d1, d2; 19 unsigned long int tzero;20 time_t tzero; 20 21 struct tm *stm; 21 22 … … 37 38 date.s = (float) (stm->tm_sec); 38 39 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); 42 41 43 42 set_site (&longit, &lat, &elevsea, &elev); … … 59 58 } 60 59 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 } 65 64 exit (0); 66 67 65 } 68 66 -
trunk/Ohana/src/skycalc/src/misc.c
r2496 r3263 1 1 # 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 11 4 /***** convert [-]00:00:00 to 0.0000 ****/ 12 5 int dms_to_ddd (double *Value, char *string) { … … 133 126 134 127 /**********/ 135 int str_to_time (char *line, unsigned int *second) {128 int str_to_time (char *line, time_t *second) { 136 129 137 130 struct timeval now; … … 201 194 202 195 /**********/ 203 double sec_to_jd ( unsigned longsecond) {196 double sec_to_jd (time_t second) { 204 197 205 198 double jd; … … 210 203 211 204 /**********/ 212 unsigned long int jd_to_sec (double jd) {213 214 unsigned long int second;205 time_t jd_to_sec (double jd) { 206 207 time_t second; 215 208 216 209 second = (jd - 2440587.5)*86400; … … 219 212 220 213 /**********/ 221 char *sec_to_date ( unsigned longsecond) {214 char *sec_to_date (time_t second) { 222 215 223 216 struct tm *gmt; … … 232 225 233 226 /***** date in format yyyy/mm/dd,hh:mm:ss *****/ 234 unsigned longdate_to_sec (char *date) {235 236 unsigned longsecond;227 time_t date_to_sec (char *date) { 228 229 time_t second; 237 230 double tmp, jd; 238 231 struct tm now; -
trunk/Ohana/src/skycalc/src/moondata.c
r2496 r3263 25 25 double RAo, DECo, abx, aby, abz, cs, theta; 26 26 double Rsun, Dsun, days; 27 unsigned long int tzero;27 time_t tzero; 28 28 struct tm *stm; 29 29 -
trunk/Ohana/src/skycalc/src/sundata.c
r2496 r3263 27 27 double RAo, DECo, abx, aby, abz, cs, theta; 28 28 double Rsun, Dsun, days, Hsun; 29 unsigned long int tzero;29 time_t tzero; 30 30 struct tm *stm; 31 31
Note:
See TracChangeset
for help on using the changeset viewer.
