#!/bin/csh -f #++++++++++++++++ #.IDENTIFICATION getsp #.LANGUAGE C_shell #.AUTHOR Francois Ochsenbein #.ENVIRONMENT CDS Catalogues Service #.KEYWORDS #.VERSION 1.0 14-Jan-1998: Creation #.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): Name of star (from stars.dat) #---------------- #### Check the number of arguments in the correct range. if ($#argv != 1) then echo "Usage: $0 star_name" echo " Print out the spectrophotometry for one star " 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 computed) set f = fluxes.dat set star2 = "`fcat .new=old.txt | tail -n +$1 | head -1`" #set star = "`fcat .new=old.txt | tail -n +$1 | head -1 | acut -d= -f2`" fcat $f | gawk -v star2="$star2" -v tex=$tex -F= '\ BEGIN{ split(star2,s); star=s[2]; if (tex>0) { fg="FireBrick"; \ fmt= "\\subsection*{Flux for star \\object{%s} ({\\fg{%s}%s})}\n";\ printf(fmt,s[1],fg,star); print "\\begin{alltt}\n"; \ printf("{\\fg{%s}\\hr\\#Lambda F(Lambda) (Lam+1.4) (Lam+2.8)", fg); \ printf(" (Lam+4.2) (Lam+5.6) (Lam+7.0) (Lam+8.4)\n"); \ printf("\\# (\\AA) (mW/m$^2$/\\AA)\n\\hr}"); }\ else printf("# nm Flux(erg/cm2/\\AA) for star %s\n", star); fflush()} \ END{if(tex>0) print "\\end{alltt}\\hline"; else print ""}\ {if(index($0,star)!=1) { if (wl>0) exit; next} if(wl==0) wl=3510; \ printf("%7.1f %s\n", wl, substr($0, 11)) ; wl += 7*1.4 } '|uniq exit 0 #######################################################################