home *** CD-ROM | disk | FTP | other *** search
/ Garbo / Garbo.cdr / pc / source / star.lzh / star.5 < prev    next >
Encoding:
Text File  |  1990-03-27  |  48.0 KB  |  1,745 lines

  1. #! /bin/sh
  2. # This is a shell archive.  Remove anything before this line, then unpack
  3. # it by saving it into a file and typing "sh file".  To overwrite existing
  4. # files, type "sh file -c".  You can also feed this as standard input via
  5. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  6. # will see the following message at the end:
  7. #        "End of archive 5 (of 32)."
  8. # Contents:  doc/observe.1 observe/datelib.c observe/observe.h
  9. #   observe/satcalc.c starchart/interact.c starchart/starcust.c
  10. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  11. if test -f 'doc/observe.1' -a "${1}" != "-c" ; then 
  12.   echo shar: Will not clobber existing file \"'doc/observe.1'\"
  13. else
  14. echo shar: Extracting \"'doc/observe.1'\" \(7858 characters\)
  15. sed "s/^X//" >'doc/observe.1' <<'END_OF_FILE'
  16. X.TH OBSERVE LOCAL "15 July 1989"
  17. X.ad b
  18. X.SH NAME
  19. Xobserve \- observing session planning aid, ephemeris generation, and more.
  20. X.SH SYNOPSIS
  21. X.B observe
  22. X[
  23. X.BI \-m " longitude_hrs"
  24. X[
  25. X.I long_min
  26. X[
  27. X.I long_sec
  28. X]
  29. X]
  30. X]
  31. X.br
  32. X.if t .ti +.5i
  33. X[
  34. X.BI \-l " latitude_hrs"
  35. X[
  36. X.I lat_min
  37. X[
  38. X.I lat_sec
  39. X]
  40. X]
  41. X]
  42. X.br
  43. X.if t .ti +.5i
  44. X[
  45. X.BI \-a " altitude_meters"
  46. X]
  47. X[
  48. X.BI \-z " time_zone_hrs"
  49. X]
  50. X.br
  51. X.if t .ti +.5i
  52. X[
  53. X.B \-d
  54. X\fI"start_date"\fR
  55. X[
  56. X\fI"end_date"\fR
  57. X[
  58. X.I interval_days
  59. X]
  60. X]
  61. X]
  62. X.br
  63. X.if t .ti +.5i
  64. X[
  65. X.BI \-o[[\fIa\fR][\fIe\fR][\fIi\fR][\fIo\fR][\fIs\fR]] " outfilename_root"
  66. X]
  67. X.br
  68. X.if t .ti +.5i
  69. X[
  70. X.B \-p
  71. X[
  72. X[\fIM\fR][\fIV\fR][\fIm\fR][\fIJ\fR][\fIs\fR][\fIU\fR][\fIN\fR]
  73. X]
  74. X]
  75. X[
  76. X.BI \-s i
  77. X]
  78. X.br
  79. X.if t .ti +.5i
  80. X[
  81. X.BI \-f " filename format"
  82. X]
  83. X[
  84. X.BI \-n " object_name"
  85. X]
  86. X
  87. X
  88. X.SH DESCRIPTION
  89. XThe program is used to prepare for astronomical observations and for
  90. Xephemeris calculation.  It can calculate the position of the major
  91. Xplanets, the satellites of Jupiter and Saturn, and minor planets and
  92. Xcomets given either orbital elements or a tabulated ephemeris.
  93. XCoordinates of stationary objects may also be input.  It calculates
  94. X(approximate) rise and set times, and transit times, of all objects to
  95. Xbe observed.
  96. X.PP
  97. XThe information (coordinates, rise and set times) may be prepared for either
  98. Xa single time or a sequence of times.
  99. X.PP
  100. XOutput includes a file containing the timetable of events for the evening or
  101. Xevenings.  The coordinates of the sun and moon, plus any planets, minor
  102. Xplanets, and comets are placed in a readable text file, with other calculated
  103. Xvalues for solar system objects (e.g. distance to earth).  The coordinates
  104. Xof all objects to be observed are placed in files in formats to be read by
  105. Xthe other programs in this family, namely "dataconv" and the starchart
  106. Xcharting programs.  If satellite positions are to be computed, these
  107. Xcoordinates are placed in one file, and a separate PostScript file
  108. Xgraphically showing their positions relative to the primary is also
  109. Xproduced.
  110. X.PP
  111. XParameters set the location of the observer, control
  112. Xwhat objects are to be observed, and designate the time or times of
  113. Xinterest.
  114. X.PP
  115. XThe file \fIfilename\fR may be in one of several ephemeris
  116. Xformats for a single object:
  117. X.br
  118. X.nf
  119. X.ta \w'empb    'u
  120. Xemp    - Format used in the Russian \fIEphemerides of minor planets\fR.
  121. X.br
  122. Xempb    - Format used in the Russian \fIEphemerides of minor planets\fR for
  123. X        bright and unusual asteroids.
  124. X.br
  125. Xaa    - Format used by Astronomical Almanac.
  126. X.br
  127. Xst    - Format commonly used by Sky and Telescope.
  128. X.br
  129. Xiau    - Format commonly used by IAU Circulars.
  130. X.fi
  131. X.PP
  132. XOr it may be contain orbital elements for one or more objects:
  133. X.br
  134. X.nf
  135. X.ta \w'par_e    'u
  136. Xell_e    - elliptical orbital elements.
  137. X.br
  138. Xpar_e    - parabolic orbital elements.
  139. X.fi
  140. X.PP
  141. XOr it may contain coordinates of fixed objects:
  142. X.br
  143. X.nf
  144. X.ta \w'par_e    'u
  145. Xobj    -  fixed object coordinates.
  146. X.br
  147. X.fi
  148. X.PP
  149. XIf the file \fIfilename\fR is in one of the ephemeris formats, it
  150. Xcontains ephemeris data for object named "obj_name".
  151. X.PP
  152. XInterpolation of the data is performed from the date
  153. Xspecified by the string \fIstart_date\fR until the \fIend_date\fR,
  154. Xwith interval between interpolated points of \fIinterval\fR days.  The
  155. X"lineread" and "sif" files contain commands to draw a solid vector
  156. Xbetween calculated points, and draw the object symbol and label with
  157. Xname.
  158. X.PP
  159. X
  160. XAll ephemeris formats have date RA DEC, then other info.  Date is month in
  161. Xcharacters, then date  How the month is encoded is format dependent,
  162. Xexamples include "IX" "Sept." "Sep" "Sep." "September".  Year is
  163. Xcurrent year unless specified in command line, and is the year of the
  164. Xfirst date.  Dates must be in increasing order: 3 followed by 4,
  165. XDecember followed by January.
  166. X.PP
  167. XThe orbital element formats may be used to conveniently calculate
  168. Xcoordinates of asteroids and comets.
  169. X.PP
  170. XOutput files are named \fIoutfile_root.X\fR where X is:
  171. X.nf
  172. X.ta \w'.sat_PS    'u
  173. Xaltaz    - altitude and azimuth of objects at sunrise and sunset, and
  174. X        morning and evening twilights.
  175. X.br
  176. Xeph    - ephemeris of sun, moon and objects specified.
  177. X.br
  178. Xobs    - observability of objects: rise and set times of objects,
  179. X        twilight times, etc.
  180. X.br
  181. Xstar    - "lineread" format file containing coordinates (equinox
  182. X       2000) of the object(s), sun, moon.
  183. X.br
  184. Xsif    - "sif" format file containing the same information as the
  185. X       .star file.  The separation character is ";".
  186. X.br
  187. Xsat    - Locations of the major satellites of Jupiter and Saturn with
  188. X       respect to the primary.
  189. X.br
  190. Xsat_PS    - PostScript file drawing either: one page showing appearance of
  191. X        Jupiter and Saturn with satellites, and relative sizes and
  192. X        orientations of Mercury, Venus, Mars, Jupiter, and Saturn,
  193. X        and the Moon; or several pages showing Jupiter and Saturn
  194. X        with moons on a sequence of times if a range of dates was
  195. X        specified.
  196. X.PP
  197. XThe default \fIoutfile_root\fR is set at compile time.  The usual
  198. Xdefault is "planet" for historical reasons.  A character or characters
  199. Ximmediately following the \fB-o\fR option may select a subset of these
  200. Xfiles to be output.  The characters "aeios" specify the altaz, eph,
  201. Xsif, obs, and star files respectively.
  202. X.PP
  203. XThe options controlling the location of the observer are
  204. X.TP
  205. X.B \-m
  206. XMeridian of longitude, measured East of Greenwich.  The USA is West of
  207. XGreenwich, and the longitude is negative for all USA locations.
  208. X.TP
  209. X.B \-l
  210. XLatitude.
  211. X.TP
  212. X.B \-a
  213. XAltitude in meters.
  214. X.TP
  215. X.B \-z
  216. XTime zone in hours East of Greenwich, again, this number is negative
  217. Xfor USA locations.  This does not include any effects of daylight
  218. Xsavings.
  219. X.fi
  220. X.PP
  221. XThe defaults for these parameters are set when the program is compiled.
  222. X.PP
  223. XThe date or dates of observation in UT are specified with the \fB-d\fR
  224. Xflag.  The dates for the \fB-d\fR option are each specified as a string
  225. Xconsisting of month, day, and optional year (use if different from the
  226. Xcurrent year).  The month may be encoded as above, e.g. "Aug" for
  227. Xaugust.  Using the first three letters of the English name for the
  228. Xmonth always works,  as does the Roman numeral form.  Some other
  229. Xcommon abbreviations also work.  The year may also be specified, the
  230. Xdefault is the current year.  The day may be fractional, e.g. 1.25 is
  231. X6 am UT on the first.  An optional third parameter is the increment of
  232. Xtime to be used in stepping between the two dates.
  233. X.PP
  234. XThe positions of any or all of the major planets at the time(s) may be
  235. Xcalculated.  This is specified either as \fB-p\fR which causes the
  236. Xpositions of all planets to be calculated, or individual planets may
  237. Xbe specified by following the \fB-p\fR with a letter or letters from
  238. Xthe sequence "MVmJsUN".  The positions of the sun and moon are always
  239. Xcalculated, since they always have some effect on observing
  240. Xconditions.
  241. X.PP
  242. XThe \fB-s\fR option causes the ".sat"and ".sat_PS" files to be
  243. Xproduced for the satellites of Jupiter and Saturn.  \fB-s\fR implies
  244. X\fB-p\fR.  With the \fB-si\fR option the drawings in the PS file are
  245. Xflipped north to south (if for one time) or east to west (if for
  246. Xmultiple times) to produce an inverted view.
  247. X.SH EXAMPLES
  248. Xobserve -f cer.empb empb -d "Nov 3" "Nov 5"
  249. X.br
  250. Xobserve -si -d "aug 1 1980" "Aug 31"
  251. X.br
  252. Xobserve -f asteroids.ell_e ell_e -d "Sep 1" "sep 5" 0.25 -oe test
  253. X.br
  254. Xobserve -m -72 33 25 -l 54 40 -a 1050
  255. X.SH FILES
  256. XSee sample data files for formats.
  257. X.SH BUGS
  258. XMinor corrections such as parallax and nutation are not made.
  259. X.PP
  260. XPositions are accurate enough for most applications other than
  261. Xoccultations.
  262. X.PP
  263. XRise and set times may be off by several minutes.
  264. X.PP
  265. XPositions opf Saturn's satellites are approximate, good enough for
  266. Xidentification of satellites.
  267. X.SH AUTHOR
  268. XCraig Counterman
  269. X.br
  270. X.sp
  271. Xparts from \fIplanet\fR by
  272. X.br
  273. XF.T. Mendenhall <ihnp4!inuxe!fred>
  274. X.br
  275. XJim Cobb <jcobb@gr.utah.edu>
  276. X.br
  277. XAlan Paeth <AWPaeth@watCGL>
  278. X.SH SOURCES
  279. X\fIAstronomical Formulae for Calculators\fR by Jean Meesus
  280. X.br
  281. X\fIAstronomical Almanac 1989\fR
  282. END_OF_FILE
  283. if test 7858 -ne `wc -c <'doc/observe.1'`; then
  284.     echo shar: \"'doc/observe.1'\" unpacked with wrong size!
  285. fi
  286. # end of 'doc/observe.1'
  287. fi
  288. if test -f 'observe/datelib.c' -a "${1}" != "-c" ; then 
  289.   echo shar: Will not clobber existing file \"'observe/datelib.c'\"
  290. else
  291. echo shar: Extracting \"'observe/datelib.c'\" \(6401 characters\)
  292. sed "s/^X//" >'observe/datelib.c' <<'END_OF_FILE'
  293. X/*
  294. X * datelib.c
  295. X * date routines
  296. X *
  297. X * Copyright (c) 1990 by Craig Counterman. All rights reserved.
  298. X *
  299. X * This software may be redistributed freely, not sold.
  300. X * This copyright notice and disclaimer of warranty must remain
  301. X *    unchanged. 
  302. X *
  303. X * No representation is made about the suitability of this
  304. X * software for any purpose.  It is provided "as is" without express or
  305. X * implied warranty, to the extent permitted by applicable law.
  306. X *
  307. X */
  308. X
  309. X
  310. X#ifndef  lint
  311. Xstatic char rcsid[] =
  312. X  "$Header: datelib.c,v 1.8 90/02/23 00:16:33 ccount Exp $";
  313. X#endif
  314. X
  315. X
  316. X#include <stdio.h>
  317. X#include <math.h>
  318. X#include <ctype.h>
  319. X
  320. X#ifndef SYSV
  321. X#include <strings.h>
  322. X#else
  323. X#include <string.h>
  324. X#endif /* SYSV */
  325. X
  326. X#include "date.h"
  327. X
  328. X/* Calendar = month, day, year, where day is type double
  329. X   jd = julian date, type double
  330. X   str = string format.  Year is optional, default must be specified.
  331. X
  332. Xfunctions:
  333. Xcal_to_jd(day, month, year, &jd);
  334. Xcal_to_str(day, month, year, string);  String must be char string[15];
  335. Xjd_to_cal(jd, &day, &month, &year);
  336. Xjd_to_str(jd, string);  String must be char string[15];
  337. Xstr_to_jd(string, default_year, &jd);
  338. X                              default_year is default year,
  339. X                              used if not specified in string
  340. Xstr_to_cal(string, &day, &month, &year);
  341. X*/
  342. X
  343. Xvoid cal_to_jd(day, month, year, jd_p)
  344. X     int month, year;
  345. X     double day;
  346. X     double *jd_p;
  347. X{
  348. X  int b, d, m, y;
  349. X  long c;
  350. X
  351. X  m = month;
  352. X  y = (year < 0) ? year + 1 : year;
  353. X  if (month < 3) {
  354. X    m += 12;
  355. X    y -= 1;
  356. X  }
  357. X
  358. X  if ((year < 1582) ||
  359. X      (year == 1582 && ((month < 10)
  360. X            || ((month == 10) && (day < 15)))))
  361. X    b = 0;
  362. X  else {
  363. X    int a;
  364. X    a = y/100;
  365. X    b = 2 - a + a/4;
  366. X  }
  367. X
  368. X  if (y < 0)
  369. X    c = (long)((365.25*y) - 0.75) + 1720995L;
  370. X  else
  371. X    c = (long)(365.25*y) + 1720995L;
  372. X
  373. X  d = 30.6001*(m+1);
  374. X
  375. X  *jd_p = (b + c + d + day - 0.5);
  376. X}
  377. X
  378. Xstatic char *mname[] = {
  379. X  "",  "Jan", "Feb", "Mar", "Apr", "May", "Jun",
  380. X  "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"};
  381. X
  382. X
  383. Xvoid cal_to_str(day, month, year, str)
  384. X     int month, year;
  385. X     double day;
  386. X     char str[];
  387. X{
  388. X  sprintf(str, "%.2f %s %d", day, mname[month], year);
  389. X}
  390. X
  391. X
  392. Xvoid jd_to_cal(jd, day, month, year)
  393. X     double jd;
  394. X     double *day;
  395. X     int *month, *year;
  396. X{
  397. X  double d, f;
  398. X  double i, a, b, ce, g;
  399. X
  400. X  d = jd + 0.5 - 2415020L;
  401. X  i = floor(d);
  402. X  f = d-i;
  403. X  if (f == 1) {
  404. X    f = 0;
  405. X    i += 1;
  406. X  }
  407. X
  408. X  if (jd > 2299160L) {        /* After the date change in 1582 */
  409. X    a = floor((i/36524.25)+.9983573)+14;
  410. X    i += 1 + a - floor(a/4.0);
  411. X  }
  412. X
  413. X  b = floor((i/365.25)+.802601);
  414. X  ce = i - floor((365.25*b)+.750001)+416;
  415. X  g = floor(ce/30.6001);
  416. X  *month = g - 1;
  417. X  *day = ce - floor(30.6001*g)+f;
  418. X  *year = b + 1899;
  419. X
  420. X  if (g > 13.5)
  421. X    *month = g - 13;
  422. X  if (*month < 2.5)
  423. X    *year = b + 1900;
  424. X  if (*year < 1)
  425. X    *year -= 1;
  426. X}
  427. X
  428. X
  429. Xvoid jd_to_str(jd, str)
  430. X     double jd;
  431. X     char str[];
  432. X{
  433. X  int year, month;
  434. X  double day;
  435. X
  436. X  jd_to_cal(jd, &day, &month, &year);
  437. X
  438. X  sprintf(str, "%.2f %s %d", day, mname[month], year);
  439. X}
  440. X
  441. X
  442. X
  443. X
  444. X
  445. X/* Given date string and the year to be zero, give the day number:
  446. XE.g.
  447. X"100.3"             1988 => 100.3
  448. X"1/1/1988"          1988 => 1.0
  449. X"2/1/1989"          1988 => 398.0
  450. X"October 3"         1988 => 
  451. X*/
  452. Xvoid str_to_jd(s, year, jd_p)
  453. X     char *s;
  454. X     int year;
  455. X     double *jd_p;
  456. X{
  457. X  int mo, yr;
  458. X  double dy;
  459. X  double daynum;
  460. X
  461. X  /* see if it's just a number already */
  462. X  if ((index(s, ' ')) == NULL) {
  463. X    *jd_p = atof(s);
  464. X    return;
  465. X  };
  466. X
  467. X  str_to_cal(s, &dy, &mo, &yr);
  468. X  if (yr == 0) yr = year;
  469. X
  470. X  daynum = dy;
  471. X  cal_to_jd(daynum, mo, yr, jd_p);
  472. X}
  473. X
  474. X/* interpret string as month, day and perhaps year.
  475. Xyear 0 if no year in string, there is no year 0 in the calender.
  476. XE.g.:
  477. XOct. 1                  => 1 10 0
  478. XIX 23                   => 23 9 0
  479. X2/12/1987               => 12 2 1987
  480. X5-2-88                  => 2 5 1988
  481. XJanuary 23 1988         => 23 1 1988
  482. X*/
  483. X
  484. Xvoid str_to_cal(s, dy, mo, yr)
  485. X     char *s;
  486. X     double *dy;
  487. X     int *mo, *yr;
  488. X{
  489. X  int i, n;
  490. X  char string1[100], string2[100];
  491. X
  492. X  /* Is there a dash? */
  493. X  if ((index(s, '-')) != NULL) { /* YES */
  494. X    n = sscanf(s, "%lf-%d-%d", dy, mo, yr);
  495. X    if (n != 3) *yr = 0;
  496. X    return;
  497. X  }
  498. X
  499. X  /* Is there a slash? */
  500. X  if ((index(s, '/')) != NULL) { /* YES */
  501. X    n = sscanf(s, "%lf/%d/%d", dy, mo, yr);
  502. X    if (n != 3) *yr = 0;
  503. X    return;
  504. X  }
  505. X
  506. X  /* Try Month day year or Month day, year
  507. X     or day Month year */
  508. X  /* first eliminate commas */
  509. X  i = 0;
  510. X  while (s[i]) {
  511. X    if (s[i] == ',') s[i] = ' ';
  512. X    i++;
  513. X  }
  514. X
  515. X  n = sscanf(s, "%s %s %d", string1, string2, yr);
  516. X  if (n < 2) {
  517. X    fprintf(stderr, "Can't understand date %s\n", s);
  518. X    exit(1);
  519. X  } else if (n == 2) *yr = 0;
  520. X
  521. X  *mo = tr_mname(string1);
  522. X  if (*mo < 1) {
  523. X    *mo = tr_mname(string2);
  524. X    *dy = atof(string1);
  525. X  } else
  526. X    *dy = atof(string2);
  527. X
  528. X  if (*mo < 1) {
  529. X    fprintf(stderr, "Can't understand date %s\n", s);
  530. X    exit(1);
  531. X  }
  532. X}
  533. X
  534. X/* translate date string to month number */
  535. Xint tr_mname(s)
  536. X     char *s;
  537. X{
  538. X  int i = -1;
  539. X  while (s[++i]) if (isupper(s[i])) s[i] = tolower(s[i]);
  540. X
  541. X  if (!strcmp(s,"jan")
  542. X      || !strcmp(s,"jan.")
  543. X      || !strcmp(s,"i")
  544. X      || !strcmp(s,"january"))
  545. X    return 1;
  546. X
  547. X  if (!strcmp(s,"feb")
  548. X      || !strcmp(s,"feb.")
  549. X      || !strcmp(s,"ii")
  550. X      || !strcmp(s,"febuary"))
  551. X    return 2;
  552. X
  553. X  if (!strcmp(s,"mar")
  554. X      || !strcmp(s,"mar.")
  555. X      || !strcmp(s,"iii")
  556. X      || !strcmp(s,"march"))
  557. X    return 3;
  558. X
  559. X  if (!strcmp(s,"apr")
  560. X      || !strcmp(s,"apr.")
  561. X      || !strcmp(s,"iv")
  562. X      || !strcmp(s,"april"))
  563. X    return 4;
  564. X
  565. X  if (!strcmp(s,"may")
  566. X      || !strcmp(s,"v"))
  567. X    return 5;
  568. X
  569. X  if (!strcmp(s,"jun")
  570. X      || !strcmp(s,"jun.")
  571. X      || !strcmp(s,"vi")
  572. X      || !strcmp(s,"june"))
  573. X    return 6;
  574. X
  575. X  if (!strcmp(s,"jul")
  576. X      || !strcmp(s,"jul.")
  577. X      || !strcmp(s,"vii")
  578. X      || !strcmp(s,"july"))
  579. X    return 7;
  580. X
  581. X  if (!strcmp(s,"aug")
  582. X      || !strcmp(s,"aug.")
  583. X      || !strcmp(s,"viii")
  584. X      || !strcmp(s,"august"))
  585. X    return 8;
  586. X
  587. X  if (!strcmp(s,"sep")
  588. X      || !strcmp(s,"sep.")
  589. X      || !strcmp(s,"ix")
  590. X      || !strcmp(s,"september"))
  591. X    return 9;
  592. X
  593. X  if (!strcmp(s,"oct")
  594. X      || !strcmp(s,"oct.")
  595. X      || !strcmp(s,"x")
  596. X      || !strcmp(s,"october"))
  597. X    return 10;
  598. X
  599. X  if (!strcmp(s,"nov")
  600. X      || !strcmp(s,"nov.")
  601. X      || !strcmp(s,"xi")
  602. X      || !strcmp(s,"november"))
  603. X    return 11;
  604. X
  605. X  if (!strcmp(s,"dec")
  606. X      || !strcmp(s,"dec.")
  607. X      || !strcmp(s,"xii")
  608. X      || !strcmp(s,"december"))
  609. X    return 12;
  610. X
  611. X  return atoi(s);
  612. X}
  613. X
  614. END_OF_FILE
  615. if test 6401 -ne `wc -c <'observe/datelib.c'`; then
  616.     echo shar: \"'observe/datelib.c'\" unpacked with wrong size!
  617. fi
  618. # end of 'observe/datelib.c'
  619. fi
  620. if test -f 'observe/observe.h' -a "${1}" != "-c" ; then 
  621.   echo shar: Will not clobber existing file \"'observe/observe.h'\"
  622. else
  623. echo shar: Extracting \"'observe/observe.h'\" \(6607 characters\)
  624. sed "s/^X//" >'observe/observe.h' <<'END_OF_FILE'
  625. X/*
  626. X * observe.h
  627. X * Types etc. needed for observe program
  628. X *
  629. X * Copyright (c) 1990 by Craig Counterman. All rights reserved.
  630. X *
  631. X * This software may be redistributed freely, not sold.
  632. X * This copyright notice and disclaimer of warranty must remain
  633. X *    unchanged. 
  634. X *
  635. X * No representation is made about the suitability of this
  636. X * software for any purpose.  It is provided "as is" without express or
  637. X * implied warranty, to the extent permitted by applicable law.
  638. X *
  639. X */
  640. X/*
  641. X * $Header: observe.h,v 1.7 90/02/19 17:22:04 ccount Exp $
  642. X */
  643. X
  644. X
  645. Xtypedef enum {
  646. X  rise, rise_20, rise_30, transit, set_30, set_20, set, special, nothing
  647. X} event_t;
  648. X#define MAXEVENTS 7
  649. X/* order is RISE = 0 to SET = 6 with TRANSIT = 3 */
  650. X
  651. Xtypedef enum {
  652. X  rise_special, set_special, morning_twilight, evening_twilight, not_special
  653. X} special_event_t;
  654. X
  655. Xtypedef struct {
  656. X  double hour;            /* of event */
  657. X  char *object;            /* event is happening to */
  658. X  event_t event;
  659. X  special_event_t special;
  660. X                /* sun or moon rise or set,
  661. X                   twilight */
  662. X} observe_t;
  663. X
  664. Xtypedef enum {
  665. X  planet_orbit,            /* Planet */
  666. X  elliptical_orbit,        /* Elliptical Orbit */
  667. X  parabolic_orbit,        /* Parabolic Orbit */
  668. X  tabulated,            /* Tabulated */
  669. X  no_orbit
  670. X} orbtype_t;
  671. X
  672. Xtypedef enum {
  673. X  asteroid,
  674. X  comet,
  675. X  no_type
  676. X} bodytype_t;
  677. X
  678. Xtypedef struct {
  679. X  double epoch_jd;
  680. X  double equinox_year;
  681. X  double a;            /* semimajor axis, A.U. */
  682. X  double e;            /* eccentricity */
  683. X  double i;            /* inclination (degrees) */
  684. X  double omega;            /* argument of perihelion */
  685. X  double Omega;            /* longitude of ascending node */
  686. X  double n;            /* mean motion (degrees/day) */
  687. X  double M;            /* Mean anomaly at epoch */
  688. X} elliptical_elements_t;
  689. X
  690. Xtypedef struct {
  691. X  double perihelion_date;    /* Time of passage in perihelion */
  692. X  double equinox_year;
  693. X  double q;            /* perihelion distance, A.U. */
  694. X  double i;            /* inclination (degrees) */
  695. X  double omega;            /* argument of perihelion */
  696. X  double Omega;            /* longitude of ascending node */
  697. X} parabolic_elements_t;
  698. X
  699. X
  700. Xtypedef struct {
  701. X  double beta_e;        /* planetocentric declination of Earth */
  702. X  double p_n;            /* Position angle of the axis,
  703. X                   measured east from north */
  704. X  double lambda_e;        /* planetographic longitude of the central
  705. X                   meridian, measured in the direction
  706. X                   opposite to the dir. of rotation */
  707. X} rotation_elements_t;
  708. X
  709. Xtypedef struct {
  710. X  char *name;
  711. X  char *type;
  712. X  char *color;
  713. X  double alpha, delta;        /* position in equinox of date */
  714. X  double alpha2000, delta2000;    /* position in equinox 2000.0 */
  715. X  double l, b;            /* ecliptical longitude and latitude */
  716. X  double lambda, beta;        /* geocentric longitude and latitude */
  717. X  double Cen;            /* Center */
  718. X  double psi;            /* elongation */
  719. X  double r, Delta;        /* Distance to sun, and earth */
  720. X  double mag, phase, size;    /* magnitude, phase (degrees) size (arcsec) */
  721. X  double illum_frac;        /* illuminated fraction of disk */
  722. X  double chi;            /* position angle of bright limb */
  723. X  rotation_elements_t rotation_elements;
  724. X                /* beta_e, p_n, lambda_e */
  725. X  observe_t eventlist[MAXEVENTS]; /* events: rise, set, etc. */
  726. X  double rise_hour, set_hour, transit_hour;
  727. X                /* times of these events */
  728. X} planet_data_t;
  729. X
  730. Xtypedef struct {
  731. X  char *name;
  732. X  double alpha, delta;        /* position in equinox of date */
  733. X  double alpha2000, delta2000;    /* position in equinox 2000.0 */
  734. X  double beta;            /* Phase angle */
  735. X  double psi;            /* Elongation */
  736. X  double r, Delta;        /* Distance to sun, and earth */
  737. X  double mag;            /* magnitude */
  738. X  orbtype_t orbit_type;        /* Orbit type */
  739. X  elliptical_elements_t elliptical_elements;
  740. X  parabolic_elements_t parabolic_elements;
  741. X  bodytype_t body_type;        /* Body type: asteroid or comet */
  742. X  double H, G;            /* Magnitude of asteroid */
  743. X  double g, kappa;        /* Magnitude of a comet */
  744. X  observe_t eventlist[MAXEVENTS]; /* events: rise, set, etc. */
  745. X  double rise_hour, set_hour, transit_hour;
  746. X                /* times of these events */
  747. X} wanderer_data_t;
  748. X
  749. Xtypedef struct {
  750. X  char *name;
  751. X  double alpha, delta;        /* position in equinox of date */
  752. X  double alpha2000, delta2000;    /* position in equinox 2000.0 */
  753. X  double R, Theta;        /* Distance to earth, Theta equinox of date */
  754. X  double size;            /* size (arcsec) */
  755. X  double rise_hour, set_hour, transit_hour;
  756. X                /* times of these events */
  757. X} sun_data_t;
  758. X
  759. Xtypedef struct {
  760. X  char *name;
  761. X  double alpha, delta;        /* position in equinox of date */
  762. X  double alpha2000, delta2000;    /* position in equinox 2000.0 */
  763. X  double lambda, beta, moon_pi;    /* geocentric longitude and latitude
  764. X                   and horizontal parallax */
  765. X  double Delta;            /* Distance to earth (km) */
  766. X  double mag, phase, size;    /* magnitude, phase (degrees) size (arcsec) */
  767. X  double illum_frac;        /* illuminated fraction */
  768. X  double chi;            /* position angle of bright limb */
  769. X  double rise_hour, set_hour, transit_hour;
  770. X                /* times of these events */
  771. X} moon_data_t;
  772. X
  773. X
  774. Xtypedef struct {
  775. X  char *name;
  776. X  char type[3];
  777. X  double alpha, delta;        /* position in original equinox */
  778. X  double equinox;
  779. X  double alpha2000, delta2000;    /* position in equinox 2000.0 */
  780. X  double mag;
  781. X  double size;
  782. X  observe_t eventlist[MAXEVENTS]; /* events: rise, set, etc. */
  783. X  double rise_hour, set_hour, transit_hour;
  784. X                /* times of these events */
  785. X} obj_data_t;
  786. X
  787. X
  788. Xtypedef enum {
  789. X  emp,                /* Eph. Minor Planet */
  790. X  empb,                /* Eph. Minor Planet, bright */
  791. X  aa,                /* Astro. Alman */
  792. X  st,                /* Sky and Telescope */
  793. X  iau,                /* IAU circular */
  794. X  ell_e,            /* Elliptical Orbital elements:
  795. X                   Calculate ephemeris */
  796. X  par_e,            /* Parabolic Orbital elements:
  797. X                   Calculate ephemeris */
  798. X  obj,                /* Fixed object */
  799. X  no_format
  800. X} fformat_t;
  801. X
  802. X
  803. Xtypedef struct {
  804. X  double dx, dy, dz;        /* relative to planet,
  805. X                   units of equatorial radius */
  806. X  double dalpha, ddelta;    /* displacements in RA and dec. */
  807. X  double mag;
  808. X  char *name;
  809. X} sat_t;
  810. X
  811. X
  812. X/* functions */
  813. Xvoid precess();
  814. Xvoid anom_calc();
  815. Xdouble gmst0_degrees();
  816. Xvoid read_elliptical(), elliptical_pos();
  817. Xvoid read_parabolic(), parabolic_pos();
  818. Xvoid read_table(), tabulated_pos();
  819. Xvoid read_objects(), obj_pos();
  820. Xvoid calc_events(), add_events();
  821. Xvoid get_time();
  822. Xdouble now_zone();
  823. Xint now_year();
  824. Xvoid planet_pos(), moon_pos(), sun_pos();
  825. Xvoid out_obs(), out_eph(), out_sat(), out_sat_end();
  826. Xvoid out_sif(), out_sif_planet(), out_sif_body(),
  827. X  out_sif_sun(), out_sif_moon();
  828. Xvoid HeapSort(), HeapSort0();
  829. Xdouble obl_jd(), obl_year();
  830. Xvoid sun_rect();
  831. Xdouble into_range();
  832. X
  833. Xdouble sunrise(), suntransit(), sunset(), moonrise(), moontransit(), moonset(),
  834. X  morntwil(), evetwil(),
  835. X  objrise(), objrise20(), objrise30(), objtransit(),
  836. X  objset30(), objset20(), objset();
  837. X  
  838. X
  839. X/* put here for VMS and pure-ANSI systems */
  840. Xdouble atof();
  841. END_OF_FILE
  842. if test 6607 -ne `wc -c <'observe/observe.h'`; then
  843.     echo shar: \"'observe/observe.h'\" unpacked with wrong size!
  844. fi
  845. # end of 'observe/observe.h'
  846. fi
  847. if test -f 'observe/satcalc.c' -a "${1}" != "-c" ; then 
  848.   echo shar: Will not clobber existing file \"'observe/satcalc.c'\"
  849. else
  850. echo shar: Extracting \"'observe/satcalc.c'\" \(8494 characters\)
  851. sed "s/^X//" >'observe/satcalc.c' <<'END_OF_FILE'
  852. X/*
  853. X * satcalc.c
  854. X * jupiter and saturn satellites positions
  855. X *
  856. X * Copyright (c) 1990 by Craig Counterman. All rights reserved.
  857. X *
  858. X * This software may be redistributed freely, not sold.
  859. X * This copyright notice and disclaimer of warranty must remain
  860. X *    unchanged. 
  861. X *
  862. X * No representation is made about the suitability of this
  863. X * software for any purpose.  It is provided "as is" without express or
  864. X * implied warranty, to the extent permitted by applicable law.
  865. X *
  866. X */
  867. X
  868. X#ifndef  lint
  869. Xstatic char rcsid[] =
  870. X  "$Header: satcalc.c,v 1.6 90/02/19 17:21:38 ccount Exp $";
  871. X#endif
  872. X
  873. X#include <math.h>
  874. X
  875. X#include "observe.h"
  876. X#include "degree.h"
  877. X
  878. X/* given jd, return sat_t list of gallilean satellites */
  879. Xvoid jupsat(jd, jupiter, sats)
  880. X     double jd;
  881. X     planet_data_t jupiter;
  882. X     sat_t sats[4];
  883. X{
  884. X  double d;            /* modified julian date */
  885. X  double V;            /* long period term of Jupiter */
  886. X  double M;            /* mean anomaly of earth */
  887. X  double N;            /* mean anomaly of Jupiter */
  888. X  double J;            /* differance in heliocentric longitude */
  889. X  double A;            /* Center of earth */
  890. X  double B;            /* Center of jupiter */
  891. X  double K;
  892. X  double R;            /* Radius vector of earth */
  893. X  double r;            /* Radius vector of jupiter */
  894. X  double Delta;            /* Distance from earth to jupiter */
  895. X  double psi;            /* Phase angle */
  896. X  double alpha, delta;        /* Position of jupiter at equinox of date */
  897. X  double D_e;            /* == beta_e, planetocentric declination of earth */
  898. X  double u_1, u_2, u_3, u_4;    /* angle */
  899. X  double G, H;            /* correction terms */
  900. X  double cor_u_1, cor_u_2, cor_u_3, cor_u_4; /* Corrections to u_ */
  901. X  double r_1, r_2, r_3, r_4;    /* distance to center of Jupiter (radii) */
  902. X  double X_1, X_2, X_3, X_4;    /* relative Positions (radii) */
  903. X  double Y_1, Y_2, Y_3, Y_4;    /* relative Positions (radii) */
  904. X  double Z_1, Z_2, Z_3, Z_4;    /* relative Positions (radii) */
  905. X  double X, Y;
  906. X  double dmag;
  907. X
  908. X  d = jd - 2415020.0;
  909. X
  910. X  alpha = jupiter.alpha;
  911. X  delta = jupiter.delta;
  912. X
  913. X  Delta = jupiter.Delta;
  914. X  psi = jupiter.phase;
  915. X  B = jupiter.Cen;
  916. X
  917. X  D_e = jupiter.rotation_elements.beta_e;
  918. X
  919. X  u_1 = 84.5506 + 203.4058630 * (d - Delta * 0.00577167643528) + psi - B;
  920. X  u_2 = 41.5015 + 101.2916323 * (d - Delta * 0.00577167643528) + psi - B;
  921. X  u_3 = 109.9770 + 50.2345169 * (d - Delta * 0.00577167643528) + psi - B;
  922. X  u_4 = 176.3586 + 21.4879802 * (d - Delta * 0.00577167643528) + psi - B;
  923. X
  924. X  u_1 = into_range(u_1);
  925. X  u_2 = into_range(u_2);
  926. X  u_3 = into_range(u_3);
  927. X  u_4 = into_range(u_4);
  928. X
  929. X
  930. X  G = 187.3 + 50.310674 * (d - Delta * 0.00577167643528);
  931. X  H = 311.1 + 21.569229 * (d - Delta * 0.00577167643528);
  932. X  
  933. X  cor_u_1 =  0.472 * DSIN(2*(u_1 - u_2));
  934. X  cor_u_2 =  1.073 * DSIN(2*(u_2 - u_3));
  935. X  cor_u_3 =  0.174 * DSIN(G);
  936. X  cor_u_4 =  0.845 * DSIN(H);
  937. X  
  938. X  r_1 = 5.9061 - 0.0244 * DCOS(2*(u_1 - u_2));
  939. X  r_2 = 9.3972 - 0.0889 * DCOS(2*(u_2 - u_3));
  940. X  r_3 = 14.9894 - 0.0227 * DCOS(G);
  941. X  r_4 = 26.3649 - 0.1944 * DCOS(H);
  942. X  
  943. X  X_1 = r_1 * DSIN(u_1 + cor_u_1);
  944. X  X_2 = r_2 * DSIN(u_2 + cor_u_2);
  945. X  X_3 = r_3 * DSIN(u_3 + cor_u_3);
  946. X  X_4 = r_4 * DSIN(u_4 + cor_u_4);
  947. X
  948. X  Z_1 = r_1 * DCOS(u_1 + cor_u_1);
  949. X  Z_2 = r_2 * DCOS(u_2 + cor_u_2);
  950. X  Z_3 = r_3 * DCOS(u_3 + cor_u_3);
  951. X  Z_4 = r_4 * DCOS(u_4 + cor_u_4);
  952. X  
  953. X  Y_1 = - r_1 * DCOS(u_1 + cor_u_1) * DSIN(D_e);
  954. X  Y_2 = - r_2 * DCOS(u_2 + cor_u_2) * DSIN(D_e);
  955. X  Y_3 = - r_3 * DCOS(u_3 + cor_u_3) * DSIN(D_e);
  956. X  Y_4 = - r_4 * DCOS(u_4 + cor_u_4) * DSIN(D_e);
  957. X
  958. X  dmag = 5.0 * log10(jupiter.r*jupiter.Delta)
  959. X    - 2.5 * log10(jupiter.illum_frac);
  960. X
  961. X  sats[0].dx = X_1;
  962. X  sats[0].dy = Y_1;
  963. X  sats[0].dz = Z_1;
  964. X  X = -X_1*jupiter.size/2.0;
  965. X  Y = Y_1*jupiter.size/2.0;
  966. X  sats[0].dalpha = X * DCOS(jupiter.rotation_elements.p_n)
  967. X      + Y * DSIN(jupiter.rotation_elements.p_n);
  968. X  sats[0].dalpha /= DCOS(jupiter.delta);
  969. X  sats[0].ddelta = -X * DSIN(jupiter.rotation_elements.p_n)
  970. X    + Y * DCOS(jupiter.rotation_elements.p_n);
  971. X  sats[0].name = "Io";
  972. X  sats[0].mag = -1.68 + dmag;
  973. X  
  974. X  sats[1].dx = X_2;
  975. X  sats[1].dy = Y_2;
  976. X  sats[1].dz = Z_2;
  977. X  X = -X_2*jupiter.size/2.0;
  978. X  Y = Y_2*jupiter.size/2.0;
  979. X  sats[1].dalpha = X * DCOS(jupiter.rotation_elements.p_n)
  980. X      + Y * DSIN(jupiter.rotation_elements.p_n);
  981. X  sats[1].dalpha /= DCOS(jupiter.delta);
  982. X  sats[1].ddelta = -X * DSIN(jupiter.rotation_elements.p_n)
  983. X    + Y * DCOS(jupiter.rotation_elements.p_n);
  984. X  sats[1].name = "Europa";
  985. X  sats[1].mag = -1.41 + dmag;
  986. X  
  987. X  sats[2].dx = X_3;
  988. X  sats[2].dy = Y_3;
  989. X  sats[2].dz = Z_3;
  990. X  X = -X_3*jupiter.size/2.0;
  991. X  Y = Y_3*jupiter.size/2.0;
  992. X  sats[2].dalpha = X * DCOS(jupiter.rotation_elements.p_n)
  993. X      + Y * DSIN(jupiter.rotation_elements.p_n);
  994. X  sats[2].dalpha /= DCOS(jupiter.delta);
  995. X  sats[2].ddelta = -X * DSIN(jupiter.rotation_elements.p_n)
  996. X    + Y * DCOS(jupiter.rotation_elements.p_n);
  997. X  sats[2].name = "Ganymede";
  998. X  sats[2].mag = -2.09 + dmag;
  999. X  
  1000. X  sats[3].dx = X_4;
  1001. X  sats[3].dy = Y_4;
  1002. X  sats[3].dz = Z_4;
  1003. X  X = -X_4*jupiter.size/2.0;
  1004. X  Y = Y_4*jupiter.size/2.0;
  1005. X  sats[3].dalpha = X * DCOS(jupiter.rotation_elements.p_n)
  1006. X      + Y * DSIN(jupiter.rotation_elements.p_n);
  1007. X  sats[3].dalpha /= DCOS(jupiter.delta);
  1008. X  sats[3].ddelta = -X * DSIN(jupiter.rotation_elements.p_n)
  1009. X    + Y * DCOS(jupiter.rotation_elements.p_n);
  1010. X  sats[3].name = "Callisto";
  1011. X  sats[3].mag = -1.05 + dmag;
  1012. X}
  1013. X/* siderial Periods of satellites:
  1014. X 0.942421813
  1015. X 1.370217855
  1016. X 1.887802160
  1017. X 2.736914742
  1018. X 4.517500436
  1019. X15.94542068
  1020. X21.2766088
  1021. X79.3301825
  1022. X
  1023. Xsynodic (approx)
  1024. X 0.94250436287643326
  1025. X 1.3703923657888438
  1026. X 1.8881334260185879
  1027. X 2.7376110810451278
  1028. X 4.519397869256954
  1029. X 15.969085530060568
  1030. X 21.318764097751611
  1031. X 79.919403771981642
  1032. X
  1033. Xsemimajor axes
  1034. X185.52
  1035. X238.02
  1036. X294.66
  1037. X377.40
  1038. X527.04
  1039. X1221.83
  1040. X1481.1
  1041. X3561.3
  1042. X*/
  1043. X
  1044. Xstatic struct {
  1045. X  double off; /* angle of satellite at jd 2415020.0 */
  1046. X  double angvel; /* anbular velocity, degrees per day */
  1047. X  double r; /* Distance to saturn in saturn radii */
  1048. X  double mag; /* V(1,0) */
  1049. X  char *name; /* Name */
  1050. X} satsat_data[] = {
  1051. X  {49.0, 381.96109660576467, 3.092, 3.3, "Mimas"},
  1052. X  {98.7, 262.69848620527883, 3.967, 2.1, "Enceladus"},
  1053. X  {263.0, 190.66449173515979, 4.911, 0.6, "Tethys"},
  1054. X  {101.3, 131.50151330574105, 6.290, 0.8, "Dione"},
  1055. X  {11.2, 79.656629138338852, 8.784, 0.1, "Rhea"},
  1056. X  {183.7, 22.543557633424146, 20.364, -1.28, "Titan"},
  1057. X  {95.0, 16.886532368823739, 24.685, 4.63, "Hyperion"},
  1058. X  {338.4, 4.5045381097576426, 59.355, 1.5, "Iapetus"}
  1059. X};
  1060. X
  1061. X
  1062. X/* given jd, return sat_t list of major satellites of Saturn */
  1063. X/* Ignore many corrections to Saturn's orbit,
  1064. X   assume moons in circular orbits in Saturn's equatorial plane */
  1065. Xvoid satsat(jd, saturn, sats)
  1066. X     double jd;
  1067. X     planet_data_t saturn;
  1068. X     sat_t sats[8];
  1069. X{
  1070. X  double d;            /* modified julian date */
  1071. X  double M;            /* mean anomaly of earth */
  1072. X  double N;            /* mean anomaly of Saturn */
  1073. X  double J;            /* differance in heliocentric longitude */
  1074. X  double A;            /* Center of earth */
  1075. X  double B;            /* Center of saturn */
  1076. X  double K;
  1077. X  double R;            /* Radius vector of earth */
  1078. X  double r;            /* Radius vector of Saturn */
  1079. X  double Delta;            /* Distance from earth to Saturn */
  1080. X  double psi;            /* Phase angle */
  1081. X  double alpha, delta;        /* Position of Saturn at equinox of date */
  1082. X  double D_e;            /* == beta_e, planetocentric declination of earth */
  1083. X  double u[8];            /* angle */
  1084. X  double X[8];            /* relative Positions (radii) */
  1085. X  double Y[8];            /* relative Positions (radii) */
  1086. X  double Z[8];            /* relative Positions (radii) */
  1087. X  double dmag;
  1088. X  int i;
  1089. X  double x, y;
  1090. X
  1091. X  d = jd - 2415020.0;
  1092. X
  1093. X  alpha = saturn.alpha;
  1094. X  delta = saturn.delta;
  1095. X
  1096. X  Delta = saturn.Delta;
  1097. X  psi = saturn.phase;
  1098. X  B = saturn.Cen;
  1099. X
  1100. X  /* Position of Saturn at equinox of date */
  1101. X  D_e = saturn.rotation_elements.beta_e;
  1102. X
  1103. X  dmag = 5.0 * log10(saturn.r*saturn.Delta)
  1104. X    - 2.5 * log10(saturn.illum_frac);
  1105. X
  1106. X  for (i = 0; i < 8; i++) {
  1107. X    u[i] = satsat_data[i].off
  1108. X      + satsat_data[i].angvel * (d - Delta * 0.00577167643528) + psi - B;
  1109. X
  1110. X    u[i] = into_range(u[i]);
  1111. X
  1112. X    X[i] = satsat_data[i].r * DSIN(u[i]);
  1113. X    Z[i] = satsat_data[i].r * DCOS(u[i]);
  1114. X    Y[i] = - satsat_data[i].r * DCOS(u[i]) * DSIN(D_e);
  1115. X
  1116. X    sats[i].dx = X[i];
  1117. X    sats[i].dy = Y[i];
  1118. X    sats[i].dz = Z[i];
  1119. X    x = -X[i]*saturn.size/2.0;
  1120. X    y = Y[i]*saturn.size/2.0;
  1121. X
  1122. X    sats[i].dalpha = x * DCOS(saturn.rotation_elements.p_n)
  1123. X      + y * DSIN(saturn.rotation_elements.p_n);
  1124. X    sats[i].dalpha /= DCOS(saturn.delta);
  1125. X    sats[i].ddelta = -x * DSIN(saturn.rotation_elements.p_n)
  1126. X      + y * DCOS(saturn.rotation_elements.p_n);
  1127. X    sats[i].name = satsat_data[i].name;
  1128. X    sats[i].mag = satsat_data[i].mag + dmag;
  1129. X/*printf("%d: %f %f\n", i, u[i], into_range(270 - u[i]));*/
  1130. X  };
  1131. X}
  1132. X  
  1133. X  
  1134. X  
  1135. X  
  1136. END_OF_FILE
  1137. if test 8494 -ne `wc -c <'observe/satcalc.c'`; then
  1138.     echo shar: \"'observe/satcalc.c'\" unpacked with wrong size!
  1139. fi
  1140. # end of 'observe/satcalc.c'
  1141. fi
  1142. if test -f 'starchart/interact.c' -a "${1}" != "-c" ; then 
  1143.   echo shar: Will not clobber existing file \"'starchart/interact.c'\"
  1144. else
  1145. echo shar: Extracting \"'starchart/interact.c'\" \(6247 characters\)
  1146. sed "s/^X//" >'starchart/interact.c' <<'END_OF_FILE'
  1147. X/*
  1148. X * User Interaction subroutines
  1149. X * 
  1150. X * 
  1151. X *
  1152. X * Copyright (c) 1990 by Craig Counterman. All rights reserved.
  1153. X *
  1154. X * This software may be redistributed freely, not sold.
  1155. X * This copyright notice and disclaimer of warranty must remain
  1156. X *    unchanged. 
  1157. X *
  1158. X * No representation is made about the suitability of this
  1159. X * software for any purpose.  It is provided "as is" without express or
  1160. X * implied warranty, to the extent permitted by applicable law.
  1161. X *
  1162. X */
  1163. X
  1164. Xstatic char rcsid[]="$Header: interact.c,v 1.7 90/03/10 15:33:02 ccount Exp $";
  1165. X
  1166. X#include <stdio.h>
  1167. X#include <math.h>
  1168. X
  1169. X#include "star3.h"
  1170. X#include "parse_input.h"
  1171. X#include "patchlevel.h"
  1172. X
  1173. X#define OPENFAIL 0
  1174. X#define LINELEN 82
  1175. X
  1176. X
  1177. X/* Externs */
  1178. Xextern int g_argc;
  1179. Xextern char **g_argv;
  1180. X
  1181. Xextern char *title;
  1182. X
  1183. X/* From starchart.c */
  1184. Xextern int user_interact;
  1185. X
  1186. Xextern double ra, de, sc;
  1187. Xextern double all_lbllim, all_maglim, all_gklim;
  1188. Xextern int use_lbllim, use_maglim, use_gklim;
  1189. X
  1190. Xextern double all_vmin, all_vmax;
  1191. Xextern int use_vmin;
  1192. Xextern int nomaglbls;
  1193. X
  1194. Xextern double all_rstep, all_dstep;
  1195. Xextern int use_rstep;
  1196. Xextern double all_rstrt, all_dstrt;
  1197. Xextern int no_ra_grid;
  1198. Xextern int no_dec_grid;
  1199. X
  1200. Xextern int all_invert;
  1201. X
  1202. Xextern int chart_type;
  1203. X
  1204. Xextern int all_proj_mode;
  1205. X
  1206. Xextern char *rcfile;
  1207. X
  1208. Xextern char *constfile;
  1209. Xextern char *boundfile;
  1210. Xextern char boundftype;
  1211. Xextern char *patternfile;
  1212. Xextern char pattftype;
  1213. Xextern char *cnamefile;
  1214. Xextern char cnameftype;
  1215. Xextern char *mapfiles[];
  1216. Xextern int mapftypes[];
  1217. Xextern int nummapfiles;
  1218. X
  1219. Xextern mapwindow *mapwin[];
  1220. Xextern int numwins;
  1221. X
  1222. Xextern int cur_function;
  1223. Xextern int cur_map_type;
  1224. Xextern int cur_map_tag;
  1225. Xextern char *cur_tag_field;
  1226. Xextern char *cur_file_name;
  1227. X
  1228. Xextern int read_mapwin_file;
  1229. Xextern int write_mapwin_file;
  1230. Xextern char mapwin_file[];
  1231. X
  1232. X
  1233. Xextern int all_layer[MAXLAYRS];
  1234. Xextern int numlayers;
  1235. X
  1236. X/* storage area big enough for inputs */
  1237. X#ifndef MAXPATHLEN
  1238. X#define MAXPATHLEN 1025
  1239. X#endif
  1240. Xextern char a_title[];
  1241. Xextern char a_starfile[];
  1242. Xextern char a_indexfile[];
  1243. Xextern char a_planetfile[];
  1244. Xextern char a_nebfile[];
  1245. Xextern char a_constfile[];
  1246. Xextern char a_boundfile[];
  1247. Xextern char a_patternfile[];
  1248. Xextern char a_cnamefile[];
  1249. Xextern char a_userfile[][MAXPATHLEN];
  1250. X
  1251. X/* local similar buffers */
  1252. Xchar a_constname[MAXPATHLEN];
  1253. Xchar a_rcfile[MAXPATHLEN];
  1254. Xchar *a_mapfile[MAXMAPFILES];
  1255. Xchar a_mapftypes[MAXMAPFILES][MAXPATHLEN];
  1256. X
  1257. X
  1258. X
  1259. X/* Scale multiplier, minimum,
  1260. X   mangitude change, maximum, for thumbnail */
  1261. X#define THSMUL 1.2
  1262. X#define THSMIN 12.0
  1263. X#define THMADJ 2.5
  1264. X#define THMMAX 8.0
  1265. X
  1266. Xextern mapwindow fullpage, mainmap, thumbmap;
  1267. X
  1268. X
  1269. X/* Adapted from code from Dean Payne deanp@hplsla.hp.com */
  1270. X/* Format of each line is
  1271. X    variable_name variable_value
  1272. Xor    variable_name=variable_value
  1273. X
  1274. Xvariable_value may be a string which extends to the end of line.
  1275. XLines must be 80 chars max.
  1276. XComments are anything after a #
  1277. XBlank lines are allowed.
  1278. X*/
  1279. XD_userinput()
  1280. X{
  1281. X  char sbuf[LINELEN], *var_name, *c_buf;
  1282. X  double f_buf;    /* value parsed as double */
  1283. X  int i_buf;    /* value parsed as integer */
  1284. X  int l_buf;    /* value parsed as TRUE or FALSE */
  1285. X  int ret_code, var_type;
  1286. X  static int first_time = TRUE; 
  1287. X  static int printed_notice = FALSE;
  1288. X
  1289. X    if (!user_interact)
  1290. X      if (first_time) {
  1291. X    first_time = FALSE;
  1292. X    return TRUE;
  1293. X      } else return FALSE;    /* If we don't really want user interaction,
  1294. X                   i.e. -u wasn't used,
  1295. X                   only do the main loop once */
  1296. X
  1297. X  if (!printed_notice) {
  1298. X    printf("Starchart Version %s, patchlevel %s\n", VERSION_STRING,
  1299. X       PATCHLEVEL_STRING);
  1300. X    printf(
  1301. X    "This is a copyrighted program, however the source is freely available\n");
  1302. X    printf("and freely redistributable for noncommercial use.\n");
  1303. X    printf("Distributed 'as is', with no warranty.\n\n\n");
  1304. X    printed_notice = TRUE;
  1305. X  };
  1306. X
  1307. X
  1308. X  printf("Please type your commands:\n");
  1309. X  for (;;) {
  1310. X    fgets(sbuf, LINELEN, stdin);
  1311. X    if (ferror(stdin)) { fprintf(stderr, "file read error \n"); break; }
  1312. X    if (feof(stdin)) return TRUE;
  1313. X
  1314. X
  1315. X    if (!parse_line(sbuf, &var_name, &ret_code, &var_type,
  1316. X            &c_buf, &f_buf, &i_buf, &l_buf)) {
  1317. X      /* Not recognized by parse routine,
  1318. X     see if ident_rc can recognize it */
  1319. X      if (!(ident_rc(var_name, c_buf))) {
  1320. X    fprintf(stderr, "cannot interpret '%s = %s'\n", var_name, c_buf);
  1321. X    help_vars(var_name);
  1322. X      }
  1323. X    } else
  1324. X      switch (ret_code) {
  1325. X      case TINT:
  1326. X    fprintf(stderr, "int = %d\n", i_buf);
  1327. X    fprintf(stderr, "i_buf = %d\n", i_buf);
  1328. X    fprintf(stderr, "f_buf = %f\n", f_buf);
  1329. X    fprintf(stderr, "l_buf = %d\n", l_buf);
  1330. X    fprintf(stderr, "c_buf = %s\n", c_buf);
  1331. X    break;
  1332. X      case TFLO:
  1333. X    fprintf(stderr, "flo = %f\n", f_buf);
  1334. X    fprintf(stderr, "i_buf = %d\n", i_buf);
  1335. X    fprintf(stderr, "f_buf = %f\n", f_buf);
  1336. X    fprintf(stderr, "l_buf = %d\n", l_buf);
  1337. X    fprintf(stderr, "c_buf = %s\n", c_buf);
  1338. X    break;
  1339. X      case TBOOL:
  1340. X    fprintf(stderr, "bool = %d\n", l_buf);
  1341. X    fprintf(stderr, "i_buf = %d\n", i_buf);
  1342. X    fprintf(stderr, "f_buf = %f\n", f_buf);
  1343. X    fprintf(stderr, "l_buf = %d\n", l_buf);
  1344. X    fprintf(stderr, "c_buf = %s\n", c_buf);
  1345. X    break;
  1346. X      case TNONE:
  1347. X    fprintf(stderr, "none = %s\n", c_buf);
  1348. X    fprintf(stderr, "i_buf = %d\n", i_buf);
  1349. X    fprintf(stderr, "f_buf = %f\n", f_buf);
  1350. X    fprintf(stderr, "l_buf = %d\n", l_buf);
  1351. X    fprintf(stderr, "c_buf = %s\n", c_buf);
  1352. X    break;
  1353. X      case TCHAR:
  1354. X    fprintf(stderr, "char = %s\n", c_buf);
  1355. X    fprintf(stderr, "i_buf = %d\n", i_buf);
  1356. X    fprintf(stderr, "f_buf = %f\n", f_buf);
  1357. X    fprintf(stderr, "l_buf = %d\n", l_buf);
  1358. X    fprintf(stderr, "c_buf = %s\n", c_buf);
  1359. X    break;
  1360. X      case END_INPUT:
  1361. X    return TRUE;
  1362. X    break;
  1363. X      case EXIT:
  1364. X    exit(0);
  1365. X    break;
  1366. X      case HELP_ME:
  1367. X    help_vars("");
  1368. X    break;
  1369. X      case SHOW_ME:
  1370. X    rc_write(stderr);
  1371. X    break;
  1372. X      case WRITE_RC_FILE:
  1373. X    {
  1374. X      FILE *tfile;
  1375. X
  1376. X      if ((tfile = fopen(c_buf, "w")) != NULL)
  1377. X        if (rc_write(tfile)) {
  1378. X          fclose(tfile);
  1379. X          printf("wrote %s\n", c_buf);
  1380. X        };
  1381. X    };
  1382. X    break;
  1383. X      default:
  1384. X    /* Identified but not special to this routine,
  1385. X       try to set variables */
  1386. X    if (!set_varvals(var_name, ret_code, var_type,
  1387. X            c_buf, f_buf, i_buf, l_buf)) {
  1388. X      fprintf(stderr, "cannot interpret '%s = %s'\n", var_name, c_buf);
  1389. X      help_vars(var_name);
  1390. X    };
  1391. X    break;
  1392. X      };
  1393. X
  1394. X    /* Always call ident_rc */
  1395. X    ident_rc(var_name, c_buf);
  1396. X  }
  1397. X  
  1398. X  
  1399. X  return TRUE;
  1400. X}
  1401. X
  1402. XD_mapwininput()
  1403. X{
  1404. X  return TRUE;
  1405. X}
  1406. X
  1407. XD_break()
  1408. X{
  1409. X  return FALSE;
  1410. X}
  1411. X
  1412. END_OF_FILE
  1413. if test 6247 -ne `wc -c <'starchart/interact.c'`; then
  1414.     echo shar: \"'starchart/interact.c'\" unpacked with wrong size!
  1415. fi
  1416. # end of 'starchart/interact.c'
  1417. fi
  1418. if test -f 'starchart/starcust.c' -a "${1}" != "-c" ; then 
  1419.   echo shar: Will not clobber existing file \"'starchart/starcust.c'\"
  1420. else
  1421. echo shar: Extracting \"'starchart/starcust.c'\" \(8320 characters\)
  1422. sed "s/^X//" >'starchart/starcust.c' <<'END_OF_FILE'
  1423. X/*
  1424. X * Customizing functions
  1425. X */
  1426. X
  1427. X/*
  1428. X * Produced for starchart 3.0 by Craig Counterman Jan, 1989
  1429. X *
  1430. X * Copyright (c) 1989 by Craig Counterman
  1431. X * Portions Copyright (c) 1987 by Alan Paeth (awpaeth@watcgl)
  1432. X *
  1433. X * Copyright (c) 1990 by Craig Counterman. All rights reserved.
  1434. X *
  1435. X * This software may be redistributed freely, not sold.
  1436. X * This copyright notice and disclaimer of warranty must remain
  1437. X *    unchanged. 
  1438. X *
  1439. X * No representation is made about the suitability of this
  1440. X * software for any purpose.  It is provided "as is" without express or
  1441. X * implied warranty, to the extent permitted by applicable law.
  1442. X *
  1443. X */
  1444. X
  1445. X
  1446. Xstatic char rcsid[]="$Header: starcust.c,v 2.4 90/03/10 15:34:28 ccount Exp $";
  1447. X
  1448. X#include <stdio.h>
  1449. X#include <math.h>
  1450. X#ifndef SYSV
  1451. X#include <strings.h>
  1452. X#else
  1453. X#include <string.h>
  1454. X#endif
  1455. X
  1456. X#include "star3.h"
  1457. X
  1458. X#ifndef MAXPATHLEN
  1459. X#define MAXPATHLEN 1025
  1460. X#endif
  1461. X
  1462. X/* Externs */
  1463. Xextern int g_argc;
  1464. Xextern char **g_argv;
  1465. X
  1466. X
  1467. X/* title, mapwin, and numwins are the
  1468. X   mostly device independent specifications for the plot */
  1469. Xextern char *title;    /* Title of page */
  1470. X
  1471. Xextern mapwindow *mapwin[MAXWINDOWS];
  1472. Xextern int numwins;
  1473. X
  1474. X/*
  1475. Xmapwindow s_mapwin[MAXWINDOWS];
  1476. Xchar s_filenames[MAXWINDOWS][MAXMAPFILES][MAXPATHLEN];
  1477. Xchar s_tag_fields[MAXWINDOWS][81];
  1478. X*/
  1479. X
  1480. Xextern int cur_function;
  1481. Xextern int cur_map_type;
  1482. Xextern int cur_map_tag;
  1483. Xextern char *cur_tag_field;
  1484. X
  1485. Xextern int read_mapwin_file;
  1486. Xextern int write_mapwin_file;
  1487. Xextern char mapwin_file[];
  1488. X
  1489. X/* Set by initxform
  1490. X   One could use elements of the mapwindow structure,
  1491. X   but these should be faster for the current window */
  1492. Xextern int xproj_mode;
  1493. Xextern double xwest, xeast, xnorth, xsouth, xbot;
  1494. Xextern int cenx, ceny, strty;
  1495. Xextern double xracen, sindlcen, cosdlcen, chart_scale;
  1496. Xextern double yscale;
  1497. Xextern double xc_scale;
  1498. Xextern double inv_;
  1499. X
  1500. X/* Scale multiplier, minimum,
  1501. X   mangitude change, maximum, for thumbnail,*/
  1502. Xextern double th_smul;
  1503. Xextern double th_smin;
  1504. Xextern double th_madj;
  1505. Xextern double th_mmax;
  1506. X
  1507. X
  1508. X#define MAX(a,b) ((a)>(b)?(a):(b))
  1509. X#define MIN(a,b) ((a)<(b)?(a):(b))
  1510. X
  1511. Xchar *malloc();
  1512. X
  1513. X/* Other functions */
  1514. Xident_arg(argi)        /* argc and argv are already available as externs */ 
  1515. X     int *argi;        /* The argument which can't be understood */
  1516. X{
  1517. X  /*printf("Identify '%s' '%s'\n", g_argv[*argi], g_argv[*argi+1]);*/
  1518. X
  1519. X  return FALSE;
  1520. X}
  1521. X/* Return TRUE and increment argi if the argument has been interpreted.
  1522. X   Return FALSE if the argument is an error */
  1523. X
  1524. X
  1525. Xident_rc(var_name, var_val)
  1526. X     char *var_name, *var_val;
  1527. X{
  1528. X  /*printf("Identify '%s' '%s'\n", var_name, var_val);*/
  1529. X
  1530. X  return FALSE;
  1531. X}
  1532. X/* Return TRUE if the variable has been interpreted.
  1533. X   Return FALSE if the variable is an error */
  1534. X
  1535. X
  1536. X/* Do final adjustments before drawing begins */
  1537. Xfix_mapwin()
  1538. X{
  1539. X  int i, j;
  1540. X  FILE *mfile;
  1541. X
  1542. X  for (i = 0; i < numwins; i++) {
  1543. X    if (mapwin[i]->map_type == THUMBNAIL) {
  1544. X      /* No constellation names in thumbnail */
  1545. X      for (j =0; j < mapwin[i]->nlayers; j++) {
  1546. X    if (mapwin[i]->layer[j] == CONSTLNAMES)
  1547. X      mapwin[i]->layer[j] = SKIP;
  1548. X    if (mapwin[i]->layer[j] == LEGENDS)
  1549. X      mapwin[i]->layer[j] = SKIP;
  1550. X      }
  1551. X
  1552. X      /* No grids, don't invert */
  1553. X      mapwin[i]->draw_ragrid = FALSE;
  1554. X      mapwin[i]->draw_decgrid = FALSE;
  1555. X      mapwin[i]->invert = FALSE;
  1556. X
  1557. X      if ((mapwin[i]->proj_mode == STEREOGR) ||
  1558. X      (mapwin[i]->proj_mode == GNOMONIC) ||
  1559. X      (mapwin[i]->proj_mode == ORTHOGR)) {
  1560. X      /* If the parent map of this thumbnail map is stereographic,
  1561. X     gnomonic, or orthographic,
  1562. X     double the scale, for Sanson's projection */
  1563. X    mapwin[i]->scale *= 2.0;
  1564. X
  1565. X    if ((90.0 - fabs(mapwin[i]->dlcen)) < (mapwin[i]->scale/2.0)) {
  1566. X      /* pole is in map shouldn't draw this map */
  1567. X      if (i == (numwins-1)) numwins--;
  1568. X      else {
  1569. X        for (j = i; j < numwins; j++)
  1570. X          mapwin[j] = mapwin[i];
  1571. X        numwins--;
  1572. X      }
  1573. X    }
  1574. X      }
  1575. X
  1576. X
  1577. X
  1578. X      /* Thumbnail must be Sanson's */
  1579. X      mapwin[i]->proj_mode = SANSONS;
  1580. X
  1581. X
  1582. X      /* Do scale, mag adjustments for thumbnail */
  1583. X      mapwin[i]->scale = MAX(mapwin[i]->scale * th_smul, th_smin);
  1584. X
  1585. X      for (j =0; j < mapwin[i]->numfiles; j++) {
  1586. X    mapwin[i]->file[j].maglim =  MIN(th_mmax,
  1587. X                     mapwin[i]->maglim - th_madj);
  1588. X    mapwin[i]->file[j].lbllim = MIN(mapwin[i]->maglim,
  1589. X                    mapwin[i]->lbllim - th_madj);
  1590. X    mapwin[i]->file[j].gklim = MIN(mapwin[i]->maglim,
  1591. X                       mapwin[i]->gklim - th_madj);
  1592. X    mapwin[i]->file[j].draw_maglbl = FALSE;
  1593. X      }
  1594. X    }
  1595. X  }
  1596. X  
  1597. X  /* Read mapwin structures from mapwin file */
  1598. X  if ((read_mapwin_file)  && ((mfile = fopen(mapwin_file, "r")) != NULL)) {
  1599. X    read_mfile(mfile);
  1600. X    fclose(mfile);
  1601. X  }
  1602. X}
  1603. X
  1604. Xchar s_title[81];
  1605. X
  1606. Xread_mfile(mfile)
  1607. X     FILE *mfile;
  1608. X{
  1609. X  int i, j;
  1610. X  int n, o, p;
  1611. X  char line[300];
  1612. X  
  1613. X  /* Check tag on file as being mapwin format */
  1614. X  n = fscanf(mfile, "%[^\n]\n", line);
  1615. X  if (!strcmp(line,
  1616. X          "#mapwin format 1 file: don't edit this line or change order of lines in this file\n"))
  1617. X    return FALSE;
  1618. X
  1619. X  /* set mapwin pointer to real storage
  1620. X     set filename pointers and tag_field pointer to real storage */
  1621. X/*
  1622. X  for (i = 0; i < MAXWINDOWS; i++) {
  1623. X    mapwin[i] = &s_mapwin[i];
  1624. X    s_mapwin[i].tag_field = s_tag_fields[i];
  1625. X    for (j = 0; j < MAXMAPFILES; j++)
  1626. X      s_mapwin[i].file[j].name = s_filenames[i][j];
  1627. X  };
  1628. X*/
  1629. X
  1630. X  /* read the title */
  1631. X  fscanf(mfile, "title=%[^\n]\n", s_title);
  1632. X  title = s_title;
  1633. X
  1634. X  /* read number of mapwins */
  1635. X  fscanf(mfile, "numwins=%d\n", &numwins);
  1636. X  for (i = 0; i < numwins; i++) {
  1637. X    fscanf(mfile, "mapwin=%d\n",&n);
  1638. X    if (n != i) fprintf(stderr, "Error in mapwin file");
  1639. X    n = i;
  1640. X
  1641. X    /* Allocate space for this mapwin */
  1642. X    mapwin[n] = (mapwindow *) malloc(sizeof(mapwindow));
  1643. X    mapwin[n]->tag_field = (char *) malloc(MAXPATHLEN);
  1644. X    
  1645. X    fscanf(mfile, "width=%d\n", &(mapwin[n]->width));
  1646. X    fscanf(mfile, "height=%d\n", &(mapwin[n]->height));
  1647. X    fscanf(mfile, "x_offset=%d\n", &(mapwin[n]->x_offset));
  1648. X    fscanf(mfile, "y_offset=%d\n", &(mapwin[n]->y_offset));
  1649. X    
  1650. X    fscanf(mfile, "maglim=%lf\n", &(mapwin[n]->maglim));
  1651. X    fscanf(mfile, "lbllim=%lf\n", &(mapwin[n]->lbllim));
  1652. X    fscanf(mfile, "gklim=%lf\n", &(mapwin[n]->gklim));
  1653. X    
  1654. X    
  1655. X    fscanf(mfile, "map_type=%d\n", &(mapwin[n]->map_type));
  1656. X    
  1657. X    
  1658. X    fscanf(mfile, "tag=%d\n", &(mapwin[n]->tag));
  1659. X    
  1660. X    fscanf(mfile, "tag_field=%s\n", mapwin[n]->tag_field);
  1661. X    
  1662. X    
  1663. X    fscanf(mfile, "proj_mode=%d\n", &(mapwin[n]->proj_mode));
  1664. X    
  1665. X    
  1666. X    fscanf(mfile, "draw_ragrid=%d\n", &(mapwin[n]->draw_ragrid));
  1667. X    fscanf(mfile, "draw_decgrid=%d\n", &(mapwin[n]->draw_decgrid));
  1668. X    
  1669. X    fscanf(mfile, "ra_step=%lf\n", &(mapwin[n]->ra_step));
  1670. X    fscanf(mfile, "dec_step=%lf\n", &(mapwin[n]->dec_step));
  1671. X    
  1672. X    fscanf(mfile, "ra_strt=%lf\n", &(mapwin[n]->ra_strt));
  1673. X    fscanf(mfile, "dec_strt=%lf\n", &(mapwin[n]->dec_strt));
  1674. X    
  1675. X    
  1676. X    fscanf(mfile, "invert=%d\n", &(mapwin[n]->invert));
  1677. X    
  1678. X    fscanf(mfile, "racen=%lf\n", &(mapwin[n]->racen));
  1679. X    fscanf(mfile, "dlcen=%lf\n", &(mapwin[n]->dlcen));
  1680. X    fscanf(mfile, "scale=%lf\n", &(mapwin[n]->scale));
  1681. X    
  1682. X    fscanf(mfile, "c_scale=%lf\n", &(mapwin[n]->c_scale));
  1683. X    
  1684. X    fscanf(mfile, "nlayers=%d\n", &(mapwin[n]->nlayers));
  1685. X    for (j = 0; j < mapwin[n]->nlayers; j++) {
  1686. X      fscanf(mfile, "layer[%d] = %d\n", &o, &p);
  1687. X      mapwin[n]->layer[o] = p;
  1688. X    }
  1689. X    
  1690. X    fscanf(mfile, "numfiles=%d\n", &(mapwin[n]->numfiles));
  1691. X    for (j = 0; j < mapwin[n]->numfiles; j++) {
  1692. X      fscanf(mfile, "file=%d\n", &o);
  1693. X      if (o != j) fprintf(stderr, "Error in mapwin file");
  1694. X      o = j;
  1695. X
  1696. X      /* Allocate space for the file name */
  1697. X      mapwin[n]->file[o].name = (char *) malloc(MAXPATHLEN);
  1698. X
  1699. X
  1700. X      fscanf(mfile, "name=%s\n", (mapwin[n]->file[o].name));
  1701. X      fscanf(mfile, "type=%d\n", &(mapwin[n]->file[o].type));
  1702. X      fscanf(mfile, "maglim=%lf\n", &(mapwin[n]->file[o].maglim));
  1703. X      fscanf(mfile, "lbllim=%lf\n", &(mapwin[n]->file[o].lbllim));
  1704. X      fscanf(mfile, "gklim=%lf\n", &(mapwin[n]->file[o].gklim));
  1705. X      fscanf(mfile, "draw_maglbl=%d\n", &(mapwin[n]->file[o].draw_maglbl));
  1706. X      fscanf(mfile, "maglmin=%lf\n", &(mapwin[n]->file[o].maglmin));
  1707. X      fscanf(mfile, "maglmax=%lf\n", &(mapwin[n]->file[o].maglmax));
  1708. X    }
  1709. X  }
  1710. X  
  1711. X  /* Check tag on file as being mapwin format */
  1712. X  n = fscanf(mfile, "%[^\n]\n", line);
  1713. X  if (!strcmp(line,
  1714. X          "#mapwin format 1 file: don't edit this line or change order of lines in this file\n"))
  1715. X    return FALSE;
  1716. X  
  1717. X  return TRUE;
  1718. X}
  1719. X
  1720. END_OF_FILE
  1721. if test 8320 -ne `wc -c <'starchart/starcust.c'`; then
  1722.     echo shar: \"'starchart/starcust.c'\" unpacked with wrong size!
  1723. fi
  1724. # end of 'starchart/starcust.c'
  1725. fi
  1726. echo shar: End of archive 5 \(of 32\).
  1727. cp /dev/null ark5isdone
  1728. MISSING=""
  1729. for I in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 ; do
  1730.     if test ! -f ark${I}isdone ; then
  1731.     MISSING="${MISSING} ${I}"
  1732.     fi
  1733. done
  1734. if test "${MISSING}" = "" ; then
  1735.     echo You have unpacked all 32 archives.
  1736.     rm -f ark[1-9]isdone ark[1-9][0-9]isdone
  1737. else
  1738.     echo You still need to unpack the following archives:
  1739.     echo "        " ${MISSING}
  1740. fi
  1741. ##  End of shell archive.
  1742. exit 0
  1743.  
  1744.  
  1745.