#!/bin/csh -f #++++++++++++++++ #.IDENTIFICATION getsp #.LANGUAGE C_shell #.AUTHOR Francois Ochsenbein #.ENVIRONMENT CDS Catalogues Service #.KEYWORDS #.VERSION 1.0 08-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 for # Catalogue III/201 = Spectrophotometric Pulkovo Catalog #.COMMENTS The program accepts the following arguments: # Arg#1 (required): Seq number #---------------- #### Check the number of arguments in the correct range. if ($#argv != 1) then echo "Usage: $0 Seq_number" exit 1 endif #### When called from vizExec, output in latex (htx) if ($?PATH_INFO) then set tex = 1 else set tex = 0 endif #### Print the wavelength and flux (Wavelength in col#1, flux in col#k) fcat catalog.dat | gawk -v n=$1 -v tex=$tex '\ BEGIN{if (tex>0) { \ fmt= "\\section{Flux for star {\\em\\#%s}}\n";\ printf(fmt,n); print "\\begin{alltt}\n\\# nm Flux(mW/m2/cm)" }\ else printf "# nm Flux(mW/m2/cm) for star #%s\n",n }\ END{if(tex>0) print "\\end{alltt}\\hline"; else print ""}\ {if(NR