Changeset 19730
- Timestamp:
- Sep 23, 2008, 6:05:08 PM (18 years ago)
- File:
-
- 1 edited
-
trunk/Ohana/src/skycalc/src/sunmoon.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/skycalc/src/sunmoon.c
r19719 r19730 26 26 if ((N = get_argument (argc, argv, "-longitude"))) { 27 27 remove_argument (N, &argc, argv); 28 longitude = atof (argv[N]) * (24.0 / 360.0);28 longitude = atof (argv[N]); 29 29 remove_argument (N, &argc, argv); 30 30 } 31 31 32 l ongitude = MKO_LATITUDE; // MKO latitude in decimal degrees32 latitude = MKO_LATITUDE; // MKO latitude in decimal degrees 33 33 if ((N = get_argument (argc, argv, "-latitude"))) { 34 34 remove_argument (N, &argc, argv); … … 46 46 if (argc != 4) { 47 47 fprintf (stderr, "USAGE: sunmoon [-longitude long] [-latitude lat] [-elevation elev] (date) (ra) (dec)\n"); 48 fprintf (stderr, " longitude : W long in decimal degrees\n");49 fprintf (stderr, " latitude : N lat in decimal degrees\n");48 fprintf (stderr, " longitude : W long in decimal HOURS\n"); 49 fprintf (stderr, " latitude : N lat in decimal DEGREES\n"); 50 50 fprintf (stderr, " elevation : meters above sea level\n"); 51 51 fprintf (stderr, " ra & dec : decimal degrees\n"); … … 77 77 sid = SC_lst(jdnow, longitude); 78 78 79 if (VERBOSE) fprintf (stderr, "jdnow: %lf, sid: $lf\n", jdnow, sid);79 if (VERBOSE) fprintf (stderr, "jdnow: %lf, sid: %lf\n", jdnow, sid); 80 80 81 81 // get the sun coordinates 82 82 SC_lpsun (jdnow, &sun_ra, &sun_dec); 83 sun_ha = sid - sun_ra;83 sun_ha = (sid - sun_ra); 84 84 sun_ra *= 15.0; 85 85 sun_alt = SC_altit (sun_dec, sun_ha, latitude, &sun_az); … … 90 90 // get the moon coordintes 91 91 SC_accumoon (jdnow, latitude, sid, elevation, &geo_ra, &geo_dec, &geo_dist, &moon_ra, &moon_dec, &moon_dist); 92 moon_ha = sid - moon_ra;92 moon_ha = (sid - moon_ra); 93 93 moon_ra *= 15.0; // convert to degrees 94 94 moon_alt = SC_altit (moon_dec, moon_ha, latitude, &moon_az); … … 97 97 if (VERBOSE) fprintf (stderr, "moon @ ra,dec = %f %f : alt, az = %f %f\n", moon_ra, moon_dec, moon_alt, moon_az); 98 98 99 phase = ( sun_ra - moon_ra - 180)/360.0;100 while (phase < -0.5) phase += 1.0;101 while (phase > 0.5) phase -= 1.0;99 phase = (moon_ra - sun_ra)/360.0; 100 while (phase < 0.0) phase += 1.0; 101 while (phase > 1.0) phase -= 1.0; 102 102 103 103 if (VERBOSE) fprintf (stderr, "sun @ %f %f dist %f\n", sun_ra, sun_dec, sun_angle);
Note:
See TracChangeset
for help on using the changeset viewer.
