[comp.sources.misc] v11i035: starchart 3.2 Part 07/32

ccount@ATHENA.MIT.EDU (03/16/90)

Posting-number: Volume 11, Issue 35
Submitted-by: ccount@ATHENA.MIT.EDU
Archive-name: starchart/part07

#! /bin/sh
# This is a shell archive.  Remove anything before this line, then unpack
# it by saving it into a file and typing "sh file".  To overwrite existing
# files, type "sh file -c".  You can also feed this as standard input via
# unshar, or by typing "sh <file", e.g..  If this archive is complete, you
# will see the following message at the end:
#		"End of archive 7 (of 32)."
# Contents:  observe/orbcalc.c observe/outsif.c observe/tablecalc.c
#   starchart/descrip.mms
PATH=/bin:/usr/bin:/usr/ucb ; export PATH
if test -f 'observe/orbcalc.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'observe/orbcalc.c'\"
else
echo shar: Extracting \"'observe/orbcalc.c'\" \(11271 characters\)
sed "s/^X//" >'observe/orbcalc.c' <<'END_OF_FILE'
X/*
X * orbcalc.c
X * calculate positions of body in elliptical or parabolic orbit
X *
X * Copyright (c) 1990 by Craig Counterman. All rights reserved.
X *
X * This software may be redistributed freely, not sold.
X * This copyright notice and disclaimer of warranty must remain
X *    unchanged. 
X *
X * No representation is made about the suitability of this
X * software for any purpose.  It is provided "as is" without express or
X * implied warranty, to the extent permitted by applicable law.
X *
X */
X
X#ifndef  lint
Xstatic char rcsid[] =
X  "$Header: orbcalc.c,v 1.8 90/02/19 17:20:47 ccount Exp $";
X#endif
X
X
X#include <stdio.h>
X#include <math.h>
X#ifndef SYSV
X#include <strings.h>
X#else
X#include <string.h>
X#endif
X#include "observe.h"
X#include "degree.h"
X#include "date.h"
X
Xextern char *malloc();
X
X
X/* example 
XFormat 
Xskip  three lines, then for each asteroid
XName i Omega omega a n e M Epoch_date Equinox_year type G H
XEpoch_date must be Month day year
XEquinox_year, e.g. 2000.0
X
Xif type is comet, H and G are g and kappa
X
XVesta 7.139 104.015 150.175 2.3613 0.27163 0.0906 43.314 Oct 1 1989 2000.0 Asteroid 3.16 0.34
X
X*/
X
Xvoid read_elliptical(infile, bodies, nbodies_p, maxbodies)
X     FILE *infile;
X     wanderer_data_t bodies[];
X     int *nbodies_p;
X     int maxbodies;
X{
X  char in_line[1000], *linep;
X  char name[100], H[100], G[100], i[100], Omega[100], omega[100],
X      a[100], n[100], body_type[100],
X      e[100], M[100], Month[100], day[100], year[100], equinox_year[100];
X  char epoch_date_str[300];
X  double epoch_date;
X  int j, nscanned;
X  char *cp;
X
X  fgets(in_line, 1000, infile);
X  fgets(in_line, 1000, infile);
X  fgets(in_line, 1000, infile);
X
X  
X  j = 0;
X  while ((j < maxbodies) && (!feof(infile))) {
X    linep = fgets(in_line, 1000, infile);
X    if (linep != NULL)
X      nscanned = sscanf(linep, "%s %s %s %s %s %s %s %s %s %s %s %s %s %s %s",
X		 name, i, Omega, omega, a, n,
X		 e, M, Month, day, year, equinox_year, body_type, H, G);
X    else nscanned = 0;
X    if (nscanned < 15) continue;
X
X    sprintf(epoch_date_str, "%s %s %s", Month, day, year);
X    str_to_jd(epoch_date_str, 0, &epoch_date);
X
X
X    cp = name;
X    while (*cp) {
X      if (*cp == '_') *cp = ' ';
X      cp++;
X    };
X
X    bodies[j].name = (char *) malloc((unsigned) (strlen(name)+1));
X    if (bodies[j].name != NULL) strcpy(bodies[j].name, name);
X    else bodies[j].name = "";
X
X    bodies[j].orbit_type = elliptical_orbit;
X    bodies[j].elliptical_elements.epoch_jd = epoch_date;
X    bodies[j].elliptical_elements.equinox_year = atof(equinox_year);
X    bodies[j].elliptical_elements.a = atof(a);
X    bodies[j].elliptical_elements.e = atof(e);
X    bodies[j].elliptical_elements.i = atof(i);
X    bodies[j].elliptical_elements.Omega = atof(Omega);
X    bodies[j].elliptical_elements.omega = atof(omega);
X    bodies[j].elliptical_elements.n = atof(n);
X    bodies[j].elliptical_elements.M = atof(M);
X    if ((body_type[0] == 'c') || (body_type[0] == 'C')) {
X      bodies[j].body_type = comet;
X      bodies[j].g = atof(G);
X      bodies[j].kappa = atof(H);
X    } else {
X      bodies[j].body_type = asteroid;
X      bodies[j].H = atof(H);
X      bodies[j].G = atof(G);
X    };
X
X    j++;
X  };
X  *nbodies_p = j;
X}
X
X
Xvoid elliptical_pos(T, sun_data, data)
X     double T;			/* time, jd */
X     sun_data_t sun_data;
X     wanderer_data_t *data;
X{
X  double epsilon;
X  double a_;			/* semimajor axis, A.U. */
X  double e_;			/* eccentricity */
X  double i_;			/* inclination (degrees) */
X  double omega_;		/* argument of perihelion */
X  double Omega_;		/* longitude of ascending node */
X  double n_;			/* mean motion (degrees/day) */
X  double M_;			/* mean anomaly at epoch */
X
X  double a, b, c, A, B, C;
X  double F, G, H, P, Q, R;
X  double M, E, nu, r;
X  double x, y, z, X, Y, Z;
X  double Delta;
X  double Psi_1, Psi_2, psi_t; /* For asteroid mag. calculation */
X  double alpha, delta, alpha2000, delta2000;
X
X  a_ = data->elliptical_elements.a;
X  e_ = data->elliptical_elements.e;
X  i_ = data->elliptical_elements.i;
X  omega_ = data->elliptical_elements.omega;
X  Omega_ = data->elliptical_elements.Omega;
X  n_ = data->elliptical_elements.n;
X  M_ = data->elliptical_elements.M;
X
X
X  epsilon = obl_year(data->elliptical_elements.equinox_year);
X  F = DCOS(Omega_);
X  G = DSIN(Omega_)*DCOS(epsilon);
X  H = DSIN(Omega_)*DSIN(epsilon);
X  P = -DSIN(Omega_)*DCOS(i_);
X  Q = DCOS(Omega_)*DCOS(i_)*DCOS(epsilon) - DSIN(i_)*DSIN(epsilon);
X  R = DCOS(Omega_)*DCOS(i_)*DSIN(epsilon) + DSIN(i_)*DCOS(epsilon);
X
X  A = atan2(F,P)*RAD_TO_DEG;
X  B = atan2(G,Q)*RAD_TO_DEG;
X  C = atan2(H,R)*RAD_TO_DEG;
X
X    
X  a = sqrt(F*F + P*P);
X  b = sqrt(G*G + Q*Q);
X  c = sqrt(H*H + R*R);
X
X  /* Calculate M, E, nu, r */
X  M = into_range(M_ + n_ * (T - data->elliptical_elements.epoch_jd));
X  anom_calc(M, e_, &E, &nu);
X  r = a_ * (1 - e_ * DCOS(E));
X
X  x = r * a * DSIN(A + omega_ + nu);
X  y = r * b * DSIN(B + omega_ + nu);
X  z = r * c * DSIN(C + omega_ + nu);
X
X  sun_rect(T, data->elliptical_elements.equinox_year,
X	   sun_data.R, sun_data.Theta, &X, &Y, &Z);
X
X
X  Delta = sqrt((X+x)*(X+x) + (Y+y)*(Y+y) + (Z+z)*(Z+z));
X  R = sqrt(X*X + Y*Y + Z*Z);
X
X
X  data->alpha = atan2(Y+y, X+x)*RAD_TO_DEG;
X  if (data->alpha < 0) data->alpha += 360.0;
X  data->delta = asin((Z+z)/Delta)*RAD_TO_DEG;
X  data->r = r;
X  data->Delta = Delta;
X
X  if (data->elliptical_elements.equinox_year != 2000.0) {
X    alpha = data->alpha;
X    delta = data->delta;
X    precess(data->elliptical_elements.equinox_year, 2000.0,
X	    alpha, delta, &alpha2000, &delta2000);
X    data->alpha2000 = alpha2000;
X    data->delta2000 = delta2000;
X  } else {
X    data->alpha2000 = data->alpha;
X    data->delta2000 = data->delta;
X  };
X/* Can't set l, b, lambda */
X
X  data->psi = acos((R*R + Delta*Delta - r*r)/ (2*R*Delta))*RAD_TO_DEG;
X  data->beta = acos((r*r + Delta*Delta - R*R)/ (2*r*Delta))*RAD_TO_DEG;
X
X  if (data->body_type == asteroid) {
X    G = data->G;
X    H = data->H;
X    psi_t = exp(log(DTAN(data->beta/2.0))*0.63);
X    Psi_1 = exp(-3.33*psi_t);
X    psi_t = exp(log(DTAN(data->beta/2.0))*1.22);
X    Psi_2 = exp(-1.87*psi_t);
X    data->mag = 5.0 * log10(r*Delta) + H
X      - 2.5* log10((1-G)*Psi_1 + G*Psi_2);
X  } else if (data->body_type == comet) {
X    data->mag = data->g + 5.0 * log10(Delta)
X      + 2.5 * data->kappa * log10(r);
X  } else {
X    data->mag = 1.0;
X  }
X}
X
X
X
X
X/* example 
XFormat 
Xskip  three lines, then for each asteroid
XName i Omega omega q Epoch_date Equinox_year g kappa
XEpoch_date must be Month day year
XEquinox_year, e.g. 2000.0
X
XBorsen-metcalf 7.139 104.015 150.175 0.4 Oct 1 1989 2000.0 3.16 0.34
X
X*/
X
X
Xvoid read_parabolic(infile, bodies, nbodies_p, maxbodies)
X     FILE *infile;
X     wanderer_data_t bodies[];
X     int *nbodies_p;
X     int maxbodies;
X{
X  char in_line[1000], *linep;
X  char name[100], g[100], kappa[100], i[100], Omega[100], omega[100],
X      q[100], Month[100], day[100], year[100], equinox_year[100];
X  char perihelion_date_str[300];
X  double perihelion_date;
X  int j, nscanned;
X
X  fgets(in_line, 1000, infile);
X  fgets(in_line, 1000, infile);
X  fgets(in_line, 1000, infile);
X
X  
X  j = 0;
X  while ((j < maxbodies) && (!feof(infile))) {
X    linep = fgets(in_line, 1000, infile);
X    if (linep != NULL)
X      nscanned = sscanf(linep, "%s %s %s %s %s %s %s %s %s %s %s",
X		 name, i, Omega, omega, q, Month, day, year, equinox_year,
X			g, kappa);
X    else nscanned = 0;
X    if (nscanned < 11) continue;
X
X    sprintf(perihelion_date_str, "%s %s %s", Month, day, year);
X    str_to_jd(perihelion_date_str, 0, &perihelion_date);
X
X    bodies[j].name = (char *) malloc((unsigned) (strlen(name)+1));
X    if (bodies[j].name != NULL) strcpy(bodies[j].name, name);
X    else bodies[j].name = "";
X
X    bodies[j].orbit_type = parabolic_orbit;
X    bodies[j].body_type = comet;
X    bodies[j].parabolic_elements.perihelion_date = perihelion_date;
X    bodies[j].parabolic_elements.equinox_year = atof(equinox_year);
X    bodies[j].parabolic_elements.q = atof(q);
X    bodies[j].parabolic_elements.i = atof(i);
X    bodies[j].parabolic_elements.Omega = atof(Omega);
X    bodies[j].parabolic_elements.omega = atof(omega);
X    bodies[j].g = atof(g);
X    bodies[j].kappa = atof(kappa);
X
X    j++;
X  };
X  *nbodies_p = j;
X}
X
X
Xvoid parabolic_pos(T, sun_data, data)
X     double T;			/* time, jd */
X     sun_data_t sun_data;
X     wanderer_data_t *data;
X{
X  double epsilon;
X  double q_;			/* perihelion distance, A.U. */
X  double i_;			/* inclination (degrees) */
X  double omega_;		/* argument of perihelion */
X  double Omega_;		/* longitude of ascending node */
X  double T_0;			/* Time of passage in perihelion */
X
X  double W, s, gamma, gamma_1, beta;
X  double nu, r;
X  double A, B, C, a, b, c;
X  double F, G, H, P, Q, R;
X  double x, y, z, X, Y, Z;
X  double Delta;
X  double Psi_1, Psi_2, psi_t; /* For asteroid mag. calculation */
X  double alpha, delta, alpha2000, delta2000;
X
X  q_ = data->parabolic_elements.q;
X  i_ = data->parabolic_elements.i;
X  omega_ = data->parabolic_elements.omega;
X  Omega_ = data->parabolic_elements.Omega;
X  T_0 = data->parabolic_elements.perihelion_date;
X
X  W = 0.0364911624 * (T - T_0)/(q_ * sqrt(q_));
X  beta = atan2(2.0,W); /* note, beta in radians */
X  gamma_1 = tan(beta/2.0);
X  if (gamma_1 < 0) {
X    gamma = atan(-exp(log(-gamma_1)/3.0));
X  } else {
X    gamma = atan(exp(log(gamma_1)/3.0));
X  };
X  s = 2.0/tan(2*gamma);
X
X  nu = 2.0 * DATAN(s);
X
X  r = q_ * (1 + s*s);
X
X  epsilon = obl_year(data->parabolic_elements.equinox_year);
X  F = DCOS(Omega_);
X  G = DSIN(Omega_)*DCOS(epsilon);
X  H = DSIN(Omega_)*DSIN(epsilon);
X
X  P = -DSIN(Omega_)*DCOS(i_);
X  Q = DCOS(Omega_)*DCOS(i_)*DCOS(epsilon) - DSIN(i_)*DSIN(epsilon);
X  R = DCOS(Omega_)*DCOS(i_)*DSIN(epsilon) + DSIN(i_)*DCOS(epsilon);
X
X  A = atan2(F,P)*RAD_TO_DEG;
X  B = atan2(G,Q)*RAD_TO_DEG;
X  C = atan2(H,R)*RAD_TO_DEG;
X
X    
X  a = sqrt(F*F + P*P);
X  b = sqrt(G*G + Q*Q);
X  c = sqrt(H*H + R*R);
X
X
X  x = r * a * DSIN(A + omega_ + nu);
X  y = r * b * DSIN(B + omega_ + nu);
X  z = r * c * DSIN(C + omega_ + nu);
X
X  sun_rect(T, data->parabolic_elements.equinox_year,
X	   sun_data.R, sun_data.Theta, &X, &Y, &Z);
X
X  Delta = sqrt((X+x)*(X+x) + (Y+y)*(Y+y) + (Z+z)*(Z+z));
X  R = sqrt(X*X + Y*Y + Z*Z);
X
X
X  data->alpha = atan2(Y+y, X+x)*RAD_TO_DEG;
X  if (data->alpha < 0) data->alpha += 360.0;
X  data->delta = asin((Z+z)/Delta)*RAD_TO_DEG;
X  data->r = r;
X  data->Delta = Delta;
X
X  if (data->parabolic_elements.equinox_year != 2000.0) {
X    alpha = data->alpha;
X    delta = data->delta;
X    precess(data->parabolic_elements.equinox_year, 2000.0,
X	    alpha, delta, &alpha2000, &delta2000);
X    data->alpha2000 = alpha2000;
X    data->delta2000 = delta2000;
X  } else {
X    data->alpha2000 = data->alpha;
X    data->delta2000 = data->delta;
X  };
X/* Can't set l, b, lambda */
X
X  data->psi = acos((R*R + Delta*Delta - r*r)/ (2*R*Delta))*RAD_TO_DEG;
X  data->beta = acos((r*r + Delta*Delta - R*R)/ (2*r*Delta))*RAD_TO_DEG;
X
X  if (data->body_type == asteroid) {
X    G = data->G;
X    H = data->H;
X    psi_t = exp(log(DTAN(data->beta/2.0))*0.63);
X    Psi_1 = exp(-3.33*psi_t);
X    psi_t = exp(log(DTAN(data->beta/2.0))*1.22);
X    Psi_2 = exp(-1.87*psi_t);
X    data->mag = 5.0 * log10(r*Delta) + H
X      - 2.5* log10((1-G)*Psi_1 + G*Psi_2);
X  } else if (data->body_type == comet) {
X    data->mag = data->g + 5.0 * log10(Delta)
X      + 2.5 * data->kappa * log10(r);
X  } else {
X    data->mag = 1.0;
X  }
X
X}
X
END_OF_FILE
if test 11271 -ne `wc -c <'observe/orbcalc.c'`; then
    echo shar: \"'observe/orbcalc.c'\" unpacked with wrong size!
