# Process the table of radial velocities # Last change: Apr 21, 2003 # Result: S1|1|49987.472|-11.55|0.66|2.30|a| BEGIN {OFS="|"; sn=0; count1=0; count2=0; flag=0; Orbit=0; RVComp=""; RVtype=""; CMTcol=""; CONVFMT="%.2f"; Wtflag=""; Noteflag=0;} { #$0= substr($0,0,length-1); # Remove line feed characters # Ignore comments if (substr($0,1,1)=="#") {$0=""}; if ($1=="Notes") {Noteflag=1} if ($1=="EndNotes") {Noteflag=0} if (Noteflag==0) { if ($1=="System") {sn=$2;flag=0; } # new system if ($1=="Orbit") {Orbit=$2;flag=0;} # new orbit if ($1=="RVComp") {RVComp=$2} # Component ID if ($1=="Wtflag") {Wtflag=$2} # Compute weights from sigma if ($1=="Radvel") {flag=1; RVtype=$2; CMTcol=$3; if (RVtype=="") {RVtype="S1ew"; CMTcol=5} } # default RV type if ($1=="Notes") {flag=0; CMTcol=""; count1=0; count2=0; } # if ((index($1,".") > 4)&&(flag>0)) { # Get comment and/or component identification CMT=""; if (CMTcol==3) {CMT=$3}; if (CMTcol==4) {CMT=$4}; if (CMTcol==5) {CMT=$5}; if (CMTcol==6) {CMT=$6}; if (CMTcol==7) {CMT=$7}; note=CMT; if (RVComp=="") {RVComp="a"}; # Get the numerical data jd = $1; # Convert years to JD? if ($1<9000){ CONVFMT="%.3f"; jd = 365.25*(jd-1986)+46431.5 ""; CONVFMT="%.2f"} if (RVtype=="S1") { vr = $2; evr ="";} if (RVtype=="S1e") { vr = $2; evr = $3;} if (RVtype=="S1ew") { vr = $2; evr = $3; weight=$4;} if (RVtype=="ab") { vr = $2; evr = "";} if (RVtype=="abe") { vr = $2;evr = $3; } if (RVtype=="S2") { vr1 = $2; vr2 = $3; evr1=""; evr2="";} if (RVtype=="S2e") { vr1 = $2; evr1 = $3; vr2 = $4; evr1 = $5;} # Component identification if ((RVtype=="ab")||(RVtype=="abe")) {RVComp="a"; if (substr(CMT,1,1)=="b") {RVComp="b"; note=substr(CMT,2);} if (substr(CMT,1,1)=="a") { RVComp="a"; note=substr(CMT,2);} } # Output the data if ((RVtype=="S2")||(RVtype=="S2e")) { if ((Wtflag!="")&&(evr1>0)) {weight=1./(evr1^2 + 0.3^2) ""} else {weight=1}; if (index(CMT,":")>0) {weight=0}; print "s"sn,Orbit, jd,vr1,evr1,weight,"a",note; count1++; if ((Wtflag!="")&&(evr2>0)) {weight=1./(evr2^2 + 0.3^2) ""} else {weight=1}; if (index(CMT,":")>0) {weight=0}; print "s"sn,Orbit, jd,vr2,evr2,weight,"b",note; count2++; # if (vr2!=""){print "s"sn,Orbit, jd,vr2,evr2,weight,"b",note; count2++} } else { # print RVtype; if ((Wtflag!="")&&(evr>0)) {weight=1./(evr^2 + 0.3^2) ""} else {weight=1}; if (index(CMT,":")>0) {weight=0}; if (RVtype=="S1ew") {weight=$4}; print "s"sn,Orbit, jd,vr,evr,weight,RVComp,note; if (RVComp=="a") {count1++} else {count2++}; } } } # End RV data } # END{print "Total vel.1: "count1" vel2: "count2}