#!/usr/bin/perl
#

# speed of light, in m/sec
$c = 299792458.0;

  # plot a small section of spectrum of Sun and Arcturus,
  #   at their observed wavelengths
  $output_file = "sun_arc_spec_a.ps";
  $term_options = "postscript color enhanced 'Helvetica,18' ";

  $cmdfile = "gnuplot.in";
  
  open (CMDFILE, ">$cmdfile") || die("can't open $cmdfile for writing");
  printf CMDFILE "set output '$output_file' \n";
  printf CMDFILE "set term $term_options \n";
  printf CMDFILE "set grid \n";
  printf CMDFILE "set key top right \n";
  printf CMDFILE "set ylabel 'Intensity of light ' \n";
  printf CMDFILE "set xlabel 'Wavelength (nm) ' \n";
#  printf CMDFILE "set title 'Spectra of Sun and Arcturus '\n";
  
  $cmd = "plot [882.0:885.0][0.0:1.2] './arcturus_nm.dat' ";
  $cmd .= "          using (\$1):(\$4) with lines lt 1 lc 1 lw 3 t 'Arcturus' ";
  $cmd .= " , ";
  $cmd .= "                            './solar_nm.dat' ";
  $cmd .= "          using (\$1):(\$2) with lines lt 1 lc -1 lw 3 t 'Sun' ";

  printf CMDFILE "$cmd \n";
  printf CMDFILE "set output \n";
  printf CMDFILE "quit \n";
  close(CMDFILE) ;
  
  $retval = `gnuplot < $cmdfile`;
  printf "retval is ..%s..\n", $retval;
  
  if ($term_options =~ /postscript/) {
    $psfile = $output_file;
    $giffile = $psfile;
    $giffile =~ s/.ps/.png/;
    $cmd = "convert -rotate 90 $psfile $giffile";
    printf "cmd is ..$cmd.. \n";
    $ret = `$cmd`;
  }



  # Arcturus speed in m/s
  $base_v = 10000.0;

  # plot a small section of spectrum of Sun and Arcturus,
  #   with Arcturus moving at +10 km/s
  $this_v = 1.0*$base_v;
  $ratio = 1.0 + ($this_v/$c);
  printf " ratio is %10.6f \n", $ratio;

  $output_file = "sun_arc_spec_b.ps";
  $term_options = "postscript color enhanced 'Helvetica,18' ";

  $cmdfile = "gnuplot.in";
  
  open (CMDFILE, ">$cmdfile") || die("can't open $cmdfile for writing");
  printf CMDFILE "set output '$output_file' \n";
  printf CMDFILE "set term $term_options \n";
  printf CMDFILE "set grid \n";
  printf CMDFILE "set key top right \n";
  printf CMDFILE "set ylabel 'Intensity of light ' \n";
  printf CMDFILE "set xlabel 'Wavelength (nm) ' \n";
  printf CMDFILE "set title 'Arcturus moving at $this_v m/s '\n";
  
  $cmd = "plot [882.0:885.0][0.0:1.2] './arcturus_nm.dat' ";
  $cmd .= "          using (\$1*$ratio):(\$4) with lines lt 1 lc 1 lw 3 t 'Arcturus' ";
  $cmd .= " , ";
  $cmd .= "                            './solar_nm.dat' ";
  $cmd .= "          using (\$1):(\$2) with lines lt 1 lc -1 lw 3 t 'Sun' ";

  printf CMDFILE "$cmd \n";
  printf CMDFILE "set output \n";
  printf CMDFILE "quit \n";
  close(CMDFILE) ;
  
  $retval = `gnuplot < $cmdfile`;
  printf "retval is ..%s..\n", $retval;
  
  if ($term_options =~ /postscript/) {
    $psfile = $output_file;
    $giffile = $psfile;
    $giffile =~ s/.ps/.png/;
    $cmd = "convert -rotate 90 $psfile $giffile";
    printf "cmd is ..$cmd.. \n";
    $ret = `$cmd`;
  }

  # plot a small section of spectrum of Sun and Arcturus,
  #   with Arcturus moving at +5 km/s
  $this_v = 0.5*$base_v;
  $ratio = 1.0 + ($this_v/$c);
  printf " ratio is %10.6f \n", $ratio;

  $output_file = "sun_arc_spec_b2.ps";
  $term_options = "postscript color enhanced 'Helvetica,18' ";

  $cmdfile = "gnuplot.in";
  
  open (CMDFILE, ">$cmdfile") || die("can't open $cmdfile for writing");
  printf CMDFILE "set output '$output_file' \n";
  printf CMDFILE "set term $term_options \n";
  printf CMDFILE "set grid \n";
  printf CMDFILE "set key top right \n";
  printf CMDFILE "set ylabel 'Intensity of light ' \n";
  printf CMDFILE "set xlabel 'Wavelength (nm) ' \n";
  printf CMDFILE "set title 'Arcturus moving at $this_v m/s '\n";
  
  $cmd = "plot [882.0:885.0][0.0:1.2] './arcturus_nm.dat' ";
  $cmd .= "          using (\$1*$ratio):(\$4) with lines lt 1 lc 1 lw 3 t 'Arcturus' ";
  $cmd .= " , ";
  $cmd .= "                            './solar_nm.dat' ";
  $cmd .= "          using (\$1):(\$2) with lines lt 1 lc -1 lw 3 t 'Sun' ";

  printf CMDFILE "$cmd \n";
  printf CMDFILE "set output \n";
  printf CMDFILE "quit \n";
  close(CMDFILE) ;
  
  $retval = `gnuplot < $cmdfile`;
  printf "retval is ..%s..\n", $retval;
  
  if ($term_options =~ /postscript/) {
    $psfile = $output_file;
    $giffile = $psfile;
    $giffile =~ s/.ps/.png/;
    $cmd = "convert -rotate 90 $psfile $giffile";
    printf "cmd is ..$cmd.. \n";
    $ret = `$cmd`;
  }

  # plot a small section of spectrum of Sun and Arcturus,
  #   with Arcturus moving at +0 km/s
  $this_v = 0.0*$base_v;
  $ratio = 1.0 + ($this_v/$c);
  printf " ratio is %10.6f \n", $ratio;

  $output_file = "sun_arc_spec_b3.ps";
  $term_options = "postscript color enhanced 'Helvetica,18' ";

  $cmdfile = "gnuplot.in";
  
  open (CMDFILE, ">$cmdfile") || die("can't open $cmdfile for writing");
  printf CMDFILE "set output '$output_file' \n";
  printf CMDFILE "set term $term_options \n";
  printf CMDFILE "set grid \n";
  printf CMDFILE "set key top right \n";
  printf CMDFILE "set ylabel 'Intensity of light ' \n";
  printf CMDFILE "set xlabel 'Wavelength (nm) ' \n";
  printf CMDFILE "set title 'Arcturus moving at $this_v m/s '\n";
  
  $cmd = "plot [882.0:885.0][0.0:1.2] './arcturus_nm.dat' ";
  $cmd .= "          using (\$1*$ratio):(\$4) with lines lt 1 lc 1 lw 3 t 'Arcturus' ";
  $cmd .= " , ";
  $cmd .= "                            './solar_nm.dat' ";
  $cmd .= "          using (\$1):(\$2) with lines lt 1 lc -1 lw 3 t 'Sun' ";

  printf CMDFILE "$cmd \n";
  printf CMDFILE "set output \n";
  printf CMDFILE "quit \n";
  close(CMDFILE) ;
  
  $retval = `gnuplot < $cmdfile`;
  printf "retval is ..%s..\n", $retval;
  
  if ($term_options =~ /postscript/) {
    $psfile = $output_file;
    $giffile = $psfile;
    $giffile =~ s/.ps/.png/;
    $cmd = "convert -rotate 90 $psfile $giffile";
    printf "cmd is ..$cmd.. \n";
    $ret = `$cmd`;
  }

  # plot a small section of spectrum of Sun and Arcturus,
  #   with Arcturus moving at -5 km/s
  $this_v = -0.5*$base_v;
  $ratio = 1.0 + ($this_v/$c);
  printf " ratio is %10.6f \n", $ratio;

  $output_file = "sun_arc_spec_b4.ps";
  $term_options = "postscript color enhanced 'Helvetica,18' ";

  $cmdfile = "gnuplot.in";
  
  open (CMDFILE, ">$cmdfile") || die("can't open $cmdfile for writing");
  printf CMDFILE "set output '$output_file' \n";
  printf CMDFILE "set term $term_options \n";
  printf CMDFILE "set grid \n";
  printf CMDFILE "set key top right \n";
  printf CMDFILE "set ylabel 'Intensity of light ' \n";
  printf CMDFILE "set xlabel 'Wavelength (nm) ' \n";
  printf CMDFILE "set title 'Arcturus moving at $this_v m/s '\n";
  
  $cmd = "plot [882.0:885.0][0.0:1.2] './arcturus_nm.dat' ";
  $cmd .= "          using (\$1*$ratio):(\$4) with lines lt 1 lc 1 lw 3 t 'Arcturus' ";
  $cmd .= " , ";
  $cmd .= "                            './solar_nm.dat' ";
  $cmd .= "          using (\$1):(\$2) with lines lt 1 lc -1 lw 3 t 'Sun' ";

  printf CMDFILE "$cmd \n";
  printf CMDFILE "set output \n";
  printf CMDFILE "quit \n";
  close(CMDFILE) ;
  
  $retval = `gnuplot < $cmdfile`;
  printf "retval is ..%s..\n", $retval;
  
  if ($term_options =~ /postscript/) {
    $psfile = $output_file;
    $giffile = $psfile;
    $giffile =~ s/.ps/.png/;
    $cmd = "convert -rotate 90 $psfile $giffile";
    printf "cmd is ..$cmd.. \n";
    $ret = `$cmd`;
  }

  # plot a small section of spectrum of Sun and Arcturus,
  #   with Arcturus moving at -10 km/s
  $this_v = -1.0*$base_v;
  $ratio = 1.0 + ($this_v/$c);
  printf " ratio is %10.6f \n", $ratio;

  $output_file = "sun_arc_spec_b5.ps";
  $term_options = "postscript color enhanced 'Helvetica,18' ";

  $cmdfile = "gnuplot.in";
  
  open (CMDFILE, ">$cmdfile") || die("can't open $cmdfile for writing");
  printf CMDFILE "set output '$output_file' \n";
  printf CMDFILE "set term $term_options \n";
  printf CMDFILE "set grid \n";
  printf CMDFILE "set key top right \n";
  printf CMDFILE "set ylabel 'Intensity of light ' \n";
  printf CMDFILE "set xlabel 'Wavelength (nm) ' \n";
  printf CMDFILE "set title 'Arcturus moving at $this_v m/s '\n";
  
  $cmd = "plot [882.0:885.0][0.0:1.2] './arcturus_nm.dat' ";
  $cmd .= "          using (\$1*$ratio):(\$4) with lines lt 1 lc 1 lw 3 t 'Arcturus' ";
  $cmd .= " , ";
  $cmd .= "                            './solar_nm.dat' ";
  $cmd .= "          using (\$1):(\$2) with lines lt 1 lc -1 lw 3 t 'Sun' ";

  printf CMDFILE "$cmd \n";
  printf CMDFILE "set output \n";
  printf CMDFILE "quit \n";
  close(CMDFILE) ;
  
  $retval = `gnuplot < $cmdfile`;
  printf "retval is ..%s..\n", $retval;
  
  if ($term_options =~ /postscript/) {
    $psfile = $output_file;
    $giffile = $psfile;
    $giffile =~ s/.ps/.png/;
    $cmd = "convert -rotate 90 $psfile $giffile";
    printf "cmd is ..$cmd.. \n";
    $ret = `$cmd`;
  }









  # Arcturus speed in m/s
  $base_v = 1000.0;

  # plot a small section of spectrum of Sun and Arcturus,
  #   with Arcturus moving at +1 km/s
  $this_v = 1.0*$base_v;
  $ratio = 1.0 + ($this_v/$c);
  printf " ratio is %10.6f \n", $ratio;

  $output_file = "sun_arc_spec_c.ps";
  $term_options = "postscript color enhanced 'Helvetica,18' ";

  $cmdfile = "gnuplot.in";
  
  open (CMDFILE, ">$cmdfile") || die("can't open $cmdfile for writing");
  printf CMDFILE "set output '$output_file' \n";
  printf CMDFILE "set term $term_options \n";
  printf CMDFILE "set grid \n";
  printf CMDFILE "set key top right \n";
  printf CMDFILE "set ylabel 'Intensity of light ' \n";
  printf CMDFILE "set xlabel 'Wavelength (nm) ' \n";
  printf CMDFILE "set title 'Arcturus moving at $this_v m/s '\n";
  
  $cmd = "plot [882.0:885.0][0.0:1.2] './arcturus_nm.dat' ";
  $cmd .= "          using (\$1*$ratio):(\$4) with lines lt 1 lc 1 lw 3 t 'Arcturus' ";
  $cmd .= " , ";
  $cmd .= "                            './solar_nm.dat' ";
  $cmd .= "          using (\$1):(\$2) with lines lt 1 lc -1 lw 3 t 'Sun' ";

  printf CMDFILE "$cmd \n";
  printf CMDFILE "set output \n";
  printf CMDFILE "quit \n";
  close(CMDFILE) ;
  
  $retval = `gnuplot < $cmdfile`;
  printf "retval is ..%s..\n", $retval;
  
  if ($term_options =~ /postscript/) {
    $psfile = $output_file;
    $giffile = $psfile;
    $giffile =~ s/.ps/.png/;
    $cmd = "convert -rotate 90 $psfile $giffile";
    printf "cmd is ..$cmd.. \n";
    $ret = `$cmd`;
  }

  # plot a small section of spectrum of Sun and Arcturus,
  #   with Arcturus moving at +500 m/s
  $this_v = 0.5*$base_v;
  $ratio = 1.0 + ($this_v/$c);
  printf " ratio is %10.6f \n", $ratio;

  $output_file = "sun_arc_spec_c2.ps";
  $term_options = "postscript color enhanced 'Helvetica,18' ";

  $cmdfile = "gnuplot.in";
  
  open (CMDFILE, ">$cmdfile") || die("can't open $cmdfile for writing");
  printf CMDFILE "set output '$output_file' \n";
  printf CMDFILE "set term $term_options \n";
  printf CMDFILE "set grid \n";
  printf CMDFILE "set key top right \n";
  printf CMDFILE "set ylabel 'Intensity of light ' \n";
  printf CMDFILE "set xlabel 'Wavelength (nm) ' \n";
  printf CMDFILE "set title 'Arcturus moving at $this_v m/s '\n";
  
  $cmd = "plot [882.0:885.0][0.0:1.2] './arcturus_nm.dat' ";
  $cmd .= "          using (\$1*$ratio):(\$4) with lines lt 1 lc 1 lw 3 t 'Arcturus' ";
  $cmd .= " , ";
  $cmd .= "                            './solar_nm.dat' ";
  $cmd .= "          using (\$1):(\$2) with lines lt 1 lc -1 lw 3 t 'Sun' ";

  printf CMDFILE "$cmd \n";
  printf CMDFILE "set output \n";
  printf CMDFILE "quit \n";
  close(CMDFILE) ;
  
  $retval = `gnuplot < $cmdfile`;
  printf "retval is ..%s..\n", $retval;
  
  if ($term_options =~ /postscript/) {
    $psfile = $output_file;
    $giffile = $psfile;
    $giffile =~ s/.ps/.png/;
    $cmd = "convert -rotate 90 $psfile $giffile";
    printf "cmd is ..$cmd.. \n";
    $ret = `$cmd`;
  }

  # plot a small section of spectrum of Sun and Arcturus,
  #   with Arcturus moving at +0 km/s
  $this_v = 0.0*$base_v;
  $ratio = 1.0 + ($this_v/$c);
  printf " ratio is %10.6f \n", $ratio;

  $output_file = "sun_arc_spec_c3.ps";
  $term_options = "postscript color enhanced 'Helvetica,18' ";

  $cmdfile = "gnuplot.in";
  
  open (CMDFILE, ">$cmdfile") || die("can't open $cmdfile for writing");
  printf CMDFILE "set output '$output_file' \n";
  printf CMDFILE "set term $term_options \n";
  printf CMDFILE "set grid \n";
  printf CMDFILE "set key top right \n";
  printf CMDFILE "set ylabel 'Intensity of light ' \n";
  printf CMDFILE "set xlabel 'Wavelength (nm) ' \n";
  printf CMDFILE "set title 'Arcturus moving at $this_v m/s '\n";
  
  $cmd = "plot [882.0:885.0][0.0:1.2] './arcturus_nm.dat' ";
  $cmd .= "          using (\$1*$ratio):(\$4) with lines lt 1 lc 1 lw 3 t 'Arcturus' ";
  $cmd .= " , ";
  $cmd .= "                            './solar_nm.dat' ";
  $cmd .= "          using (\$1):(\$2) with lines lt 1 lc -1 lw 3 t 'Sun' ";

  printf CMDFILE "$cmd \n";
  printf CMDFILE "set output \n";
  printf CMDFILE "quit \n";
  close(CMDFILE) ;
  
  $retval = `gnuplot < $cmdfile`;
  printf "retval is ..%s..\n", $retval;
  
  if ($term_options =~ /postscript/) {
    $psfile = $output_file;
    $giffile = $psfile;
    $giffile =~ s/.ps/.png/;
    $cmd = "convert -rotate 90 $psfile $giffile";
    printf "cmd is ..$cmd.. \n";
    $ret = `$cmd`;
  }

  # plot a small section of spectrum of Sun and Arcturus,
  #   with Arcturus moving at -500 m/s
  $this_v = -0.5*$base_v;
  $ratio = 1.0 + ($this_v/$c);
  printf " ratio is %10.6f \n", $ratio;

  $output_file = "sun_arc_spec_c4.ps";
  $term_options = "postscript color enhanced 'Helvetica,18' ";

  $cmdfile = "gnuplot.in";
  
  open (CMDFILE, ">$cmdfile") || die("can't open $cmdfile for writing");
  printf CMDFILE "set output '$output_file' \n";
  printf CMDFILE "set term $term_options \n";
  printf CMDFILE "set grid \n";
  printf CMDFILE "set key top right \n";
  printf CMDFILE "set ylabel 'Intensity of light ' \n";
  printf CMDFILE "set xlabel 'Wavelength (nm) ' \n";
  printf CMDFILE "set title 'Arcturus moving at $this_v m/s '\n";
  
  $cmd = "plot [882.0:885.0][0.0:1.2] './arcturus_nm.dat' ";
  $cmd .= "          using (\$1*$ratio):(\$4) with lines lt 1 lc 1 lw 3 t 'Arcturus' ";
  $cmd .= " , ";
  $cmd .= "                            './solar_nm.dat' ";
  $cmd .= "          using (\$1):(\$2) with lines lt 1 lc -1 lw 3 t 'Sun' ";

  printf CMDFILE "$cmd \n";
  printf CMDFILE "set output \n";
  printf CMDFILE "quit \n";
  close(CMDFILE) ;
  
  $retval = `gnuplot < $cmdfile`;
  printf "retval is ..%s..\n", $retval;
  
  if ($term_options =~ /postscript/) {
    $psfile = $output_file;
    $giffile = $psfile;
    $giffile =~ s/.ps/.png/;
    $cmd = "convert -rotate 90 $psfile $giffile";
    printf "cmd is ..$cmd.. \n";
    $ret = `$cmd`;
  }

  # plot a small section of spectrum of Sun and Arcturus,
  #   with Arcturus moving at -1000 m/s
  $this_v = -1.0*$base_v;
  $ratio = 1.0 + ($this_v/$c);
  printf " ratio is %10.6f \n", $ratio;

  $output_file = "sun_arc_spec_c5.ps";
  $term_options = "postscript color enhanced 'Helvetica,18' ";

  $cmdfile = "gnuplot.in";
  
  open (CMDFILE, ">$cmdfile") || die("can't open $cmdfile for writing");
  printf CMDFILE "set output '$output_file' \n";
  printf CMDFILE "set term $term_options \n";
  printf CMDFILE "set grid \n";
  printf CMDFILE "set key top right \n";
  printf CMDFILE "set ylabel 'Intensity of light ' \n";
  printf CMDFILE "set xlabel 'Wavelength (nm) ' \n";
  printf CMDFILE "set title 'Arcturus moving at $this_v m/s '\n";
  
  $cmd = "plot [882.0:885.0][0.0:1.2] './arcturus_nm.dat' ";
  $cmd .= "          using (\$1*$ratio):(\$4) with lines lt 1 lc 1 lw 3 t 'Arcturus' ";
  $cmd .= " , ";
  $cmd .= "                            './solar_nm.dat' ";
  $cmd .= "          using (\$1):(\$2) with lines lt 1 lc -1 lw 3 t 'Sun' ";

  printf CMDFILE "$cmd \n";
  printf CMDFILE "set output \n";
  printf CMDFILE "quit \n";
  close(CMDFILE) ;
  
  $retval = `gnuplot < $cmdfile`;
  printf "retval is ..%s..\n", $retval;
  
  if ($term_options =~ /postscript/) {
    $psfile = $output_file;
    $giffile = $psfile;
    $giffile =~ s/.ps/.png/;
    $cmd = "convert -rotate 90 $psfile $giffile";
    printf "cmd is ..$cmd.. \n";
    $ret = `$cmd`;
  }





  # now zoom in to show small range of wavelengths

  # Arcturus speed in m/s
  $base_v = 1000.0;

  # plot a small section of spectrum of Sun and Arcturus,
  #   with Arcturus moving at +1 km/s
  $this_v = 1.0*$base_v;
  $ratio = 1.0 + ($this_v/$c);
  printf " ratio is %10.6f \n", $ratio;

  $output_file = "sun_arc_spec_d.ps";
  $term_options = "postscript color enhanced 'Helvetica,18' ";

  $cmdfile = "gnuplot.in";
  
  open (CMDFILE, ">$cmdfile") || die("can't open $cmdfile for writing");
  printf CMDFILE "set output '$output_file' \n";
  printf CMDFILE "set term $term_options \n";
  printf CMDFILE "set grid \n";
  printf CMDFILE "set key top right \n";
  printf CMDFILE "set ylabel 'Intensity of light ' \n";
  printf CMDFILE "set xlabel 'Wavelength (nm) ' \n";
  printf CMDFILE "set title 'Arcturus moving at $this_v m/s '\n";
  
  $cmd = "plot [883.8:884.1][0.0:1.2] './arcturus_nm.dat' ";
  $cmd .= "          using (\$1*$ratio):(\$4) with lines lt 1 lc 1 lw 3 t 'Arcturus' ";
  $cmd .= " , ";
  $cmd .= "                            './solar_nm.dat' ";
  $cmd .= "          using (\$1):(\$2) with lines lt 1 lc -1 lw 3 t 'Sun' ";

  printf CMDFILE "$cmd \n";
  printf CMDFILE "set output \n";
  printf CMDFILE "quit \n";
  close(CMDFILE) ;
  
  $retval = `gnuplot < $cmdfile`;
  printf "retval is ..%s..\n", $retval;
  
  if ($term_options =~ /postscript/) {
    $psfile = $output_file;
    $giffile = $psfile;
    $giffile =~ s/.ps/.png/;
    $cmd = "convert -rotate 90 $psfile $giffile";
    printf "cmd is ..$cmd.. \n";
    $ret = `$cmd`;
  }

  # plot a small section of spectrum of Sun and Arcturus,
  #   with Arcturus moving at +500 m/s
  $this_v = 0.5*$base_v;
  $ratio = 1.0 + ($this_v/$c);
  printf " ratio is %10.6f \n", $ratio;

  $output_file = "sun_arc_spec_d2.ps";
  $term_options = "postscript color enhanced 'Helvetica,18' ";

  $cmdfile = "gnuplot.in";
  
  open (CMDFILE, ">$cmdfile") || die("can't open $cmdfile for writing");
  printf CMDFILE "set output '$output_file' \n";
  printf CMDFILE "set term $term_options \n";
  printf CMDFILE "set grid \n";
  printf CMDFILE "set key top right \n";
  printf CMDFILE "set ylabel 'Intensity of light ' \n";
  printf CMDFILE "set xlabel 'Wavelength (nm) ' \n";
  printf CMDFILE "set title 'Arcturus moving at $this_v m/s '\n";
  
  $cmd = "plot [883.8:884.1][0.0:1.2] './arcturus_nm.dat' ";
  $cmd .= "          using (\$1*$ratio):(\$4) with lines lt 1 lc 1 lw 3 t 'Arcturus' ";
  $cmd .= " , ";
  $cmd .= "                            './solar_nm.dat' ";
  $cmd .= "          using (\$1):(\$2) with lines lt 1 lc -1 lw 3 t 'Sun' ";

  printf CMDFILE "$cmd \n";
  printf CMDFILE "set output \n";
  printf CMDFILE "quit \n";
  close(CMDFILE) ;
  
  $retval = `gnuplot < $cmdfile`;
  printf "retval is ..%s..\n", $retval;
  
  if ($term_options =~ /postscript/) {
    $psfile = $output_file;
    $giffile = $psfile;
    $giffile =~ s/.ps/.png/;
    $cmd = "convert -rotate 90 $psfile $giffile";
    printf "cmd is ..$cmd.. \n";
    $ret = `$cmd`;
  }

  # plot a small section of spectrum of Sun and Arcturus,
  #   with Arcturus moving at +0 km/s
  $this_v = 0.0*$base_v;
  $ratio = 1.0 + ($this_v/$c);
  printf " ratio is %10.6f \n", $ratio;

  $output_file = "sun_arc_spec_d3.ps";
  $term_options = "postscript color enhanced 'Helvetica,18' ";

  $cmdfile = "gnuplot.in";
  
  open (CMDFILE, ">$cmdfile") || die("can't open $cmdfile for writing");
  printf CMDFILE "set output '$output_file' \n";
  printf CMDFILE "set term $term_options \n";
  printf CMDFILE "set grid \n";
  printf CMDFILE "set key top right \n";
  printf CMDFILE "set ylabel 'Intensity of light ' \n";
  printf CMDFILE "set xlabel 'Wavelength (nm) ' \n";
  printf CMDFILE "set title 'Arcturus moving at $this_v m/s '\n";
  
  $cmd = "plot [883.8:884.1][0.0:1.2] './arcturus_nm.dat' ";
  $cmd .= "          using (\$1*$ratio):(\$4) with lines lt 1 lc 1 lw 3 t 'Arcturus' ";
  $cmd .= " , ";
  $cmd .= "                            './solar_nm.dat' ";
  $cmd .= "          using (\$1):(\$2) with lines lt 1 lc -1 lw 3 t 'Sun' ";

  printf CMDFILE "$cmd \n";
  printf CMDFILE "set output \n";
  printf CMDFILE "quit \n";
  close(CMDFILE) ;
  
  $retval = `gnuplot < $cmdfile`;
  printf "retval is ..%s..\n", $retval;
  
  if ($term_options =~ /postscript/) {
    $psfile = $output_file;
    $giffile = $psfile;
    $giffile =~ s/.ps/.png/;
    $cmd = "convert -rotate 90 $psfile $giffile";
    printf "cmd is ..$cmd.. \n";
    $ret = `$cmd`;
  }

  # plot a small section of spectrum of Sun and Arcturus,
  #   with Arcturus moving at -500 m/s
  $this_v = -0.5*$base_v;
  $ratio = 1.0 + ($this_v/$c);
  printf " ratio is %10.6f \n", $ratio;

  $output_file = "sun_arc_spec_d4.ps";
  $term_options = "postscript color enhanced 'Helvetica,18' ";

  $cmdfile = "gnuplot.in";
  
  open (CMDFILE, ">$cmdfile") || die("can't open $cmdfile for writing");
  printf CMDFILE "set output '$output_file' \n";
  printf CMDFILE "set term $term_options \n";
  printf CMDFILE "set grid \n";
  printf CMDFILE "set key top right \n";
  printf CMDFILE "set ylabel 'Intensity of light ' \n";
  printf CMDFILE "set xlabel 'Wavelength (nm) ' \n";
  printf CMDFILE "set title 'Arcturus moving at $this_v m/s '\n";
  
  $cmd = "plot [883.8:884.1][0.0:1.2] './arcturus_nm.dat' ";
  $cmd .= "          using (\$1*$ratio):(\$4) with lines lt 1 lc 1 lw 3 t 'Arcturus' ";
  $cmd .= " , ";
  $cmd .= "                            './solar_nm.dat' ";
  $cmd .= "          using (\$1):(\$2) with lines lt 1 lc -1 lw 3 t 'Sun' ";

  printf CMDFILE "$cmd \n";
  printf CMDFILE "set output \n";
  printf CMDFILE "quit \n";
  close(CMDFILE) ;
  
  $retval = `gnuplot < $cmdfile`;
  printf "retval is ..%s..\n", $retval;
  
  if ($term_options =~ /postscript/) {
    $psfile = $output_file;
    $giffile = $psfile;
    $giffile =~ s/.ps/.png/;
    $cmd = "convert -rotate 90 $psfile $giffile";
    printf "cmd is ..$cmd.. \n";
    $ret = `$cmd`;
  }

  # plot a small section of spectrum of Sun and Arcturus,
  #   with Arcturus moving at -1000 m/s
  $this_v = -1.0*$base_v;
  $ratio = 1.0 + ($this_v/$c);
  printf " ratio is %10.6f \n", $ratio;

  $output_file = "sun_arc_spec_d5.ps";
  $term_options = "postscript color enhanced 'Helvetica,18' ";

  $cmdfile = "gnuplot.in";
  
  open (CMDFILE, ">$cmdfile") || die("can't open $cmdfile for writing");
  printf CMDFILE "set output '$output_file' \n";
  printf CMDFILE "set term $term_options \n";
  printf CMDFILE "set grid \n";
  printf CMDFILE "set key top right \n";
  printf CMDFILE "set ylabel 'Intensity of light ' \n";
  printf CMDFILE "set xlabel 'Wavelength (nm) ' \n";
  printf CMDFILE "set title 'Arcturus moving at $this_v m/s '\n";
  
  $cmd = "plot [883.8:884.1][0.0:1.2] './arcturus_nm.dat' ";
  $cmd .= "          using (\$1*$ratio):(\$4) with lines lt 1 lc 1 lw 3 t 'Arcturus' ";
  $cmd .= " , ";
  $cmd .= "                            './solar_nm.dat' ";
  $cmd .= "          using (\$1):(\$2) with lines lt 1 lc -1 lw 3 t 'Sun' ";

  printf CMDFILE "$cmd \n";
  printf CMDFILE "set output \n";
  printf CMDFILE "quit \n";
  close(CMDFILE) ;
  
  $retval = `gnuplot < $cmdfile`;
  printf "retval is ..%s..\n", $retval;
  
  if ($term_options =~ /postscript/) {
    $psfile = $output_file;
    $giffile = $psfile;
    $giffile =~ s/.ps/.png/;
    $cmd = "convert -rotate 90 $psfile $giffile";
    printf "cmd is ..$cmd.. \n";
    $ret = `$cmd`;
  }









  # remain zoomed in to show small range of wavelengths

  # Arcturus speed in m/s
  $base_v = 100.0;

  # plot a small section of spectrum of Sun and Arcturus,
  #   with Arcturus moving at +100 m/s
  $this_v = 1.0*$base_v;
  $ratio = 1.0 + ($this_v/$c);
  printf " ratio is %10.6f \n", $ratio;

  $output_file = "sun_arc_spec_e.ps";
  $term_options = "postscript color enhanced 'Helvetica,18' ";

  $cmdfile = "gnuplot.in";
  
  open (CMDFILE, ">$cmdfile") || die("can't open $cmdfile for writing");
  printf CMDFILE "set output '$output_file' \n";
  printf CMDFILE "set term $term_options \n";
  printf CMDFILE "set grid \n";
  printf CMDFILE "set key top right \n";
  printf CMDFILE "set ylabel 'Intensity of light ' \n";
  printf CMDFILE "set xlabel 'Wavelength (nm) ' \n";
  printf CMDFILE "set title 'Arcturus moving at $this_v m/s '\n";
  
  $cmd = "plot [883.8:884.1][0.0:1.2] './arcturus_nm.dat' ";
  $cmd .= "          using (\$1*$ratio):(\$4) with lines lt 1 lc 1 lw 3 t 'Arcturus' ";
  $cmd .= " , ";
  $cmd .= "                            './solar_nm.dat' ";
  $cmd .= "          using (\$1):(\$2) with lines lt 1 lc -1 lw 3 t 'Sun' ";

  printf CMDFILE "$cmd \n";
  printf CMDFILE "set output \n";
  printf CMDFILE "quit \n";
  close(CMDFILE) ;
  
  $retval = `gnuplot < $cmdfile`;
  printf "retval is ..%s..\n", $retval;
  
  if ($term_options =~ /postscript/) {
    $psfile = $output_file;
    $giffile = $psfile;
    $giffile =~ s/.ps/.png/;
    $cmd = "convert -rotate 90 $psfile $giffile";
    printf "cmd is ..$cmd.. \n";
    $ret = `$cmd`;
  }

  # plot a small section of spectrum of Sun and Arcturus,
  #   with Arcturus moving at +50 m/s
  $this_v = 0.5*$base_v;
  $ratio = 1.0 + ($this_v/$c);
  printf " ratio is %10.6f \n", $ratio;

  $output_file = "sun_arc_spec_e2.ps";
  $term_options = "postscript color enhanced 'Helvetica,18' ";

  $cmdfile = "gnuplot.in";
  
  open (CMDFILE, ">$cmdfile") || die("can't open $cmdfile for writing");
  printf CMDFILE "set output '$output_file' \n";
  printf CMDFILE "set term $term_options \n";
  printf CMDFILE "set grid \n";
  printf CMDFILE "set key top right \n";
  printf CMDFILE "set ylabel 'Intensity of light ' \n";
  printf CMDFILE "set xlabel 'Wavelength (nm) ' \n";
  printf CMDFILE "set title 'Arcturus moving at $this_v m/s '\n";
  
  $cmd = "plot [883.8:884.1][0.0:1.2] './arcturus_nm.dat' ";
  $cmd .= "          using (\$1*$ratio):(\$4) with lines lt 1 lc 1 lw 3 t 'Arcturus' ";
  $cmd .= " , ";
  $cmd .= "                            './solar_nm.dat' ";
  $cmd .= "          using (\$1):(\$2) with lines lt 1 lc -1 lw 3 t 'Sun' ";

  printf CMDFILE "$cmd \n";
  printf CMDFILE "set output \n";
  printf CMDFILE "quit \n";
  close(CMDFILE) ;
  
  $retval = `gnuplot < $cmdfile`;
  printf "retval is ..%s..\n", $retval;
  
  if ($term_options =~ /postscript/) {
    $psfile = $output_file;
    $giffile = $psfile;
    $giffile =~ s/.ps/.png/;
    $cmd = "convert -rotate 90 $psfile $giffile";
    printf "cmd is ..$cmd.. \n";
    $ret = `$cmd`;
  }

  # plot a small section of spectrum of Sun and Arcturus,
  #   with Arcturus moving at +0 km/s
  $this_v = 0.0*$base_v;
  $ratio = 1.0 + ($this_v/$c);
  printf " ratio is %10.6f \n", $ratio;

  $output_file = "sun_arc_spec_e3.ps";
  $term_options = "postscript color enhanced 'Helvetica,18' ";

  $cmdfile = "gnuplot.in";
  
  open (CMDFILE, ">$cmdfile") || die("can't open $cmdfile for writing");
  printf CMDFILE "set output '$output_file' \n";
  printf CMDFILE "set term $term_options \n";
  printf CMDFILE "set grid \n";
  printf CMDFILE "set key top right \n";
  printf CMDFILE "set ylabel 'Intensity of light ' \n";
  printf CMDFILE "set xlabel 'Wavelength (nm) ' \n";
  printf CMDFILE "set title 'Arcturus moving at $this_v m/s '\n";
  
  $cmd = "plot [883.8:884.1][0.0:1.2] './arcturus_nm.dat' ";
  $cmd .= "          using (\$1*$ratio):(\$4) with lines lt 1 lc 1 lw 3 t 'Arcturus' ";
  $cmd .= " , ";
  $cmd .= "                            './solar_nm.dat' ";
  $cmd .= "          using (\$1):(\$2) with lines lt 1 lc -1 lw 3 t 'Sun' ";

  printf CMDFILE "$cmd \n";
  printf CMDFILE "set output \n";
  printf CMDFILE "quit \n";
  close(CMDFILE) ;
  
  $retval = `gnuplot < $cmdfile`;
  printf "retval is ..%s..\n", $retval;
  
  if ($term_options =~ /postscript/) {
    $psfile = $output_file;
    $giffile = $psfile;
    $giffile =~ s/.ps/.png/;
    $cmd = "convert -rotate 90 $psfile $giffile";
    printf "cmd is ..$cmd.. \n";
    $ret = `$cmd`;
  }

  # plot a small section of spectrum of Sun and Arcturus,
  #   with Arcturus moving at -50 m/s
  $this_v = -0.5*$base_v;
  $ratio = 1.0 + ($this_v/$c);
  printf " ratio is %10.6f \n", $ratio;

  $output_file = "sun_arc_spec_e4.ps";
  $term_options = "postscript color enhanced 'Helvetica,18' ";

  $cmdfile = "gnuplot.in";
  
  open (CMDFILE, ">$cmdfile") || die("can't open $cmdfile for writing");
  printf CMDFILE "set output '$output_file' \n";
  printf CMDFILE "set term $term_options \n";
  printf CMDFILE "set grid \n";
  printf CMDFILE "set key top right \n";
  printf CMDFILE "set ylabel 'Intensity of light ' \n";
  printf CMDFILE "set xlabel 'Wavelength (nm) ' \n";
  printf CMDFILE "set title 'Arcturus moving at $this_v m/s '\n";
  
  $cmd = "plot [883.8:884.1][0.0:1.2] './arcturus_nm.dat' ";
  $cmd .= "          using (\$1*$ratio):(\$4) with lines lt 1 lc 1 lw 3 t 'Arcturus' ";
  $cmd .= " , ";
  $cmd .= "                            './solar_nm.dat' ";
  $cmd .= "          using (\$1):(\$2) with lines lt 1 lc -1 lw 3 t 'Sun' ";

  printf CMDFILE "$cmd \n";
  printf CMDFILE "set output \n";
  printf CMDFILE "quit \n";
  close(CMDFILE) ;
  
  $retval = `gnuplot < $cmdfile`;
  printf "retval is ..%s..\n", $retval;
  
  if ($term_options =~ /postscript/) {
    $psfile = $output_file;
    $giffile = $psfile;
    $giffile =~ s/.ps/.png/;
    $cmd = "convert -rotate 90 $psfile $giffile";
    printf "cmd is ..$cmd.. \n";
    $ret = `$cmd`;
  }

  # plot a small section of spectrum of Sun and Arcturus,
  #   with Arcturus moving at -100 m/s
  $this_v = -1.0*$base_v;
  $ratio = 1.0 + ($this_v/$c);
  printf " ratio is %10.6f \n", $ratio;

  $output_file = "sun_arc_spec_e5.ps";
  $term_options = "postscript color enhanced 'Helvetica,18' ";

  $cmdfile = "gnuplot.in";
  
  open (CMDFILE, ">$cmdfile") || die("can't open $cmdfile for writing");
  printf CMDFILE "set output '$output_file' \n";
  printf CMDFILE "set term $term_options \n";
  printf CMDFILE "set grid \n";
  printf CMDFILE "set key top right \n";
  printf CMDFILE "set ylabel 'Intensity of light ' \n";
  printf CMDFILE "set xlabel 'Wavelength (nm) ' \n";
  printf CMDFILE "set title 'Arcturus moving at $this_v m/s '\n";
  
  $cmd = "plot [883.8:884.1][0.0:1.2] './arcturus_nm.dat' ";
  $cmd .= "          using (\$1*$ratio):(\$4) with lines lt 1 lc 1 lw 3 t 'Arcturus' ";
  $cmd .= " , ";
  $cmd .= "                            './solar_nm.dat' ";
  $cmd .= "          using (\$1):(\$2) with lines lt 1 lc -1 lw 3 t 'Sun' ";

  printf CMDFILE "$cmd \n";
  printf CMDFILE "set output \n";
  printf CMDFILE "quit \n";
  close(CMDFILE) ;
  
  $retval = `gnuplot < $cmdfile`;
  printf "retval is ..%s..\n", $retval;
  
  if ($term_options =~ /postscript/) {
    $psfile = $output_file;
    $giffile = $psfile;
    $giffile =~ s/.ps/.png/;
    $cmd = "convert -rotate 90 $psfile $giffile";
    printf "cmd is ..$cmd.. \n";
    $ret = `$cmd`;
  }









  # remain zoomed in to show small range of wavelengths

  # Arcturus speed in m/s
  $base_v = 10.0;

  # plot a small section of spectrum of Sun and Arcturus,
  #   with Arcturus moving at +10 m/s
  $this_v = 1.0*$base_v;
  $ratio = 1.0 + ($this_v/$c);
  printf " ratio is %10.6f \n", $ratio;

  $output_file = "sun_arc_spec_f.ps";
  $term_options = "postscript color enhanced 'Helvetica,18' ";

  $cmdfile = "gnuplot.in";
  
  open (CMDFILE, ">$cmdfile") || die("can't open $cmdfile for writing");
  printf CMDFILE "set output '$output_file' \n";
  printf CMDFILE "set term $term_options \n";
  printf CMDFILE "set grid \n";
  printf CMDFILE "set key top right \n";
  printf CMDFILE "set ylabel 'Intensity of light ' \n";
  printf CMDFILE "set xlabel 'Wavelength (nm) ' \n";
  printf CMDFILE "set title 'Arcturus moving at $this_v m/s '\n";
  
  $cmd = "plot [883.8:884.1][0.0:1.2] './arcturus_nm.dat' ";
  $cmd .= "          using (\$1*$ratio):(\$4) with lines lt 1 lc 1 lw 3 t 'Arcturus' ";
  $cmd .= " , ";
  $cmd .= "                            './solar_nm.dat' ";
  $cmd .= "          using (\$1):(\$2) with lines lt 1 lc -1 lw 3 t 'Sun' ";

  printf CMDFILE "$cmd \n";
  printf CMDFILE "set output \n";
  printf CMDFILE "quit \n";
  close(CMDFILE) ;
  
  $retval = `gnuplot < $cmdfile`;
  printf "retval is ..%s..\n", $retval;
  
  if ($term_options =~ /postscript/) {
    $psfile = $output_file;
    $giffile = $psfile;
    $giffile =~ s/.ps/.png/;
    $cmd = "convert -rotate 90 $psfile $giffile";
    printf "cmd is ..$cmd.. \n";
    $ret = `$cmd`;
  }

  # plot a small section of spectrum of Sun and Arcturus,
  #   with Arcturus moving at +5 m/s
  $this_v = 0.5*$base_v;
  $ratio = 1.0 + ($this_v/$c);
  printf " ratio is %10.6f \n", $ratio;

  $output_file = "sun_arc_spec_f2.ps";
  $term_options = "postscript color enhanced 'Helvetica,18' ";

  $cmdfile = "gnuplot.in";
  
  open (CMDFILE, ">$cmdfile") || die("can't open $cmdfile for writing");
  printf CMDFILE "set output '$output_file' \n";
  printf CMDFILE "set term $term_options \n";
  printf CMDFILE "set grid \n";
  printf CMDFILE "set key top right \n";
  printf CMDFILE "set ylabel 'Intensity of light ' \n";
  printf CMDFILE "set xlabel 'Wavelength (nm) ' \n";
  printf CMDFILE "set title 'Arcturus moving at $this_v m/s '\n";
  
  $cmd = "plot [883.8:884.1][0.0:1.2] './arcturus_nm.dat' ";
  $cmd .= "          using (\$1*$ratio):(\$4) with lines lt 1 lc 1 lw 3 t 'Arcturus' ";
  $cmd .= " , ";
  $cmd .= "                            './solar_nm.dat' ";
  $cmd .= "          using (\$1):(\$2) with lines lt 1 lc -1 lw 3 t 'Sun' ";

  printf CMDFILE "$cmd \n";
  printf CMDFILE "set output \n";
  printf CMDFILE "quit \n";
  close(CMDFILE) ;
  
  $retval = `gnuplot < $cmdfile`;
  printf "retval is ..%s..\n", $retval;
  
  if ($term_options =~ /postscript/) {
    $psfile = $output_file;
    $giffile = $psfile;
    $giffile =~ s/.ps/.png/;
    $cmd = "convert -rotate 90 $psfile $giffile";
    printf "cmd is ..$cmd.. \n";
    $ret = `$cmd`;
  }

  # plot a small section of spectrum of Sun and Arcturus,
  #   with Arcturus moving at +0 km/s
  $this_v = 0.0*$base_v;
  $ratio = 1.0 + ($this_v/$c);
  printf " ratio is %10.6f \n", $ratio;

  $output_file = "sun_arc_spec_f3.ps";
  $term_options = "postscript color enhanced 'Helvetica,18' ";

  $cmdfile = "gnuplot.in";
  
  open (CMDFILE, ">$cmdfile") || die("can't open $cmdfile for writing");
  printf CMDFILE "set output '$output_file' \n";
  printf CMDFILE "set term $term_options \n";
  printf CMDFILE "set grid \n";
  printf CMDFILE "set key top right \n";
  printf CMDFILE "set ylabel 'Intensity of light ' \n";
  printf CMDFILE "set xlabel 'Wavelength (nm) ' \n";
  printf CMDFILE "set title 'Arcturus moving at $this_v m/s '\n";
  
  $cmd = "plot [883.8:884.1][0.0:1.2] './arcturus_nm.dat' ";
  $cmd .= "          using (\$1*$ratio):(\$4) with lines lt 1 lc 1 lw 3 t 'Arcturus' ";
  $cmd .= " , ";
  $cmd .= "                            './solar_nm.dat' ";
  $cmd .= "          using (\$1):(\$2) with lines lt 1 lc -1 lw 3 t 'Sun' ";

  printf CMDFILE "$cmd \n";
  printf CMDFILE "set output \n";
  printf CMDFILE "quit \n";
  close(CMDFILE) ;
  
  $retval = `gnuplot < $cmdfile`;
  printf "retval is ..%s..\n", $retval;
  
  if ($term_options =~ /postscript/) {
    $psfile = $output_file;
    $giffile = $psfile;
    $giffile =~ s/.ps/.png/;
    $cmd = "convert -rotate 90 $psfile $giffile";
    printf "cmd is ..$cmd.. \n";
    $ret = `$cmd`;
  }

  # plot a small section of spectrum of Sun and Arcturus,
  #   with Arcturus moving at -5 m/s
  $this_v = -0.5*$base_v;
  $ratio = 1.0 + ($this_v/$c);
  printf " ratio is %10.6f \n", $ratio;

  $output_file = "sun_arc_spec_f4.ps";
  $term_options = "postscript color enhanced 'Helvetica,18' ";

  $cmdfile = "gnuplot.in";
  
  open (CMDFILE, ">$cmdfile") || die("can't open $cmdfile for writing");
  printf CMDFILE "set output '$output_file' \n";
  printf CMDFILE "set term $term_options \n";
  printf CMDFILE "set grid \n";
  printf CMDFILE "set key top right \n";
  printf CMDFILE "set ylabel 'Intensity of light ' \n";
  printf CMDFILE "set xlabel 'Wavelength (nm) ' \n";
  printf CMDFILE "set title 'Arcturus moving at $this_v m/s '\n";
  
  $cmd = "plot [883.8:884.1][0.0:1.2] './arcturus_nm.dat' ";
  $cmd .= "          using (\$1*$ratio):(\$4) with lines lt 1 lc 1 lw 3 t 'Arcturus' ";
  $cmd .= " , ";
  $cmd .= "                            './solar_nm.dat' ";
  $cmd .= "          using (\$1):(\$2) with lines lt 1 lc -1 lw 3 t 'Sun' ";

  printf CMDFILE "$cmd \n";
  printf CMDFILE "set output \n";
  printf CMDFILE "quit \n";
  close(CMDFILE) ;
  
  $retval = `gnuplot < $cmdfile`;
  printf "retval is ..%s..\n", $retval;
  
  if ($term_options =~ /postscript/) {
    $psfile = $output_file;
    $giffile = $psfile;
    $giffile =~ s/.ps/.png/;
    $cmd = "convert -rotate 90 $psfile $giffile";
    printf "cmd is ..$cmd.. \n";
    $ret = `$cmd`;
  }

  # plot a small section of spectrum of Sun and Arcturus,
  #   with Arcturus moving at -10 m/s
  $this_v = -1.0*$base_v;
  $ratio = 1.0 + ($this_v/$c);
  printf " ratio is %10.6f \n", $ratio;

  $output_file = "sun_arc_spec_f5.ps";
  $term_options = "postscript color enhanced 'Helvetica,18' ";

  $cmdfile = "gnuplot.in";
  
  open (CMDFILE, ">$cmdfile") || die("can't open $cmdfile for writing");
  printf CMDFILE "set output '$output_file' \n";
  printf CMDFILE "set term $term_options \n";
  printf CMDFILE "set grid \n";
  printf CMDFILE "set key top right \n";
  printf CMDFILE "set ylabel 'Intensity of light ' \n";
  printf CMDFILE "set xlabel 'Wavelength (nm) ' \n";
  printf CMDFILE "set title 'Arcturus moving at $this_v m/s '\n";
  
  $cmd = "plot [883.8:884.1][0.0:1.2] './arcturus_nm.dat' ";
  $cmd .= "          using (\$1*$ratio):(\$4) with lines lt 1 lc 1 lw 3 t 'Arcturus' ";
  $cmd .= " , ";
  $cmd .= "                            './solar_nm.dat' ";
  $cmd .= "          using (\$1):(\$2) with lines lt 1 lc -1 lw 3 t 'Sun' ";

  printf CMDFILE "$cmd \n";
  printf CMDFILE "set output \n";
  printf CMDFILE "quit \n";
  close(CMDFILE) ;
  
  $retval = `gnuplot < $cmdfile`;
  printf "retval is ..%s..\n", $retval;
  
  if ($term_options =~ /postscript/) {
    $psfile = $output_file;
    $giffile = $psfile;
    $giffile =~ s/.ps/.png/;
    $cmd = "convert -rotate 90 $psfile $giffile";
    printf "cmd is ..$cmd.. \n";
    $ret = `$cmd`;
  }



exit 0;