fi
# end of 'observe/orbcalc.c'
fi
if test -f 'observe/outsif.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'observe/outsif.c'\"
else
echo shar: Extracting \"'observe/outsif.c'\" \(9823 characters\)
sed "s/^X//" >'observe/outsif.c' <<'END_OF_FILE'
X/*
X * outsif.c
X * Output .sif and .star files for object(s)
X *
X * Copyright (c) 1990 by Craig Counterman. All rights reserved.
X *
X * This software may be redistributed freely, not sold.
X * This copyright notice and disclaimer of warranty must remain
X *    unchanged. 
X *
X * No representation is made about the suitability of this
X * software for any purpose.  It is provided "as is" without express or
X * implied warranty, to the extent permitted by applicable law.
X *
X */
X
X#ifndef  lint
Xstatic char rcsid[] =
X  "$Header: outsif.c,v 1.13 90/03/06 00:10:00 ccount Exp $";
X#endif
X
X
X#include <stdio.h>
X#ifndef SYSV
X#include <strings.h>
X#else
X#include <string.h>
X#endif
X#include "observe.h"
X#include "date.h"
X
X
Xvoid write_files(), tosizestr();
X
X
X/* Output .sif and .star files for object(s) */
Xvoid out_sif(o_sif, o_star, do_sif, do_star, one_day,
X	    sun_data, moon_data, planets, bodies, nbodies, objects, nobjects)
X     FILE *o_sif, *o_star;
X     int do_sif, do_star;	/* output sif file , .star file */
X     int one_day;		/* only doing one day */
X     sun_data_t sun_data;
X     moon_data_t moon_data;
X     planet_data_t planets[];
X     wanderer_data_t bodies[];
X     int nbodies;
X     obj_data_t objects[];
X     int nobjects;
X{
X  int i;
X  char moon_phase[20];
X  char *typefield;
X
X  if (one_day) {
X				/* print all */
X    write_files(o_sif, o_star, do_sif, do_star,
X		sun_data.alpha2000/15.0, sun_data.delta2000,
X		-26.0,
X		"PS", "G2", sun_data.size,
X		"   ", "Sol", "");
X
X    sprintf(moon_phase, "%6.1f %6.1f", moon_data.phase, moon_data.chi);
X    write_files(o_sif, o_star, do_sif, do_star,
X		moon_data.alpha2000/15.0, moon_data.delta2000,
X		moon_data.mag,
X		"PL", "G2", moon_data.size,
X		"   ", "Moon", moon_phase);
X
X    for (i = 0; i < 7; i++)
X      if (planets[i].name[0])
X	write_files(o_sif, o_star, do_sif, do_star,
X		    planets[i].alpha2000/15.0, planets[i].delta2000,
X		    planets[i].mag,
X		    planets[i].type, planets[i].color, planets[i].size,
X		    "   ", planets[i].name, "");
X
X    for (i = 0; i < nbodies; i++) {
X      if (bodies[i].body_type == asteroid)
X	typefield = "PA";
X      else if (bodies[i].body_type == comet)
X	typefield = "PC";
X      else
X	typefield = "P?";
X
X      write_files(o_sif, o_star, do_sif, do_star,
X		  bodies[i].alpha2000/15.0, bodies[i].delta2000,
X		  bodies[i].mag,
X		  typefield, "  ", -1.0,
X		  "   ", bodies[i].name, "");
X    };
X 
X   for (i = 0; i < nobjects; i++)
X      write_files(o_sif, o_star, do_sif, do_star,
X		  objects[i].alpha2000/15.0, objects[i].delta2000,
X		  objects[i].mag,
X		  objects[i].type, "  ", objects[i].size,
X		  "   ", objects[i].name, "");
X  } else {
X				/* only print object list */
X    for (i = 0; i < nobjects; i++)
X      write_files(o_sif, o_star, do_sif, do_star,
X		  objects[i].alpha2000/15.0, objects[i].delta2000,
X		  objects[i].mag,
X		  objects[i].type, "  ", objects[i].size,
X		  "   ", objects[i].name, "");
X  }
X}
X
X
X/* Output .sif and .star files for a planet */
Xvoid out_sif_planet(o_sif, o_star, do_sif, do_star, one_day,
X	     planet, jd)
X     FILE *o_sif, *o_star;
X     int do_sif, do_star;	/* output sif file , .star file */
X     int one_day;		/* only doing one day */
X     planet_data_t planet;
X     double jd;
X{
X  static char *namep = "";
X  char *vectfield;
X  char datestr[15];
X  char name_date[96];
X
X  if (namep == planet.name) {	/* we've done this before */
X    vectfield = "VS";
X  } else {			/* this is a new one */
X    namep = planet.name;
X    vectfield = "VM";
X  };
X
X  jd_to_str(jd, datestr);
X  sprintf(name_date, "%s %s", planet.name, datestr);
X
X  write_files(o_sif, o_star, do_sif, do_star,
X	      planet.alpha2000/15.0, planet.delta2000,
X	      planet.mag,
X	      planet.type, "  ", planet.size,
X	      "   ", name_date, "");
X  write_files(o_sif, o_star, do_sif, do_star,
X	      planet.alpha2000/15.0, planet.delta2000,
X	      planet.mag + 1.0,
X	      vectfield, "  ", planet.size,
X	      "   ", name_date, "");
X}
X
X/* Output .sif and .star files for a body */
Xvoid out_sif_body(o_sif, o_star, do_sif, do_star, one_day,
X	     body, jd)
X     FILE *o_sif, *o_star;
X     int do_sif, do_star;	/* output sif file , .star file */
X     int one_day;		/* only doing one day */
X     wanderer_data_t body;
X     double jd;
X{
X  static char *namep = "";
X  char *vectfield, *typefield;
X  char datestr[15];
X  char name_date[96];
X
X  if (namep == body.name) {	/* we've done this before */
X    vectfield = "VS";
X  } else {			/* this is a new one */
X    namep = body.name;
X    vectfield = "VM";
X  };
X
X  if (body.body_type == asteroid)
X    typefield = "PA";
X  else if (body.body_type == comet)
X    typefield = "PC";
X  else
X    typefield = "P?";
X
X  jd_to_str(jd, datestr);
X  sprintf(name_date, "%s %s", body.name, datestr);
X
X  write_files(o_sif, o_star, do_sif, do_star,
X	      body.alpha2000/15.0, body.delta2000,
X	      body.mag,
X	      typefield, "  ", -1.0,
X	      "   ", name_date, "");
X  write_files(o_sif, o_star, do_sif, do_star,
X	      body.alpha2000/15.0, body.delta2000,
X	      body.mag + 1.0,
X	      vectfield, "  ", -1.0,
X	      "   ", name_date, "");
X}
X
X/* output sun */
Xvoid out_sif_sun(o_sif, o_star, do_sif, do_star, one_day,
X	     sun_data, jd)
X     FILE *o_sif, *o_star;
X     int do_sif, do_star;	/* output sif file , .star file */
X     int one_day;		/* only doing one day */
X     sun_data_t sun_data;
X     double jd;
X{
X  static char *namep = "";
X  char *vectfield;
X  char datestr[15];
X  char name_date[96];
X
X  if (!strcmp(namep,"Sol")) {	/* we've done this before */
X    vectfield = "VS";
X  } else {			/* this is a new one */
X    namep = "Sol";
X    vectfield = "VM";
X  };
X
X  jd_to_str(jd, datestr);
X  sprintf(name_date, "%s %s", "Sol", datestr);
X
X  write_files(o_sif, o_star, do_sif, do_star,
X	      sun_data.alpha2000/15.0, sun_data.delta2000,
X	      -26.0,
X	      "PS", "G2", sun_data.size,
X	      "   ", name_date, "");
X  write_files(o_sif, o_star, do_sif, do_star,
X	      sun_data.alpha2000/15.0, sun_data.delta2000,
X	      -25.0,
X	      vectfield, "  ", sun_data.size,
X	      "   ", name_date, "");
X}
X/* output moon */
Xvoid out_sif_moon(o_sif, o_star, do_sif, do_star, one_day,
X	     moon_data, jd)
X     FILE *o_sif, *o_star;
X     int do_sif, do_star;	/* output sif file , .star file */
X     int one_day;		/* only doing one day */
X     moon_data_t moon_data;
X     double jd;
X{
X  static char *namep = "";
X  char *vectfield;
X  char datestr[15];
X  char name_date[96];
X  char moon_phase[20];
X
X  if (!strcmp(namep,"moon")) {	/* we've done this before */
X    vectfield = "VS";
X  } else {			/* this is a new one */
X    namep = "moon";
X    vectfield = "VM";
X  };
X
X  jd_to_str(jd, datestr);
X  sprintf(name_date, "%s %s", "Moon", datestr);
X  sprintf(moon_phase, "%6.1f %6.1f", moon_data.phase, moon_data.chi);
X
X  write_files(o_sif, o_star, do_sif, do_star,
X	      moon_data.alpha2000/15.0, moon_data.delta2000,
X	      moon_data.mag,
X	      "PL", "G2", moon_data.size,
X	      "   ", name_date, moon_phase);
X  write_files(o_sif, o_star, do_sif, do_star,
X	      moon_data.alpha2000/15.0, moon_data.delta2000,
X	      moon_data.mag + 1.0,
X	      vectfield, "  ", moon_data.size,
X	      "   ", name_date, "");
X}
X
X
Xvoid write_files(o_sif, o_star, do_sif, do_star, ra, dec, mag, type, color,
X		 size, constell, name, comment)
X     FILE *o_sif, *o_star;
X     int do_sif, do_star;	/* output sif file , .star file */
X     double ra, dec, mag;
X     char type[3], color[3];
X     double size;
X     char constell[4];
X     char *name;
X     char *comment;
X{
X  int rah, ram, ras, dld, dlm, d_d, d_m, d_s, sign;
X  double dec_t;
X  int i;
X  char magstr[4];
X  char sizestr[3];
X
X  rah = ra;
X  ra -= rah;
X  ram = ra*60.0;
X  ra -= ram/60.0;
X  ras = ra*3600.0 + 0.5;
X  if (ras == 60) {
X    ras = 0;
X    ram++;
X  }
X  if (ram == 60) {
X    ram = 0;
X    rah++;
X  }
X  if (rah == 24) rah = 0;
X
X  /* dec -> degrees and minutes */
X  dec_t = dec;
X  sign = (dec_t < 0.0);
X  if (sign) dec_t = -dec_t;
X  dld = dec_t;
X  dec_t -= dld;
X  dlm = dec_t * 60.0 + 0.5;
X  if (dlm == 60) {
X    dlm = 0;
X    dld++;
X  }
X
X  /* dec -> degrees, minutes and seconds */
X  dec_t = dec;
X  if (sign) dec_t = -dec_t;
X  d_d = (int) dec_t;
X  d_m = (int)((dec_t - d_d)*60);
X  d_s = (int)((dec_t - d_d - d_m/60.0)*3600 + 0.5);
X  if (d_s == 60) {
X    d_s = 0;
X    d_m++;
X  }
X  if (d_m == 60) {
X    d_m = 0;
X    d_d++;
X  }
X
X  if (mag < 0.0) {
X    if (mag < -10.0) strcpy(magstr,"-99");
X    else {
X      i = -mag*10 + .5;
X      sprintf(magstr,"-%02d", i);
X    };
X  } else if (mag < 10.0) {
X    i = mag*100 + .5;
X    sprintf(magstr,"%03d", i);
X  } else {
X    i = mag*100 + .5;
X    i %= 1000;
X    sprintf(magstr,"%03d", i);
X    magstr[0] = ((int) (mag - 10.0)) + 'A';
X  };
X
X  if (size >= 0.0)
X    tosizestr(size, sizestr);
X  else
X    strcpy(sizestr, "  ");
X
X  if (do_star)
X    if (comment[0])
X      fprintf(o_star, "%02d%02d%02d%c%02d%02d%s%s%s%s%s%s,%s\n",
X	      rah, ram, ras, sign ? '-':'+', dld, dlm,
X	      magstr,
X	      type, color,
X	      sizestr,
X	      constell, name, comment);
X    else
X      fprintf(o_star, "%02d%02d%02d%c%02d%02d%s%s%s%s%s%s\n",
X	      rah, ram, ras, sign ? '-':'+', dld, dlm,
X	      magstr,
X	      type, color,
X	      sizestr,
X	      constell, name);
X
X  if (do_sif)
X    fprintf(o_sif, "%2d %2d %2d; %c%02d %2d %d; %.3f;%s;%s;%s;%s;%s;%s\n",
X	    rah, ram, ras, sign ? '-':'+', d_d, d_m, d_s,
X	    mag,
X	    type, color,
X	    sizestr,
X	    constell, name, comment);
X}
X
Xvoid tosizestr(sze, str)
X     double sze;
X     char str[];
X{
X  if (sze < 99.5) sprintf(str, "%2d",(int) (sze + 0.5));
X  else if (sze < 995.0) {
X    sprintf(str, "%2d",(int) ((sze + 5.0)/10.0));
X    str[0] = 'A' + str[0] - '0' - 1;
X  }  else if (sze < 9950.0) {
X    sprintf(str, "%2d",(int) ((sze + 50.0)/100.0));
X    str[0] = 'J' + str[0] - '0' - 1;
X  }  else if (sze < 89500.0) {
X    sprintf(str, "%2d",(int) ((sze + 500.0)/1000.0));
X    str[0] = 'S' + str[0] - '0' - 1;
X  } else sprintf(str , "Z9");
X}
END_OF_FILE
if test 9823 -ne `wc -c <'observe/outsif.c'`; then
    echo shar: \"'observe/outsif.c'\" unpacked with wrong size!
