[comp.sources.misc] v11i044: starchart 3.2 Part 16/32

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

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

#! /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 16 (of 32)."
# Contents:  starchart/spo.c.ab
PATH=/bin:/usr/bin:/usr/ucb ; export PATH
if test -f 'starchart/spo.c.ab' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'starchart/spo.c.ab'\"
else
echo shar: Extracting \"'starchart/spo.c.ab'\" \(29553 characters\)
sed "s/^X//" >'starchart/spo.c.ab' <<'END_OF_FILE'
X/*  0 */    { 1.0, 1.0, 1.0 },   /* BLACK */
X/*  1 */    {   0,   0,   0 },   /* WHITE */
X/*  2 */    { 1.0,   0,   0 },   /* RED */
X/*  3 */    { 1.0, 0.4,   0 },   /* ORANGE */
X/*  4 */    { 1.0, 1.0,   0 },   /* YELLOW */
X/*  5 */    {   0, 1.0,   0 },   /* GREEN */
X/*  6 */    {   0, 1.0, 1.0 },   /* CYAN */
X/*  7 */    {   0,   0, 1.0 },   /* BLUE */
X/*  8 */    { 1.0,   0, 1.0 },   /* VIOLET */
X/*  9 */    { .5, .5, 1.0 },   /* BLUE_WHITE */
X    /*         Red             Green           Blue          Nameby which
X	                                                     type is known */
X/* 10 */    { 0.38937,        0.46526,        0.79493 },    /* B0 */
X/* 11 */    { 0.39501,        0.47146,        0.78847 },    /* B1 */
X/* 12 */    { 0.40103,        0.47792,        0.78151 },    /* B2 */
X/* 13 */    { 0.40640,        0.48355,        0.77526 },    /* B3 */
X/* 14 */    { 0.41341,        0.49071,        0.76701 },    /* B5 */
X/* 15 */    { 0.43251,        0.50914,        0.74412 },    /* B8 */
X/* 16 */    { 0.44342,        0.51897,        0.73079 },    /* B9 */
X/* 17 */    { 0.45181,        0.52618,        0.72042 },    /* A0 */
X/* 18 */    { 0.46931,        0.54026,        0.69847 },    /* A2 */
X/* 19 */    { 0.47958,        0.54792,        0.68541 },    /* A3 */
X/* 20 */    { 0.48538,        0.55205,        0.67797 },    /* A5 */
X/* 21 */    { 0.50879,        0.56731,        0.64752 },    /* F0 */
X/* 22 */    { 0.51732,        0.57231,        0.63627 },    /* F2 */
X/* 23 */    { 0.52348,        0.57573,        0.62810 },    /* F5 */
X/* 24 */    { 0.54076,        0.58447,        0.60496 },    /* F8 */
X/* 25 */    { 0.54853,        0.58799,        0.59446 },    /* G0 */
X/* 26 */    { 0.56951,        0.59623,        0.56584 },    /* G5 */
X/* 27 */    { 0.58992,        0.60244,        0.53765 },    /* K0 */
X/* 28 */    { 0.61098,        0.60693,        0.50828 },    /* K2 */
X/* 29 */    { 0.63856,        0.60977,        0.46950 },    /* K5 */
X/* 30 */    { 0.68698,        0.60595,        0.40110 },    /* M0 */
X/* 31 */    { 0.72528,        0.59434,        0.34744 },    /* M2 */
X/* 32 */    { 0.75182,        0.58144,        0.31097 },    /* M3 */
X/* 33 */    { 0.78033,        0.56272,        0.27282 },    /* M4 */
X/* 34 */    { 0.81066,        0.53676,        0.23394 },    /* M5 */
X/* 35 */    { 0.84247,        0.50195,        0.19570 },    /* M6 */
X/* 36 */    { 0.87512,        0.45667,        0.16004 },    /* M7 */
X/* 37 */    { 0.71033,        0.59983,        0.36829 },    /* N0 */
X/* 38 */    { 0.78625,        0.55816,        0.26507 },    /* N3 */
X/* 39 */    { 0.93792,        0.33011,        0.10649 },    /* N8 */
X/* 40 */    { 0.94897,        0.29906,        0.10012 },    /* N9 */
X/* 41 */    { 0.79832,        0.54811,        0.24950 },    /* S4 */
X/* 42 */    { 0.38241,        0.45743,        0.80282 },    /* O  */
X
X/* 43 */    { 0.500, 0, 0},              /* r0 */
X/* 44 */    { 0.750, 0, 0},              /* r3 */
X/* 45 */    { 0.875, 0, 0},              /* r6 */
X/* 46 */    { 1.000, 0, 0},              /* r9 */
X/* 47 */    { 0, 0.500, 0},              /* g0 */
X/* 48 */    { 0, 0.750, 0},              /* g3 */
X/* 49 */    { 0, 0.875, 0},              /* g6 */
X/* 50 */    { 0, 1.000, 0},              /* g9 */
X/* 51 */    { 0, 0, 0.500},              /* b0 */
X/* 52 */    { 0, 0, 0.750},              /* b3 */
X/* 53 */    { 0, 0, 0.875},              /* b6 */
X/* 54 */    { 0, 0, 1.000},              /* b9 */
X/* 55 */    { 0.500, 0.500, 0},          /* y0 */
X/* 56 */    { 0.750, 0.750, 0},          /* y3 */
X/* 57 */    { 0.875, 0.875, 0},          /* y6 */
X/* 58 */    { 1.000, 1.000, 0},          /* y9 */
X/* 59 */    { 0, 0.500, 0.500},          /* c0 */
X/* 60 */    { 0, 0.750, 0.750},          /* c3 */
X/* 61 */    { 0, 0.875, 0.875},          /* c6 */
X/* 62 */    { 0, 1.000, 1.000},          /* c9 */
X/* 63 */    { 0.500, 0, 0.500},          /* p0 */
X/* 64 */    { 0.750, 0, 0.750},          /* p3 */
X/* 65 */    { 0.875, 0, 0.875},          /* p6 */
X/* 66 */    { 1.000, 0, 1.000},          /* p9 */
X/* 67 */    { 0.500, 0.250, 0.000},      /* o0 */
X/* 68 */    { 0.750, 0.375, 0.000},      /* o3 */
X/* 69 */    { 0.875, 0.4375, 0.000},     /* o6 */
X/* 70 */    { 1.000, 0.500, 0.000},      /* o9 */
X/* 71 */    { 0.500, 0.500, 0.500},      /* w0 */
X/* 72 */    { 0.750, 0.750, 0.750},      /* w3 */
X/* 73 */    { 0.875, 0.875, 0.875},      /* w6 */
X/* 74 */    { 1.000, 1.000, 1.000},      /* w9 */
X  };
X
X  if (!color_postscript) return;
X
X  class = 0;
X  while (table[class] && (table[class] != color_str[0])) class++;
X
X  subclass = isdigit(color_str[1]) ? color_str[1] - '0' : 0;
X  colr = table[class] ? 10 + super_spectra[class][subclass] : WHITE;
X
X/*
X    fprintf(outf, "%d '%s' scolor\n", colr, color_str);
X*/
X  if (colr != cur_colr)
X    if (colr == WHITE)
X      fprintf(outf, "0 0 0 srgb\n");
X    else
X      fprintf(outf, "%f %f %f srgb\n",
X	     ctab[colr].r, ctab[colr].g, ctab[colr].b); 
X/*
X      fprintf(outf, "%f %f %f setrgbcolor\n%% %s\n",
X	     ctab[colr].r, ctab[colr].g, ctab[colr].b, color_str); 
X*/
X
X  cur_colr = colr;
X}
X
X/*
Xstatic int c_font = -1, c_size = -1;
Xstatic char *c_fname = "/Times-Roman";
X*/
X/* Set the font and font size to be used for text. */
X/* Note order of args */
XD_fontsize(fsize, font)
X     int fsize;	/* Size of font */
X     int font;	/* e.g. TIMES, HELV, TIMES+ITALIC */
X{
X
X/*  fprintf(outf, "%%fontsize %d %d\n", font, fsize);*/
X
X  /* override some requests */
X  switch(cur_function) {
X  case CHRTOUTLN:
X    break;
X  case CHRTHTICK:
X  case CHRTVTICK:
X    font = TIMESBOLD;
X    break;
X  case GRID_RA:
X  case GRID_DEC:
X  case ECLIPT:
X    break;
X  case CONSTBOUND:
X  case CONSTPATTRN:
X    break;
X  case CONSTNAME:
X    font = HELVITAL;
X    break;
X  case CHARTFILE:
X    break;
X  }
X
X  if ((fsize == c_size) && (font == c_font)) return;
X
X  switch(font) {
X  case TIMESROMAN:
X    c_fname = "/Times-Roman";
X    break;
X  case TIMESBOLD:
X    c_fname = "/Times-Bold";
X    break;
X  case TIMESITAL:
X    c_fname = "/Times-Italic";
X    break;
X  case TIMESBOLDITAL:
X    c_fname = "/Times-BoldItalic";
X    break;
X  case HELV:
X    c_fname = "/Helvetica";
X    break;
X  case HELVBOLD:
X    c_fname = "/Helvetica-Bold";
X    break;
X  case HELVITAL:
X    c_fname = "/Helvetica-Oblique";
X    break;
X  case HELVBOLDITAL:
X    c_fname = "/Helvetica-BoldOblique";
X    break;
X  case COURIER:
X    c_fname = "/Courier";
X    break;
X  case COURBOLD:
X    c_fname = "/Courier-Bold";
X    break;
X  case COURITAL:
X    c_fname = "/Courier-Oblique";
X    break;
X  case COURITALBOLD:
X    c_fname = "/Courier-BoldOblique";
X    break;
X  default:
X    font = CURNTFONT;
X    break;
X  };
X
X/* This doesn't work, since currentfont is already scaled
X  if (font == CURNTFONT)
X    fprintf(outf, "%d cfsize\n", fsize);
X  else
X    fprintf(outf, "%d %s fontsz\n", fsize, c_fname);
X*/
X
X  fprintf(outf, "%d %s fontsz\n", fsize, c_fname);
X  c_size = fsize;
X  c_font = font;
X}
X/* This routine is encouraged to look at the extern cur_funtion
X   and change the font used as desired */
X
X/*
X * Additions for Greek fonts
X */
Xstatic char  *intable = " abgdezh@iklmnEoprstu0x%w";
Xstatic char *outtable = " abgdezhqiklmnxoprstujcyw";
X
X/* Display text string str at x,y, in current font and font size.
X   if star_lbl is TRUE, string is a star label, use
X      greek characters (if possible) */
XD_text(x, y, str, star_lbl)
X     int x, y;
X     char *str;
X     int star_lbl;
X{
X  char ch;
X  int i, j, k;
X
X
X  /* Note: this ends current line */
X  D_move(x,y);
X
X  /* Always issue a moveto.  D_move won't if current point is the point
X     to move to.  For text which follows a previous text, this is wrong.
X     e.g. "100 100 mt (asdf) lbshw (jkl) lbshw" produces "asdfjkl" instead
X     of overwriting asdf with jkl. */
X  fprintf(outf, "%d %d mt\n", x, y);
X
X  if (!star_lbl) {
X    fprintf(outf, "(%s) lbshw\n", str);
X  } else {
X    if (isgreek(str[0]) && (isdigit(str[1]) || (str[1] == ' '))) {
X      /* Greek if first character is greek encoded,
X	 and the second is space or a digit */
X      /* Translate yaleformat greek encoding to Symbol font encoding */
X#ifdef OLD_GREEK
X      i = 0;
X      while (ch = str[i])
X	{
X	  j = 0;
X	  while (intable[j] && (intable[j] != ch)) j++;
X	  str[i] = intable[j] ? outtable[j] : str[i];
X	  /* If not in translation table, leave it alone */
X	  i++;
X	}
X#endif
X      fprintf(outf, "(%s) gshow\n", str);
X    } else { /* Star label, but not greek */
X	/* remove leading spaces */
X	while (*str == ' ') str++;
X	fprintf(outf, "(%s) obshw\n", str);
X    }
X  }
X
X  vecstate = S_UNDEF;
X}
X
Xisgreek(c)
Xchar c;
X{
X  char *cp;
X
X#ifdef OLD_GREEK
X  cp = "abgdezh@iklmnEoprstuOx%w";
X#else
X  cp = "abgdezhqiklmnxoprstujcywf"; /* f and j are both phi */ 
X#endif
X  while (*cp && (*cp != c)) cp++;
X  return (*cp != '\0'); /* True if letter was in greek string */
X}
X
X
X
X/* Return input coordinate in device coords where there are pointing devices */
XD_inxy(x, y)
X     int *x, *y;
X{
X}
X
X
X/* Put non-displayed comment in output.  Allowed in postscript, but
X   few other drivers will be able to support this. */ 
XD_comment(str)
X     char *str;
X{
X  fprintf(outf, "%%%s\n", str);
X}
X
X
X/**
XHigher level functions
X**/
X
X/* Point sizes for font calls */
X#define TITLESIZE 16
X#define SUBTLSIZE 12
X#define NAMESIZE 10
X#define LBLSIZE 8
X#define MAGSIZE 8
X
X/* Fonts for font calls */
X#define NAMEFNT TIMESROMAN
X#define LBLFNT HELV
X#define MAGFNT COURIER
X#define TITLEFNT TIMESBOLD
X#define SUBTLFNT TIMESROMAN
X
Xint x_nameoffset = MAG0_RAD+ResPT, y_nameoffset = 0;
Xint x_lbloffset = MAG3_RAD, y_lbloffset = MAG3_RAD+ResPT/2;
Xint x_magoffset = MAG3_RAD+ResPT, y_magoffset = -MAG3_RAD-ResPT;
X
X/* Interface Function */
X/* Draw object at x, y.  properties set by other parameters */
Xdrawobj(x, y, mag, type, color_str, label_field, con_str, obj_name,
X	comment_str, file_line,
X	draw_glyph, draw_text, use_lbl, use_name, use_mag)
X
X     int x, y;
X     double mag;	/* Magnitude of object */
X     char *type;	/* 2 chars, object code and subcode */
X     char *color_str;	/* 2 chars, spectral type for stars, 
X			   color code otherwise */
X     char *label_field;	/* 2 chars, Bayer or flamsteed for stars,
X			   size in seconds for nebulae and
X			   planets */
X     char *con_str;	/* 3 chars, the constellation the object is in */
X     char *obj_name;	/* Name of object */
X     char *comment_str;	/* Comment field */
X     char *file_line;	/* The full line from the file,
X			   containing the above if it is in
X			   standard format */
X     int draw_glyph;	/* Draw object symbol */
X     int draw_text;	/* Draw text */
X     int use_lbl;	/* Label object with the label_field string */
X     int use_name;	/* Label object with the obj_name string */
X     int use_mag;	/* Label object with a 2 or 3 character string
X			   containing the magnitude * 10 without
X			   decimal point */
X{
X  char magstr[10];
X
X/*fprintf(stderr, "%d %d %f <%s> <%s> <%s> <%s> <%s> <%s> <%s>\n", x, y, mag,
X	type, color_str, label_field, con_str, obj_name, comment_str,
X	file_line);*/
X
X  if (draw_glyph)
X    switch(type[0]) {
X    case 'S':	drawStar(x,y,mag,type[1],color_str);
X      break;
X    case 'P':	drawPlan(x,y,mag,type[1],color_str, size_obj(label_field),
X			 comment_str);
X      break;
X    case 'N':	drawNebu(x,y,mag,type[1],color_str, size_obj(label_field));
X      break;
X    case 'G':	drawGalx(x,y,mag,type[1],color_str, size_obj(label_field));
X      break;
X    case 'C':	drawClus(x,y,mag,type[1],color_str, size_obj(label_field));
X      break;
X    case 'U':
X      drawUnknown(x,y,mag,type[1],color_str, size_obj(label_field));
X      break;
X    case 'O':
X      drawOther(x,y,mag,type[1],color_str, size_obj(label_field));
X      break;
X    case 'V':
X    case 'A':
X    case 'I':
X      break;
X    case '#':
X    default:
X      break;
X    };
X
X
X/*
X * use name or label
X */
X  if (draw_text) {
X    if (type[0] == 'I')
X      D_color(color_str);
X    else
X      D_color("  ");
X
X    if (use_name && obj_name[0]) {
X      D_fontsize(NAMESIZE, NAMEFNT);
X      D_text(x+x_nameoffset, y+y_nameoffset, obj_name, FALSE);
X    } else if (use_lbl &&
X	       ((label_field[0] != ' ') || (label_field[1] != ' '))) {
X      D_fontsize(LBLSIZE, LBLFNT);
X      D_text(x+x_lbloffset, y+y_lbloffset, label_field, TRUE);
X    }
X/* If you want to mag label other objects, change this */
X    if (use_mag && (type[0] == 'S')) {
X      sprintf(magstr, "%02d", (int)(mag*10.0+0.5));
X      D_fontsize(MAGSIZE, MAGFNT);
X      D_text(x+x_magoffset, y+y_magoffset, magstr, FALSE);
X    }
X  }
X}
X
XdrawStar(x, y, mag, type, color)
X     int x, y;
X     double mag;
X     char type, *color;
X{
X  char *code;
X  double truemag = mag;
X
X/* Not used anymore, all labels are the same size.
X  switch ((int)(mag+0.5))
X    {
X    case -1: D_fontsize(18, CURNTFONT); break;
X    case  0: D_fontsize(18, CURNTFONT); break;
X    case  1: D_fontsize(16, CURNTFONT); break;
X    case  2: D_fontsize(14, CURNTFONT); break;
X    case  3: D_fontsize(12, CURNTFONT); break;
X    case  4: D_fontsize(8, CURNTFONT); break;
X    default: D_fontsize(6, CURNTFONT); break;
X    }
X*/
X
X  if (cur_map_type == THUMBNAIL) mag += thumbshift;
X				/* Shrink stars for thumbnail */
X  else {
X    if (mag < brightest_used) brightest_used = mag;
X    if (mag > faintest_used) faintest_used = mag;
X  }
X
X  if (mag<MAG_BRIGHT) mag = MAG_BRIGHT;
X  if (mag>MAG_DIM) mag = MAG_DIM;
X
X  switch (type)
X    {
X    default:
X    case 'S': code = "s"; break;
X    case 'D': code = "d"; break;
X    case 'V': code = "v"; break;
X    }
X
X  /* Note: this ends current line */
X  D_move(x,y);
X
X  D_color(color);
X  if (use_fine_mag) {
X    /* use fine magnitude scale */
X#ifdef USE_FINE_MACROS
X    if ((mag*10+0.5) < 0)
X      fprintf(outf, "%d %d s%s_%02d\n", x, y, code, - (int) (mag*10+0.5));
X    else
X      fprintf(outf, "%d %d s%s%02d\n", x, y, code, (int) (mag*10+0.5));
X#else
X    fprintf(outf, "%d %d %d %s %% %.2f\n", x, y,
X	   mag10sizes[(int) ((mag - MAG_BRIGHT)*10.0)], code, truemag);
X#endif
X  }else {
X    if (mag < -0.5) /* rounded mag is less than 0 */
X      fprintf(outf, "%d %d %s_1\n", x, y, code); /* MAG_BRIGHT == -1 */
X    else
X      fprintf(outf, "%d %d %s%d\n", x, y, code, (int) (mag+0.5));
X  }
X
X  vecstate = S_UNDEF;
X}
X
XdrawPlan(x, y, mag, type, color, plansize, comment_str)
X     int x,y;
X     double mag;
X     char type, *color;
X     long plansize;
X     char *comment_str;
X{
X  int diam;
X  int n;
X  double phase, chi;
X
X  /* Note: this ends current line */
X  D_move(x,y);
X
X  D_color(color);
X  fprintf(outf, "%%diam %.3f\n", (plansize/(3600.*xf_c_scale)+.5));
X  diam = (int) (plansize/(3600.*xf_c_scale)+.5);
X  if (diam < 12*ResPT)
X    diam = 12*ResPT;
X/*
Xfprintf(outf, "%%xf_c_scale %f\n", xf_c_scale);
Xfprintf(outf, "%%size %d\n", plansize);
Xfprintf(outf, "%%points %f\n", plansize/(3600.*xf_c_scale));
Xfprintf(outf, "%%diam %d\n", diam);*/
X
X  switch(type)
X    {
X    case 'A': fprintf(outf, "%d %d %d asteroid\n", x, y, diam); break;
X    case 'C':
X      phase = 45.0;
X      n = sscanf(comment_str, "%lf", &phase);
X      fprintf(outf, "%%phase %f\n", phase);
X      if (cur_win->invert) phase = 180 - phase;
X      fprintf(outf, "%d %d %f %d comet\n", x, y, phase, diam);
X      break;
X
X    case 'S': fprintf(outf, "%d %d %d sun\n", x, y, diam); break;
X    case 'L':
X      phase = 0.0;
X      chi = 90.0;
X      n = sscanf(comment_str, "%lf %lf", &phase, &chi);
X      fprintf(outf, "%%phase: %f chi: %f\n", phase, chi);
X      if (cur_win->invert) chi = 180 - chi;
X      fprintf(outf, "%d %d %d %f %f moon\n", x, y, diam, phase, chi);
X      break;
X
X    case 'M': fprintf(outf, "%d %d %d mercury\n", x, y, diam); break;
X    case 'V': fprintf(outf, "%d %d %d venus\n", x, y, diam); break;
X    case 'm': fprintf(outf, "%d %d %d mars\n", x, y, diam); break;
X    case 'J': fprintf(outf, "%d %d %d jupiter\n", x, y, diam); break;
X    case 's': fprintf(outf, "%d %d %d saturn\n", x, y, diam); break;
X    case 'U': fprintf(outf, "%d %d %d uranus\n", x, y, diam); break;
X    case 'N': fprintf(outf, "%d %d %d neptune\n", x, y, diam); break;
X    case 'P': fprintf(outf, "%d %d %d pluto\n", x, y, diam); break;
X    default:  fprintf(outf, "%d %d %d planet\n", x, y, diam);
X    }
X
X  vecstate = S_UNDEF;
X  D_color("  ");
X}
X
XdrawGalx(x, y, mag, type, color, nebsize)
X     int x,y;
X     double mag;
X     char type, *color;
X     long nebsize;		/* -1 should give default size */
X{
X  int diam;
X
X  /* Note: this ends current line */
X  D_move(x,y);
X  D_color(color);
X
X  diam = (int) (nebsize/(3600.*xf_c_scale)+.5);
X  if (diam < 6*ResPT)
X    diam = 6*ResPT;
X/*
Xfprintf(outf, "%%xf_c_scale %f\n", xf_c_scale);
Xfprintf(outf, "%%size %d\n", nebsize);
Xfprintf(outf, "%%points %f\n", nebsize/(3600.*xf_c_scale));
Xfprintf(outf, "%%diam %d\n", diam);*/
X
X  switch(type)
X    {
X    case 'a':
X    case 'b':
X    case 'c':
X    case 'd':
X    case 'B':
X    case 'S':
X    case 'O':
X      fprintf(outf, "%d %d %d galaxys\n", x, y, diam);
X      break;
X    case 'Q':
X      fprintf(outf, "%d %d %d galaxyq\n", x, y, diam);
X      break;
X    case 'E':
X    case 'I':
X    case 'G':
X      fprintf(outf, "%d %d %d galaxye\n", x, y, diam);
X      break;
X    default:
X      fprintf(outf, "%d %d %d galaxy\n", x, y, diam);
X    }
X
X  vecstate = S_UNDEF;
X  D_color("  ");
X}
X
XdrawNebu(x, y, mag, type, color, nebsize)
X     int x,y;
X     double mag;
X     char type, *color;
X     long nebsize;		/* -1 should give default size */
X{
X  int diam;
X
X  /* Note: this ends current line */
X  D_move(x,y);
X  D_color(color);
X
X  diam = (int) (nebsize/(3600.*xf_c_scale)+.5);
X  if (diam < 6*ResPT)
X    diam = 6*ResPT;
X/*
Xfprintf(outf, "%%xf_c_scale %f\n", xf_c_scale);
Xfprintf(outf, "%%size %d\n", nebsize);
Xfprintf(outf, "%%points %f\n", nebsize/(3600.*xf_c_scale));
Xfprintf(outf, "%%diam %d\n", diam);*/
X
X  switch(type)
X    {
X    case 'P': fprintf(outf, "%d %d %d nebulap\n", x, y, diam); break;
X    case 'D': fprintf(outf, "%d %d %d nebulad\n", x, y, diam); break;
X    default:  fprintf(outf, "%d %d %d nebula\n", x, y, diam);
X    }
X
X  vecstate = S_UNDEF;
X  D_color("  ");
X}
X
XdrawClus(x, y, mag, type, color, nebsize)
X     int x,y;
X     double mag;
X     char type, *color;
X     long nebsize;		/* -1 should give default size */
X{
X  int diam;
X
X  /* Note: this ends current line */
X  D_move(x,y);
X  D_color(color);
X
X  diam = (int) (nebsize/(3600.*xf_c_scale)+.5);
X  if (diam < 6*ResPT)
X    diam = 6*ResPT;
X/*
Xfprintf(outf, "%%xf_c_scale %f\n", xf_c_scale);
Xfprintf(outf, "%%size %d\n", nebsize);
Xfprintf(outf, "%%points %f\n", nebsize/(3600.*xf_c_scale));
Xfprintf(outf, "%%diam %d\n", diam);*/
X  switch(type)
X    {
X    case 'G': fprintf(outf, "%d %d %d clusterg\n", x, y, diam); break;
X    case 'O': fprintf(outf, "%d %d %d clustero\n", x, y, diam); break;
X    default: fprintf(outf, "%d %d %d cluster\n", x, y, diam);
X    }
X
X  vecstate = S_UNDEF;
X  D_color("  ");
X}
X
XdrawUnknown(x, y, mag, type, color, nebsize)
X     int x,y;
X     double mag;
X     char type, *color;
X     long nebsize;		/* -1 should give default size */
X{
X  int diam;
X
X  /* Note: this ends current line */
X  D_move(x,y);
X  D_color(color);
X
X  diam = (int) (nebsize/(3600.*xf_c_scale)+.5);
X  if (diam < 6*ResPT)
X    diam = 6*ResPT;
X/*
Xfprintf(outf, "%%xf_c_scale %f\n", xf_c_scale);
Xfprintf(outf, "%%size %d\n", nebsize);
Xfprintf(outf, "%%points %f\n", nebsize/(3600.*xf_c_scale));
Xfprintf(outf, "%%diam %d\n", diam);*/
X
X  switch(type)
X    {
X    default:  fprintf(outf, "%d %d %d unknown_u\n", x, y, diam);
X    }
X
X  vecstate = S_UNDEF;
X  D_color("  ");
X}
X
X
XdrawOther(x, y, mag, type, color, nebsize)
X     int x,y;
X     double mag;
X     char type, *color;
X     long nebsize;		/* -1 should give default size */
X{
X  int diam;
X
X  /* Note: this ends current line */
X  D_move(x,y);
X  D_color(color);
X
X  diam = (int) (nebsize/(3600.*xf_c_scale)+.5);
X  if (diam < 6*ResPT)
X    diam = 6*ResPT;
X/*
Xfprintf(outf, "%%xf_c_scale %f\n", xf_c_scale);
Xfprintf(outf, "%%size %d\n", nebsize);
Xfprintf(outf, "%%points %f\n", nebsize/(3600.*xf_c_scale));
Xfprintf(outf, "%%diam %d\n", diam);*/
X  switch(type)
X    {
X    default:  fprintf(outf, "%d %d %d other_o\n", x, y, diam);
X    }
X
X  vecstate = S_UNDEF;
X  D_color("  ");
X}
X
X
X/* Want three legend columns, in 10 rows, with a title and subtitle above:
Xtitle
Xsubtitle (ra, dec, lim)
X
X    -1                0                1
X     2                3                4
X     5                6                7
X     8                9               10
X     double           variable
X     planet           asteroid        comet
X     cluster          globular        open
X     nebula           planetary       diffuse
X     galaxy           elliptical      spiral
X     unknown          other           quasar
X
Xstar columns x coordinates are at star_x_col[];
Xstar row y coordinates are star_y_row[];
Xother at oth_x_col[] and oth_y_row[];
X
Xtitle and subtitle coordinates are defined by L_TIL_{X,Y} and L_STIL_{X,Y}
XLabels are placed as in drawobj().
X
Xfor fullpage map, only the title and subtitle are displayed, on one line. */
X
Xstatic int star_x_col[] = {
X  36*ResPT,
X  108*ResPT,
X  180*ResPT,
X  36*ResPT,
X  108*ResPT,
X  180*ResPT,
X  36*ResPT,
X  108*ResPT,
X  180*ResPT,
X  36*ResPT,
X  108*ResPT,
X  180*ResPT,
X  36*ResPT,
X  108*ResPT,
X  180*ResPT};
X
Xstatic int oth_x_col[] = {
X  36*ResPT,
X  108*ResPT,
X  180*ResPT,
X  36*ResPT,
X  108*ResPT,
X  180*ResPT,
X  36*ResPT,
X  108*ResPT,
X  180*ResPT,
X  36*ResPT,
X  108*ResPT,
X  180*ResPT,
X  36*ResPT,
X  108*ResPT,
X  180*ResPT};
X
X
X#define L_TIL_X 36*ResPT
X#define L_TIL_Y 180*ResPT
X#define L_STIL_X 36*ResPT
X#define L_STIL_Y (L_TIL_Y - 18*ResPT)
X
X/* (let ((i 0))
X  (while (< i 10)
X    (princ (format "\n  %d*ResPT," (+ 36 (* (- 9 i) 12))))
X    (setq i (1+ i)))
X    nil) */
X
Xstatic int star_y_row[] = {
X  144*ResPT,
X  144*ResPT,
X  144*ResPT,
X  132*ResPT,
X  132*ResPT,
X  132*ResPT,
X  120*ResPT,
X  120*ResPT,
X  120*ResPT,
X  108*ResPT,
X  108*ResPT,
X  108*ResPT,
X  96*ResPT,
X  96*ResPT,
X  96*ResPT
X};
X
Xstatic int oth_y_row[] = {
X  84*ResPT,
X  84*ResPT,
X  84*ResPT,
X  72*ResPT,
X  72*ResPT,
X  72*ResPT,
X  60*ResPT,
X  60*ResPT,
X  60*ResPT,
X  48*ResPT,
X  48*ResPT,
X  48*ResPT,
X  36*ResPT,
X  36*ResPT,
X  36*ResPT};
X
Xstatic int starmags[12];
Xstatic int magbright, magfaint;
X#define L_X_FULLPAGE_CAPT 18*ResPT
X#define L_Y_FULLPAGE_CAPT 25*ResPT
X
Xchartlegend(win)
X     mapwindow *win;
X{
X  char ras[20], dls[20], outstr[40], magstr[20];
X  int i, j, xcen, ycen;
X  int nummags;
X
X  if (!title[0]) title = "LEGEND";
X  rastr(ras, win->racen);
X  declstr(dls, win->dlcen);
X
X  if (win->map_type != FULLPAGEMAP) {
X    sprintf(outstr, "(%s,%s lim: %2.1f)", ras, dls, win->maglim);
X    D_fontsize(TITLESIZE, TITLEFNT); D_text(L_TIL_X, L_TIL_Y, title, FALSE);
X    D_fontsize(SUBTLSIZE, SUBTLFNT); D_text(L_STIL_X, L_STIL_Y, outstr, FALSE);
X
X    D_fontsize(10, NAMEFNT);
X
X    /* set magnitudes in legend */
X
X    if (brightest_used > faintest_used) {
X      brightest_used = 0.0;
X      faintest_used = 10.0;
X    }
X
X    magbright = brightest_used - 0.5;
X    magfaint = faintest_used + 0.5;
X    if (magfaint > MAG_DIM) magfaint = MAG_DIM;
X    if (magbright < MAG_BRIGHT) magbright = MAG_BRIGHT;
X    if (magbright < (magfaint - 11)) magbright = (magfaint - 11);
X    nummags = magfaint - magbright + 1;
X    for (i = magbright; i <= magfaint; i++) {
X      starmags[i-magbright] = i;
X    }
X
X    for (i = 0; i < nummags; i++) {
X      drawStar(star_x_col[i], star_y_row[i], (double) starmags[i], 'S', "  ");
X      sprintf(magstr, " %d", starmags[i]);
X      D_text(star_x_col[i]+x_nameoffset, star_y_row[i]+y_nameoffset,
X	     magstr, FALSE);
X    }
X
X    drawStar(star_x_col[13], star_y_row[13],
X	     ((magbright+magfaint)/2.0),
X	     'D', "  ");
X    D_text(star_x_col[13]+x_nameoffset, star_y_row[13]+y_nameoffset,
X	   "double", FALSE);
X
X    drawStar(star_x_col[14], star_y_row[14],
X	     ((magbright+magfaint)/2.0),
X	     'V', "  ");
X    D_text(star_x_col[14]+x_nameoffset, star_y_row[14]+y_nameoffset,
X	   "variable", FALSE);
X
X
X
X    i = 0;
X    drawPlan(oth_x_col[i], oth_y_row[i], 1.0, 'u', "  ", (long) -1, "");
X    D_text(oth_x_col[i]+x_nameoffset, oth_y_row[i]+y_nameoffset,
X	   "Planet", FALSE);
X    i++;
X
X    drawPlan(oth_x_col[i], oth_y_row[i], 1.0, 'A', "  ", (long) -1, "");
X    D_text(oth_x_col[i]+x_nameoffset, oth_y_row[i]+y_nameoffset,
X	   "Asteroid", FALSE);
X    i++;
X
X    drawPlan(oth_x_col[i], oth_y_row[i], 1.0, 'C', "  ", (long) -1, "");
X    D_text(oth_x_col[i]+x_nameoffset, oth_y_row[i]+y_nameoffset,
X	   "Comet", FALSE);
X    i++;
X
X    drawClus(oth_x_col[i], oth_y_row[i], 1.0, 'u', "  ", (long) -1);
X    D_text(oth_x_col[i]+x_nameoffset, oth_y_row[i]+y_nameoffset,
X	   "Cluster", FALSE);
X    i++;
X
X    drawClus(oth_x_col[i], oth_y_row[i], 1.0, 'G', "  ", (long) -1);
X    D_text(oth_x_col[i]+x_nameoffset, oth_y_row[i]+y_nameoffset,
X	   "Globular", FALSE);
X    i++;
X
X    drawClus(oth_x_col[i], oth_y_row[i], 1.0, 'O', "  ", (long) -1);
X    D_text(oth_x_col[i]+x_nameoffset, oth_y_row[i]+y_nameoffset,
X	   "Open", FALSE);
X    i++;
X
X
X    drawNebu(oth_x_col[i], oth_y_row[i], 1.0, 'u', "  ", (long) -1);
X    D_text(oth_x_col[i]+x_nameoffset, oth_y_row[i]+y_nameoffset,
X	   "Nebula", FALSE);
X    i++;
X
X    drawNebu(oth_x_col[i], oth_y_row[i], 1.0, 'P', "  ", (long) -1);
X    D_text(oth_x_col[i]+x_nameoffset, oth_y_row[i]+y_nameoffset,
X	   "Planetary", FALSE);
X    i++;
X
X    drawNebu(oth_x_col[i], oth_y_row[i], 1.0, 'D', "  ", (long) -1);
X    D_text(oth_x_col[i]+x_nameoffset, oth_y_row[i]+y_nameoffset,
X	   "Diffuse", FALSE);
X    i++;
X
X
X    drawGalx(oth_x_col[i], oth_y_row[i], 1.0, 'u', "  ", (long) -1);
X    D_text(oth_x_col[i]+x_nameoffset, oth_y_row[i]+y_nameoffset,
X	   "Galaxy", FALSE);
X    i++;
X
X    drawGalx(oth_x_col[i], oth_y_row[i], 1.0, 'E', "  ", (long) -1);
X    D_text(oth_x_col[i]+x_nameoffset, oth_y_row[i]+y_nameoffset,
X	   "Elliptical", FALSE);
X    i++;
X
X    drawGalx(oth_x_col[i], oth_y_row[i], 1.0, 'S', "  ", (long) -1);
X    D_text(oth_x_col[i]+x_nameoffset, oth_y_row[i]+y_nameoffset,
X	   "Spiral", FALSE);
X    i++;
X
X
X    drawUnknown(oth_x_col[i], oth_y_row[i], 1.0, 'u', "  ", (long) -1);
X    D_text(oth_x_col[i]+x_nameoffset, oth_y_row[i]+y_nameoffset,
X	   "Unknown", FALSE);
X    i++;
X
X    drawOther(oth_x_col[i], oth_y_row[i], 1.0, 'o', "  ", (long) -1);
X    D_text(oth_x_col[i]+x_nameoffset, oth_y_row[i]+y_nameoffset,
X	   "Other", FALSE);
X    i++;
X
X    drawGalx(oth_x_col[i], oth_y_row[i], 1.0, 'Q', "  ", (long) -1);
X    D_text(oth_x_col[i]+x_nameoffset, oth_y_row[i]+y_nameoffset,
X	   "Quasar", FALSE);
X    i++;
X
X    /* Notebook mode */
X#define NOTE_LEFT_COL 306
X#define NOTE_RIGHT_COL 486
X#define NOTE_TOP_ROW 144
X#define NOTE_ROW_SPACE 14*ResPT
X    i = 0;
X    if (notebook_mode) {
X      /* draw views */
X      out("gsave");
X      out("1 setlinewidth 2 setlinecap");
X      out("[] 0 setdash 0 setgray");
X      xcen = win->width/2 + win->x_offset;
X      ycen = win->height/2 + win->y_offset;
X      for (j = 0; j< numviews; j++) {
X	fprintf(outf, "    newpath %d %d %f 0 360 arc stroke\n",
X	       xcen, ycen, viewrad[j]/win->c_scale);
X      };
Xout("grestore");
X      out("12 /Helvetica fontsz");
X      out("/rjust { dup stringwidth pop neg 0 rmoveto show} def");
X      fprintf(outf, "%d %d mt", NOTE_LEFT_COL*ResPT,
X	     NOTE_TOP_ROW*ResPT - i*NOTE_ROW_SPACE);
X      out("(Date:) rjust");
X      fprintf(outf, "%d %d mt", NOTE_RIGHT_COL*ResPT,
X	     NOTE_TOP_ROW*ResPT - i*NOTE_ROW_SPACE);
X      out("(Time:) rjust");
X      i++;
X
X      fprintf(outf, "%d %d mt", NOTE_LEFT_COL*ResPT,
X	     NOTE_TOP_ROW*ResPT - i*NOTE_ROW_SPACE);
X      out("(Object Altitude:) rjust");
X      fprintf(outf, "%d %d mt", NOTE_RIGHT_COL*ResPT,
X	     NOTE_TOP_ROW*ResPT - i*NOTE_ROW_SPACE);
X      out("() rjust");
X      i++;
X
X      fprintf(outf, "%d %d mt", NOTE_LEFT_COL*ResPT,
X	     NOTE_TOP_ROW*ResPT - i*NOTE_ROW_SPACE);
X      out("(Instrument:) rjust");
X      fprintf(outf, "%d %d mt", NOTE_RIGHT_COL*ResPT,
X	     NOTE_TOP_ROW*ResPT - i*NOTE_ROW_SPACE);
X      out("() rjust");
X      i++;
X
X      fprintf(outf, "%d %d mt", NOTE_LEFT_COL*ResPT,
X	     NOTE_TOP_ROW*ResPT - i*NOTE_ROW_SPACE);
X      out("(Eyepiece:) rjust");
X      fprintf(outf, "%d %d mt", NOTE_RIGHT_COL*ResPT,
X	     NOTE_TOP_ROW*ResPT - i*NOTE_ROW_SPACE);
X      out("(Filter:) rjust");
X      i++;
X
X      fprintf(outf, "%d %d mt", NOTE_LEFT_COL*ResPT,
X	     NOTE_TOP_ROW*ResPT - i*NOTE_ROW_SPACE);
X      out("(Site:) rjust");
X      fprintf(outf, "%d %d mt", NOTE_RIGHT_COL*ResPT,
X	     NOTE_TOP_ROW*ResPT - i*NOTE_ROW_SPACE);
X      out("() rjust");
X      i++;
X
X      fprintf(outf, "%d %d mt", NOTE_LEFT_COL*ResPT,
X	     NOTE_TOP_ROW*ResPT - i*NOTE_ROW_SPACE);
X      out("(Seeing:) rjust");
X      fprintf(outf, "%d %d mt", NOTE_RIGHT_COL*ResPT,
X	     NOTE_TOP_ROW*ResPT - i*NOTE_ROW_SPACE);
X      out("(Transparency:) rjust");
X      i++;
X
X      fprintf(outf, "%d %d mt", NOTE_LEFT_COL*ResPT,
X	     NOTE_TOP_ROW*ResPT - i*NOTE_ROW_SPACE);
X      out("(Darkness:) rjust");
X      fprintf(outf, "%d %d mt", NOTE_RIGHT_COL*ResPT,
X	     NOTE_TOP_ROW*ResPT - i*NOTE_ROW_SPACE);
X      out("(Magnitude limit:) rjust");
X      i++;
X
X      fprintf(outf, "%d %d mt", NOTE_LEFT_COL*ResPT,
X	     NOTE_TOP_ROW*ResPT - i*NOTE_ROW_SPACE);
X      out("(Wind:) rjust");
X      fprintf(outf, "%d %d mt", NOTE_RIGHT_COL*ResPT,
X	     NOTE_TOP_ROW*ResPT - i*NOTE_ROW_SPACE);
X      out("() rjust");
X      i++;
X
X      fprintf(outf, "%d %d mt", NOTE_LEFT_COL*ResPT,
X	     NOTE_TOP_ROW*ResPT - i*NOTE_ROW_SPACE);
X      out("(Temperature:) rjust");
X      fprintf(outf, "%d %d mt", NOTE_RIGHT_COL*ResPT,
X	     NOTE_TOP_ROW*ResPT - i*NOTE_ROW_SPACE);
X      out("(Dew:) rjust");
X      i++;
X    };
X
X  } else {
X    D_fontsize(8, NAMEFNT);
X    sprintf(outstr, "%s: %s,%s lim: %2.1f", title, ras, dls, win->maglim);
X    D_text(L_X_FULLPAGE_CAPT, L_Y_FULLPAGE_CAPT, outstr, FALSE);
X  }
X}
X
X
X
END_OF_FILE
if test 29553 -ne `wc -c <'starchart/spo.c.ab'`; then
    echo shar: \"'starchart/spo.c.ab'\" unpacked with wrong size!
fi
# end of 'starchart/spo.c.ab'
fi
echo shar: End of archive 16 \(of 32\).
cp /dev/null ark16isdone
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