#!/bin/csh -f #++++++++++++++++ #.IDENTIFICATION getsp #.LANGUAGE C_shell #.AUTHOR Francois Ochsenbein #.ENVIRONMENT CDS Catalogues Service #.KEYWORDS #.VERSION 1.0 09-Apr-1999 #.VERSION 1.1 22-Jan-2001: 'echo' command is unusable -- use gawk # (too many variations between bash / csh / sh ) #.PURPOSE Find out the spectrophotometry for a HR star #.COMMENTS The program accepts the following arguments: # Arg#1 (required): HR number # Arg#2 (optional): table number 1 | 3 | 5 #---------------- #### Check the number of arguments in the correct range. if ($#argv != 2) then echo "Usage: $0 file recno" echo " Print out the spectrophotometry for one star from file + seqno" exit 1 endif set f = $1 ; set recno = $2 #### When called from vizExec, output in latex (htx) if ($?PATH_INFO) then set tex = 1 else set tex = 0 endif switch($f) case "part[13].dat": set w = 10 # Width on 1 column breaksw case "part2.dat": set w = 13 # Width on 1 column breaksw endsw fcat $f | gawk -v w=$w -v n=$recno -v f="$f" -v tex=$tex '\ BEGIN{ if (tex>0) { \ fmt = "\\section{Flux for star {\\em\\#%s} from file {\\tt %s}}"; \ printf(fmt,n,f); print "\n\\begin{alltt}"; \ print "\\# nm log(F) Flux(mW/m2/cm)" } \ else{fmt = "# nm log(F) Flux(mW/m2/cm) for star \#%s from file: %s";\ printf(fmt,n,f); print "" }}\ END{if(tex>0) print "\\end{alltt}\\hline"; else print ""}\ {if(NR0) n++; \ M=log(10.0); for (c=63; c