fi
# end of 'observe/outsif.c'
fi
if test -f 'observe/tablecalc.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'observe/tablecalc.c'\"
else
echo shar: Extracting \"'observe/tablecalc.c'\" \(12025 characters\)
sed "s/^X//" >'observe/tablecalc.c' <<'END_OF_FILE'
X/*
X * tablecalc.c
X * calculate positions by interpolation of a table
X *
X * Copyright (c) 1990 by Craig Counterman. All rights reserved.
X *
X * This software may be redistributed freely, not sold.
X * This copyright notice and disclaimer of warranty must remain
X *    unchanged. 
X *
X * No representation is made about the suitability of this
X * software for any purpose.  It is provided "as is" without express or
X * implied warranty, to the extent permitted by applicable law.
X *
X */
X
X#ifndef  lint
Xstatic char rcsid[] =
X  "$Header: tablecalc.c,v 1.8 90/02/19 17:21:52 ccount Exp $";
X#endif
X
X
X#include <stdio.h>
X#include <math.h>
X#include <ctype.h>
X
X#ifndef SYSV
X#include <strings.h>
X#else
X#include <string.h>
X#endif /* SYSV */
X#include "observe.h"
X#include "date.h"
X
X
X#ifndef FALSE
X#define FALSE 0
X#endif
X#ifndef TRUE
X#define TRUE 1
X#endif
X
X#ifndef MAX
X#define MAX(x,y) ((x)>(y)?(x):(y))
X#endif
X#ifndef MIN
X#define MIN(x,y) ((x)<(y)?(x):(y))
X#endif
X
Xstatic double polint();
Xstatic void readfile();
X
X#define MAXPTS 300
X
Xstatic double dates[MAXPTS], ra[MAXPTS], dec[MAXPTS],
X  mag[MAXPTS], r[MAXPTS], Delta[MAXPTS];
Xstatic int Nread;
Xstatic double from_equinox;
X
Xvoid tabulated_pos(jd, sun_data, body)
X     double jd;
X     sun_data_t sun_data;
X     wanderer_data_t *body;
X{
X  double alpha, delta;
X  double alpha2000, delta2000;
X  double error;
X
X  alpha = 15.0 * polint(dates, ra, Nread, jd, &error);
X  delta = polint(dates, dec, Nread, jd, &error);
X  precess(from_equinox, 2000.0, alpha, delta, &alpha2000, &delta2000);
X
X  body->alpha = alpha;
X  body->delta = delta;
X  body->alpha2000 = alpha2000;
X  body->delta2000 = delta2000;
X  body->mag = polint(dates, mag, Nread, jd, &error);
X  body->r = polint(dates, r, Nread, jd, &error);
X  body->Delta = polint(dates, Delta, Nread, jd, &error);
X  body->body_type = no_type;
X
X  /* Unknown */
X  body->beta = -999.0;
X  body->psi = -999.0;
X}
X
Xvoid read_table(infile, in_type)
X     FILE *infile;
X     fformat_t in_type;
X{
X  double ra_1, ra_2;
X  int i;
X  int yr;
X  int adjust_ra;
X
X
X
X  /* Prepare for epoch change */
X  switch (in_type) {
X  case emp:
X    from_equinox = 1950.0;
X    break;
X  case empb:
X    from_equinox = 1950.0;
X    break;
X  case aa:
X    from_equinox = 2000.0;
X    break;
X  case st:
X    from_equinox = 2000.0;
X    break;
X  case iau:
X    from_equinox = 1950.0;
X    break;
X  default:
X    break;
X  }
X
X  yr = now_year();
X  readfile(infile, in_type, yr);
X
X
X  /* Adjust ra to be continuous */
X  /* If the difference between adjacent numbers is greater than
X     the difference if you subtract 24 from the larger,
X     then shift all by 24 hrs */
X  adjust_ra = FALSE;
X  for (i = 0; i < Nread-1; i++) {
X    ra_2 = MAX(ra[i],ra[i+1]);
X    ra_1 = MIN(ra[i],ra[i+1]);
X    if (fabs(ra_2-ra_1) > fabs(ra_2-24-ra_1))
X      adjust_ra = TRUE;
X  }
X  if (adjust_ra)
X    for (i = 0; i < Nread; i++)
X      if (ra[i] < 12.0) ra[i] += 24.0;
X}
X
X
Xstatic void readfile(fptr, fform, year)
X     FILE *fptr;
X     fformat_t fform;
X     int year;
X{
X  char lbuf[1000], *bufp;
X  char s1[100], s2[100], s3[100], s4[100], s5[100], s6[100], s7[100], s8[100],
X       s9[100], s10[100], s11[100];
X  int i, n;
X  int mo, last_mo, yr;
X  double dy;
X
X  mo = -1;
X  last_mo = -2;
X  dy = -1;
X  yr = year;
X
X  fgets(lbuf, 1000, fptr);
X  n = sscanf(lbuf, "year %d", &i);
X  if (n == 1) yr = i;
X  fgets(lbuf, 1000, fptr);
X  n = sscanf(lbuf, "year %d", &i);
X  if (n == 1) yr = i;
X  fgets(lbuf, 1000, fptr);
X  n = sscanf(lbuf, "year %d", &i);
X  if (n == 1) yr = i;
X
X
X  switch (fform) {
X  case emp:
X/*
Xmonth day ra ra     dec dec
X1     2    3 4       5  6
XVIII  17   0 23.7   -13 48
X      27   0 19.1   -14 51
X
X*/
X    i = 0;
X    while (!feof(fptr)) {
X      bufp = fgets(lbuf, 1000, fptr);
X      if (bufp != NULL)
X	n = sscanf(bufp, "%s %s %s %s %s %s",
X		   s1, s2, s3, s4, s5, s6);
X      else n = 0;
X      if (n < 5) continue;
X      if ((lbuf[0] == ' ') || (lbuf[0] == '\t')) {
X	/* use current month */
X	dy = atof(s1);
X
X	ra[i] = atof(s2) + atof(s3)/60.0;
X	dec[i] = atof(s4);
X	dec[i] += (atof(s5)/60.0)*(s4[0] == '-' ? -1 : 1);
X				/* Beware of the sign */
X
X	mag[i] = 0.0;		/* don't know it */
X	r[i] = -1.0;		/* don't know it */
X	Delta[i] = -1.0;	/* don't know it */
X      } else {
X	mo = tr_mname(s1);
X	if (mo < last_mo) yr++;
X	last_mo = mo;
X	dy = atof(s2);
X
X	ra[i] = atof(s3) + atof(s4)/60.0;
X	dec[i] = atof(s5);
X	dec[i] += (atof(s6)/60.0)*(s5[0] == '-' ? -1 : 1);
X				/* Beware of the sign */
X
X	mag[i] = 0.0;		/* don't know it */
X	r[i] = -1.0;		/* don't know it */
X	Delta[i] = -1.0;	/* don't know it */
X      }
X
X      cal_to_jd(dy, mo, yr, &dates[i]);
X      i++;
X    };
X    Nread = i;
X    break;
X  case empb:
X/*
Xmonth day ra ra     dec dec r    Delta   V    beta
X1     2   3  4     5    6    7    8       9   10
XX      6  23 48.36 -18  5.5 2.958 2.033   7.8 8.8
X      16  23 41.45 -18 13.1 2.955 2.095   8.0 11.6
X*/
X    i = 0;
X    while (!feof(fptr)) {
X      bufp = fgets(lbuf, 1000, fptr);
X      if (bufp != NULL)
X	n = sscanf(bufp, "%s %s %s %s %s %s %s %s %s %s",
X		   s1, s2, s3, s4, s5, s6, s7, s8, s9, s10);
X      else n = 0;
X      if (n < 5) continue;
X      if ((lbuf[0] == ' ') || (lbuf[0] == '\t')) {
X	/* use current month */
X	dy = atof(s1);
X
X	ra[i] = atof(s2) + atof(s3)/60.0;
X	dec[i] = atof(s4);
X	dec[i] += (atof(s5)/60.0)*(s4[0] == '-' ? -1 : 1);
X				/* Beware of the sign */
X
X	r[i] = atof(s6);
X	Delta[i] = atof(s7);
X	mag[i] = atof(s8);
X/*	beta[i] = atof(s9);*/
X      } else {
X	mo = tr_mname(s1);
X	if (mo < last_mo) yr++;
X	last_mo = mo;
X	dy = atof(s2);
X
X	ra[i] = atof(s3) + atof(s4)/60.0;
X	dec[i] = atof(s5);
X	dec[i] += (atof(s6)/60.0)*(s5[0] == '-' ? -1 : 1);
X				/* Beware of the sign */
X
X	r[i] = atof(s7);
X	Delta[i] = atof(s8);
X	mag[i] = atof(s9);
X/*	beta[i] = atof(s10);*/
X      }
X
X      cal_to_jd(dy, mo, yr, &dates[i]);
X
X      i++;
X    };
X    Nread = i;
X    break;
X  case aa:
X/*
Xdate     RA          DEC       r    Ephemeris Transit
X1     2  3  4  5     6  7  8  9     10  11
XOct.  1  23 54 52.1 -17 37 21 2.011 23 10.0
X      3  23 53 16.1 -17 42 32 2.019 23 00.5
X*/
X    i = 0;
X    while (!feof(fptr)) {
X      bufp = fgets(lbuf, 1000, fptr);
X      if (bufp != NULL)
X	n = sscanf(bufp, "%s %s %s %s %s %s %s %s %s %s %s",
X		   s1, s2, s3, s4, s5, s6, s7, s8, s9, s10, s11);
X      else n = 0;
X      if (n < 7) continue;
X      if ((lbuf[0] == ' ') || (lbuf[0] == '\t')) {
X	/* use current month */
X	dy = atof(s1);
X
X	ra[i] = atof(s2) + atof(s3)/60.0 + atof(s4)/3600.0;
X	dec[i] = atof(s5);
X	dec[i] += (atof(s6)/60.0 + atof(s7)/3600.0)*(s5[0] == '-' ? -1 : 1);
X				/* Beware of the sign */
X
X	r[i] = atof(s8);
X
X	mag[i] = 0.0;		/* don't know it */
X	Delta[i] = -1.0;	/* don't know it */
X      } else {
X	mo = tr_mname(s1);
X	if (mo < last_mo) yr++;
X	last_mo = mo;
X	dy = atof(s2);
X
X	ra[i] = atof(s3) + atof(s4)/60.0 + atof(s5)/3600.0;
X	dec[i] = atof(s6);
X	dec[i] += (atof(s7)/60.0 + atof(s8)/3600.0)*(s6[0] == '-' ? -1 : 1);
X				/* Beware of the sign */
X	r[i] = atof(s9);
X	
X	mag[i] = 0.0;		/* don't know it */
X	Delta[i] = -1.0;	/* don't know it */
X      }
X
X      cal_to_jd(dy, mo, yr, &dates[i]);
X
X      i++;
X    };
X    Nread = i;
X    break;
X  case st:
X/*
XDate    RA       DEC   Elongation Mag.
X1    2  3  4     5 6   7   8
XOct  1  14 07.6  4 06  25  5.4
X     6  14 52.3  3 28  32  6.5
X*/
X    i = 0;
X    while (!feof(fptr)) {
X      bufp = fgets(lbuf, 1000, fptr);
X      if (bufp != NULL)
X	n = sscanf(bufp, "%s %s %s %s %s %s %s %s",
X		   s1, s2, s3, s4, s5, s6, s7, s8);
X      else n = 0;
X      if (n < 5) continue;
X      if ((lbuf[0] == ' ') || (lbuf[0] == '\t')) {
X	/* use current month */
X	dy = atof(s1);
X
X	ra[i] = atof(s2) + atof(s3)/60.0;
X	dec[i] = atof(s4);
X	dec[i] += (atof(s5)/60.0)*(s4[0] == '-' ? -1 : 1);
X				/* Beware of the sign */
X	mag[i] = atof(s7);
X
X	r[i] = -1.0;		/* don't know it */
X	Delta[i] = -1.0;	/* don't know it */
X      } else {
X	mo = tr_mname(s1);
X	if (mo < last_mo) yr++;
X	last_mo = mo;
X	dy = atof(s2);
X
X	ra[i] = atof(s3) + atof(s4)/60.0;
X	dec[i] = atof(s5);
X	dec[i] += (atof(s6)/60.0)*(s5[0] == '-' ? -1 : 1);
X				/* Beware of the sign */
X	mag[i] = atof(s8);
X
X	r[i] = -1.0;		/* don't know it */
X	Delta[i] = -1.0;	/* don't know it */
X      }
X
X      cal_to_jd(dy, mo, yr, &dates[i]);
X
X      i++;
X    };
X    Nread = i;
X    break;
X  case iau:
X/*
Xdate       RA          DEC      \Delta     r     (V or m1)
X     *Only gives \Delta r and V or m1  for every other date*
X
X1      2   3  4        5  6     7        8       9
XOct.   6   14 50.24    3 41.0   1.204    0.643   12.5
X      11   15 29.62    2 48.8
X      16   16 04.01    1 54.1   1.339    0.889   14.1
X      21   16 33.96    1 02.5
X*/
X    i = 0;
X    while (!feof(fptr)) {
X      bufp = fgets(lbuf, 1000, fptr);
X      if (bufp != NULL)
X	n = sscanf(bufp, "%s %s %s %s %s %s %s %s %s",
X		   s1, s2, s3, s4, s5, s6, s7, s8, s9);
X      else n = 0;
X      if (n < 5) continue;
X      if ((lbuf[0] == ' ') || (lbuf[0] == '\t')) {
X	/* use current month */
X	dy = atof(s1);
X
X	ra[i] = atof(s2) + atof(s3)/60.0;
X	dec[i] = atof(s4);
X	dec[i] += (atof(s5)/60.0)*(s4[0] == '-' ? -1 : 1);
X				/* Beware of the sign */
X	if (n > 5) {
X	  Delta[i] = atof(s6);
X	  r[i] = atof(s7);
X	  mag[i] = atof(s8);
X	} else {
X	  Delta[i] =
X	  r[i] =
X	  mag[i] =
X	    -9999.0;
X	}
X      } else {
X	mo = tr_mname(s1);
X	if (mo < last_mo) yr++;
X	last_mo = mo;
X	dy = atof(s2);
X
X	ra[i] = atof(s3) + atof(s4)/60.0;
X	dec[i] = atof(s5);
X	dec[i] += (atof(s6)/60.0)*(s5[0] == '-' ? -1 : 1);
X				/* Beware of the sign */
X	if (n > 5) {
X	  Delta[i] = atof(s7);
X	  r[i] = atof(s8);
X	  mag[i] = atof(s9);
X	} else {
X	  Delta[i] =
X	  r[i] =
X	  mag[i] =
X	    -9999.0;
X	}
X      }
X
X      cal_to_jd(dy, mo, yr, &dates[i]);
X
X      i++;
X    };
X    Nread = i;
X
X    /* now fix mag, r, and Delta */
X    for (i = 0; i < Nread; i++) {
X      if (mag[i] < -1000.0)
X	mag[i] = (mag[i-1] + mag[i-1])/2.0;
X      if (r[i] < -1000.0)
X	r[i] = (r[i-1] + r[i-1])/2.0;
X      if (Delta[i] < -1000.0)
X	Delta[i] = (Delta[i-1] + Delta[i-1])/2.0;
X    };
X    break;
X  default:
X    break;
X  }
X}
X
X
X
X/* Maximum number of points */
X#define NMAX MAXPTS
X
X/* Polymomial interpolation (or extrapolation) function
XAdopted from Numerical Recipies
XGiven arrays xa and ya, each of length N, and given a value x, this routine 
Xreturns a value y and an error estimate dy.  If P(x) is the polynomial of
Xdegree N-1 such that P(xa[i]) = ya[i], i = 1, ..., N then the returned
Xvalue y = P(x);  */
Xstatic double polint(xa, ya, N, x, dy)
X     double xa[], ya[];		/* value arrays */
X     int N;			/* Order */
X     double x;			/* x point desired */
X     double *dy;		/* error estimate */
X{
X  int i, NS, M;
X  double dif, dift, c[NMAX], d[NMAX], ho, hp, w, den, y;
X
X  NS = 0;
X  dif = fabs(x-xa[0]);
X  /* Find the index NS of closest table entry */
X  for (i = 0; i < N; i++) {
X    dift = fabs(x - xa[i]);
X    if (dift < dif) {
X      NS = i;
X      dif = dift;
X    }
X    /* initialize the 'tableau' of c's and d's */
X    c[i] =
X    d[i] = ya[i];
X  }
X  y = ya[NS];			/* Initial approximation to Y. */
X  NS--;
X  /* For each column of the tableay, we loop over the current c's and d's
X     and update them */
X  for (M = 1; M <= N-1; M++) {
X    for (i = 0; i < N-M; i++) {
X      ho = xa[i] - x;
X      hp = xa[i+M] - x;
X      w = c[i+1] - d[i];
X      den = ho - hp;
X      if (den == 0.0) {
X	/* This can occur only if two input xa's are identical */
X	fprintf(stderr, "Error in routine polint\n");
X	exit(1);
X      }
X      den = w/den;
X      d[i] = hp*den;
X      c[i] = ho*den;
X    }
X
X    /* After each column in the tableau is completed, we decide
X       which correction, c or d, we want to add to our accumulating value of y,
X       i.e. which path to take throught the tableau -- forking up or down.
X       We do this in such a way as to take the most "straight line" route
X       through the tableau to its apex, updating NS accordingly to keep track
X       of where we are.  This route keeps the apartial approximations centered
X       (insofar as possible) on the target x.  The last dy added is thus
X       the error indication. */
X    if ((NS+1)*2 < N-M)
X      *dy = c[NS+1];
X    else {
X      *dy = d[NS];
X      NS--;
X    }
X    y = y + *dy;
X  }
X
X  return y;
X}
END_OF_FILE
if test 12025 -ne `wc -c <'observe/tablecalc.c'`; then
    echo shar: \"'observe/tablecalc.c'\" unpacked with wrong size!
fi
# end of 'observe/tablecalc.c'
fi
if test -f 'starchart/descrip.mms' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'starchart/descrip.mms'\"
else
echo shar: Extracting \"'starchart/descrip.mms'\" \(11285 characters\)
sed "s/^X//" >'starchart/descrip.mms' <<'END_OF_FILE'
X###########################################################################
X#
X#	DESCRIP.MMS - a 'makefile' for VAX/VMS and VAX C V3.0 or greater
X#		by Michael Campanella (campanella@cvg.enet.dec.com)
X#
X# $Header: descrip.mms,v 1.5 90/01/13 14:41:44 ccount Exp $
X#
X###########################################################################
X#	Makefile for starchart programs
X#
X#	$Header: descrip.mms,v 1.5 90/01/13 14:41:44 ccount Exp $
X#
X#list ONLY the programs you want to use at your site
XTARGS= \
X	stardsp.exe \
X	starX11.exe \
X	starXaw.exe \
X	starpost.exe \
X	startek.exe
X#	staruplot
X#	starsunv
X#	starlaser 
X#	starX10 
X# startool must be made specially, see below.
X# Also consider "postconv.awk"
X
X#SITE DEPENDENCIES
X#
X# Uncomment out the version appropriate for your site.
X# At present dependencies for sysV UNIX
X#
X#LOCAL=-DSYSV -Dindex=strchr
X#LOCAL = /define=(SYSV,"index=strchr","unlink=delete")
X
X# FOR ALL
X# define OLD_GREEK if you have the old yale.star file, with a
X#                slightly different greek encoding
X# To produce programs which allow keyboard user interaction with the -u flag, 
X#    see COBJ and starmain.OBJ below.
X# FOR X11
X# define USE_X_DASHES if your server can draw dashed lines
X# define RELEASE3_FONTS if you want to use the X11R3 font names
X# define X11R4 if you are using Release 4  (for the athena widgets).
X# FOR POSTSCRIPT
X# define USE_FINE_MACROS if you want to use finer macros than usual:
X#	 star size varies continuously with magnitude.
X#        Needs printer with lots of available memory
X#
X#DEFINES= -DRELEASE3_FONTS -DUSE_X_DASHES -DUSE_FINE_MACROS
X#DEFINES= -DRELEASE3_FONTS -DUSE_X_DASHES
X#DEFINES = /define=(USE_X_DASHES,RELEASE3_FONTS)
X
X#destination for 'make install', otherwise not important
XBINDIR = "/usr/local"
X
X#XINCLUDES is for DECwindows UWS 2.0
X#XINCLUDES = -I/usr/include/mit
XXINCLUDES =
X
X#list ALL header files
XHDRS=icon.h parse_input.h star3.h starXaw.h starXawDlog.h patchlevel.h
X#list ALL source files, whether or not you use them
XSRCS= interact.c parse_input.c readfile.c starX10.c starX11.c starXaw.c \
X	starXawDlog.c starXawHelp.c starXawMwin.c starcust.c \
X	stardsp.c starimages.c starlaser.c starm2.c starmain.c \
X	starpost.c starsample.c starsunv.c starsupp.c startek.c staruplot.c
X
X#list ALL object files which could be produced
XOBJS= interact.OBJ parse_input.OBJ readfile.OBJ starX10.OBJ \
X	starX11.OBJ starX11_aw.OBJ starXaw.OBJ starXawDlog.OBJ \
X	starXawHelp.OBJ starXawMwin.OBJ starcust.OBJ stardsp.OBJ \
X	starimages.OBJ starimages_a.OBJ starlaser.OBJ starm2.OBJ starm2_i.OBJ \
X	starmain.OBJ starmain_i.OBJ starpost.OBJ starsunv.OBJ starsupp.OBJ \
X	startek.OBJ staruplot.OBJ
X
XATHENA_OBJS = command.obj form.obj label.obj simple.obj text.obj vpaned.obj -
X	asciitext.obj box.obj asciisink.obj strtojust.obj disksrc.obj -
X	intrinsic.obj stringsrc.obj utils.obj lower.obj dialog.obj scroll.obj -
X	strtoornt.obj graypixmap.obj
X
XSTARTOOL=startool.tt startool.icon startool.sh
XSUPP=postconv.awk
XVMSFILES=decwxtk.opt descrip.mms starchart_init.com vaxcrtl.opt
XIBMFILES=pcstar.h Starchar.MSC staribm.c
XFILES = Makefile. README. ${SRCS} ${HDRS} ${STARTOOL} ${SUPP} \
X	${VMSFILES} ${IBMFILES}
X
XDISTDIR=../../dist/starchart
X
X#The following may be defined here to set default data file locations
X# filename	filetype	description
X# STARFILE	STARFTYPE	bright star data (yale)
X# INDEXFILE	INDEXFTYPE	index to fainter stars (SAO)
X# NEBFILE	NEBFTYPE	nebulae
X# BOUNDFILE	BOUNDFTYPE	constellation boundaries
X# PATTERNFILE	PATTFTYPE	constellation patterns
X# CNAMEFILE	CNAMEFTYPE	constellation names
X# PLANETFILE	PLANETFTYPE	planet positions
X
X# other files
X# CONSTFILE	constellation locations
X# RCFILE	resource file
X
X# Define as needed only
X# Remember, there are defaults in the code
X
X# Example
XFILEROOT=/starchart/
XSTAR="${FILEROOT}/yale.star"
XSTART=LINEREAD
XINDEX="${FILEROOT}/index.indx"
XINDEXT=INDEXTYPE
X# only currently valid index file type
XNEB="${FILEROOT}/neb.star"
XNEBT=LINEREAD
XBOUND="${FILEROOT}/boundaries.star"
XBOUNDT=LINEREAD
XPATT="${FILEROOT}/pattern.star"
XPATTTY=LINEREAD
XCNAME="${FILEROOT}/cnames.star"
XCNAMET=LINEREAD
XPLANET="./planet.star"
X# Planets move, so make it local
XPLANETTY=LINEREAD
XCONS="${FILEROOT}/con.locs"
XRC="./.starrc"
X
XFILEFLAGS= \
X        -DSTARFILE='$(STAR)' \
X        -DSTARFTYPE='$(START)' \
X        -DINDEXFILE='$(INDEX)' \
X        -DINDEXFTYPE='$(INDEXT)' \
X        -DNEBFILE='$(NEB)' \
X        -DNEBFTYPE='$(NEBT)' \
X        -DBOUNDFILE='$(BOUND)' \
X        -DBOUNDFTYPE='$(BOUNDT)' \
X        -DPATTERNFILE='$(PATT)' \
X        -DPATTFTYPE='$(PATTTY)' \
X        -DCNAMEFILE='$(CNAME)' \
X        -DCNAMEFTYPE='$(CNAMET)' \
X        -DPLANETFILE='$(PLANET)' \
X        -DPLANETFTYPE='$(PLANETTY)' \
X        -DCONSTFILE='$(CONS)' \
X        -DRCFILE='$(RC)'
X
X.first
X	pu/nolog/keep=3
X	set prot=(g:rwed,w:re)/default
X	define sys sys$library
X	define x11 decw$include,sys$disk:[]
X
X.last
X	pu/nolog
X
Xall : $(TARGS)
X	! Done !
X
X#CFLAGS= ${FILEFLAGS} ${LOCAL} ${DEFINES} -g
XCFLAGS = -
X/list/define=(SYSV,"index=strchr",USE_X_DASHES,RELEASE3_FONTS)
X#LDFLAGS = -g
XLINKFLAGS = /nodebug/trace
X
X#Include interact.OBJ in COBJ to support keyboard user interaction
X#COBJ=starmain.OBJ starm2.OBJ starsupp.OBJ readfile.OBJ parse_input.OBJ
XCOBJ=starmain.OBJ starm2.OBJ starsupp.OBJ readfile.OBJ parse_input.OBJ -
X	interact.OBJ 
XCOBJIM=$(COBJ) starimages.OBJ
XCOBJIMA=$(COBJ) starimages_a.OBJ
X
Xstardsp.exe : $(COBJ) stardsp.OBJ starcust.OBJ
X	$ define/user lnk$library sys$library:vaxcrtl.olb
X	$ link/exe=$(mms$target) $(LINKFLAGS) $(mms$source_list)
X#	$(CC) $(LDFLAGS) ${COBJ} stardsp.OBJ starcust.OBJ -lm -o $@
X
Xstarlaser.exe : $(COBJIMA) starlaser.OBJ starcust.OBJ
X	$(CC) $(LDFLAGS) ${COBJIMA} starlaser.OBJ starcust.OBJ -lm -o $@
X
Xstarpost.exe : $(COBJ) starpost.OBJ starcust.OBJ
X	$ define/user lnk$library sys$library:vaxcrtl.olb
X	$ link/exe=$(mms$target) $(LINKFLAGS) $(mms$source_list)
X#	$(CC) $(LDFLAGS) $(COBJ) starpost.OBJ starcust.OBJ -lm -o $@
X
Xstartek.exe :  $(COBJIMA) startek.OBJ starcust.OBJ
X	$ define/user lnk$library sys$library:vaxcrtl.olb
X	$ link/exe=$(mms$target) $(LINKFLAGS) $(mms$source_list)
X#	$(CC) $(LDFLAGS) ${COBJIMA} startek.OBJ starcust.OBJ -lm -o $@
X
Xstaruplot.exe : $(COBJIMA) staruplot.OBJ starcust.OBJ
X	$(CC) $(LDFLAGS) ${COBJIMA} staruplot.OBJ starcust.OBJ -lm -lplot -o $@
X
XstarX10.exe : ${COBJIMA} starX10.OBJ starcust.OBJ
X	$(CC) $(LDFLAGS) ${COBJIMA} starX10.OBJ starcust.OBJ -lm -lX -o $@
X
XstarX11.exe : $(COBJIM) starX11.OBJ starcust.OBJ
X	$ define/user lnk$library sys$library:vaxcrtl.olb
X	$ link/exe=$(mms$target) $(LINKFLAGS) $(mms$source_list),decwxtk.opt/opt
X#	$(CC) $(LDFLAGS) ${COBJIM} starX11.OBJ starcust.OBJ -lm -lX11 -o $@
X
XstarXaw.exe : starmain_i.OBJ starm2_i.OBJ starsupp.OBJ readfile.OBJ starX11_aw.OBJ \
X		starXaw.OBJ starXawDlog.OBJ starXawHelp.OBJ starXawMwin.OBJ\
X		starcust.OBJ starimages.OBJ parse_input.OBJ $(ATHENA_OBJS)
X	$ define/user lnk$library sys$library:vaxcrtl.olb
X	$ link/exe=$(mms$target) $(LINKFLAGS) $(mms$source_list),decwxtk.opt/opt
X#	$(CC) $(LDFLAGS) starmain_i.OBJ starm2_i.OBJ starsupp.OBJ readfile.OBJ \
X#		starXaw.OBJ starXawDlog.OBJ starXawHelp.OBJ starXawMwin.OBJ \
X#		 starX11_aw.OBJ starcust.OBJ starimages.OBJ parse_input.OBJ\
X#		-lm -lXaw -lXmu -lXt -lX11 -o $@
X
Xstarsunv.exe : starmain_i.OBJ starm2_i.OBJ starsupp.OBJ readfile.OBJ starsunv.OBJ \
X		starcust.OBJ starimages.OBJ parse_input.OBJ interact.OBJ
X	$(CC) $(LDFLAGS) starmain_i.OBJ starm2_i.OBJ starsupp.OBJ readfile.OBJ \
X		starsunv.OBJ starcust.OBJ starimages.OBJ parse_input.OBJ interact.OBJ \
X	        -lm -lsuntool -lsunwindow -lpixrect -o $@
Xstartool.exe : starsunv
X	echo "You must edit startool, startool.tt and startool.sh,"
X	echo "    and install them"
X	echo "You must have the program tooltool,"
X	echo "    which is available from sun PD archives"
X	echo "tooltool -f startool.tt" > startool
X
X# use -DINTERACTIVE_CONTROL in starmain.OBJ and starm2.OBJ
X#     to allow keyboard user interaction
Xstarmain.OBJ : starmain.c Makefile star3.h parse_input.h
X	$(CC) $(CFLAGS) starmain.c -
X	/define=(SYSV,"index=strchr",USE_X_DASHES,RELEASE3_FONTS,INTERACTIVE_CONTROL)
X#	$(CC) $(CFLAGS) -DINTERACTIVE_CONTROL -c starmain.c
X
Xstarm2.OBJ : starm2.c Makefile star3.h
X	$(CC) $(CFLAGS) starm2.c -
X	/define=(SYSV,"index=strchr",USE_X_DASHES,RELEASE3_FONTS,INTERACTIVE_CONTROL)
X#	$(CC) $(CFLAGS) -DINTERACTIVE_CONTROL -c starm2.c
X
Xstarmain_i.OBJ : starmain.c Makefile star3.h parse_input.h
X	- copy starmain.OBJ starmain_n.OBJ
X	$(CC) $(CFLAGS) starmain.c -
X	/define=(SYSV,"index=strchr",USE_X_DASHES,RELEASE3_FONTS,INTERACTIVE_CONTROL)
X#	$(CC) $(CFLAGS) -DINTERACTIVE_CONTROL -c starmain.c
X	COPY starmain.OBJ starmain_i.OBJ
X	- copy starmain_n.OBJ starmain.OBJ
X
Xstarm2_i.OBJ : starm2.c Makefile star3.h
X	- copy starm2.OBJ starm2_n.OBJ
X	$(CC) $(CFLAGS) starm2.c -
X	/define=(SYSV,"index=strchr",USE_X_DASHES,RELEASE3_FONTS,INTERACTIVE_CONTROL)
X#	$(CC) $(CFLAGS) -DINTERACTIVE_CONTROL -c starm2.c
X	COPY starm2.OBJ starm2_i.OBJ
X	- copy starm2_n.OBJ starm2.OBJ
X
Xreadfile.OBJ : readfile.c star3.h
X	$(CC) $(CFLAGS) readfile.c -
X	/define=(SYSV,"index=strchr",USE_X_DASHES,RELEASE3_FONTS)
X
Xstarimages.OBJ : starimages.c star3.h
X	$(CC) $(CFLAGS) starimages.c -
X	/define=(SYSV,"index=strchr",USE_X_DASHES,RELEASE3_FONTS)
X#	$(CC) $(CFLAGS) -c starimages.c
X
X#starimages_a.OBJ defines area operations for drivers which otherwise don't
X#  support them
Xstarimages_a.OBJ : Makefile starimages.c star3.h
X	- copy starimages.OBJ starimages_n.OBJ
X	$(CC) $(CFLAGS) starimages.c -
X	/define=(SYSV,"index=strchr",USE_X_DASHES,RELEASE3_FONTS,AREAS)
X#	$(CC) $(CFLAGS) -DAREAS -c starimages.c
X	COPY starimages.OBJ starimages_a.OBJ
X	- copy starimages_n.OBJ starimages.OBJ
X
XstarX11.OBJ :  starX11.c Makefile icon.h star3.h
X	$(CC) $(CFLAGS) $(XINCLUDES) starX11.c -
X	/define=(SYSV,"index=strchr",USE_X_DASHES,RELEASE3_FONTS,STARX11)
X#	$(CC) $(CFLAGS) $(XINCLUDES) -DSTARX11 -c starX11.c
X
XstarX11_aw.OBJ : starX11.c Makefile icon.h star3.h
X	- copy starX11.OBJ starX11_n.OBJ
X	$(CC) $(CFLAGS) $(XINCLUDES) starX11.c -
X	/define=(SYSV,"index=strchr",USE_X_DASHES,RELEASE3_FONTS,STARXAW)
X#	$(CC) $(CFLAGS) $(XINCLUDES) -DSTARXAW -c starX11.c
X	COPY starX11.OBJ starX11_aw.OBJ
X	- copy starX11_n.OBJ starX11.OBJ
X
XstarXaw.OBJ : starXaw.c star3.h starXaw.h icon.h
X	$(CC) $(CFLAGS) $(XINCLUDES) starXaw.c -
X	/define=(SYSV,"index=strchr",USE_X_DASHES,RELEASE3_FONTS)
X#	$(CC) $(CFLAGS) $(XINCLUDES) -c starXaw.c
X
XstarXawDlog.OBJ : starXawDlog.c star3.h starXaw.h starXawDlog.h
X	$(CC) $(CFLAGS) $(XINCLUDES) starXawDlog.c -
X	/define=(SYSV,"index=strchr",USE_X_DASHES,RELEASE3_FONTS)
X#	$(CC) $(CFLAGS) $(XINCLUDES) -c starXawDlog.c
X
XstarXawHelp.OBJ : starXawHelp.c star3.h starXaw.h
X	$(CC) $(CFLAGS) $(XINCLUDES) starXawHelp.c -
X	/define=(SYSV,"index=strchr",USE_X_DASHES,RELEASE3_FONTS)
X#	$(CC) $(CFLAGS) $(XINCLUDES) -c starXawHelp.c
X
XstarXawMwin.OBJ : starXawMwin.c star3.h starXaw.h
X	$(CC) $(CFLAGS) $(XINCLUDES) starXawMwin.c -
X	/define=(SYSV,"index=strchr",USE_X_DASHES,RELEASE3_FONTS)
X#	$(CC) $(CFLAGS) $(XINCLUDES) -c starXawMwin.c
X
Xstarsunv.OBJ : star3.h
Xinteract.OBJ : star3.h parse_input.h
Xparse_input.OBJ : star3.h parse_input.h
Xstarcust.OBJ : star3.h 
Xstardsp.OBJ : star3.h 
Xstarlaser.OBJ : star3.h 
Xstarpost.OBJ : star3.h 
Xstarsample.OBJ : star3.h 
Xstarsupp.OBJ : star3.h 
Xstartek.OBJ : star3.h 
Xstaruplot.OBJ : star3.h 
END_OF_FILE
echo shar: 1 control character may be missing from \"'starchart/descrip.mms'\"
if test 11285 -ne `wc -c <'starchart/descrip.mms'`; then
    echo shar: \"'starchart/descrip.mms'\" unpacked with wrong size!
fi
# end of 'starchart/descrip.mms'
fi
echo shar: End of archive 7 \(of 32\).
cp /dev/null ark7isdone
MISSING=""
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
    if test ! -f ark${I}isdone ; then
	MISSING="${MISSING} ${I}"
    fi
done
if test "${MISSING}" = "" ; then
    echo You have unpacked all 32 archives.
    rm -f ark[1-9]isdone ark[1-9][0-9]isdone
else
    echo You still need to unpack the following archives:
    echo "        " ${MISSING}
fi
##  End of shell archive.
exit 0