#++++++++++++++++ #.IDENTIFICATION SimViz.awk0 #.LANGUAGE AWK #.AUTHOR Francois Ochsenbein [CDS] #.ENVIRONMENT #.KEYWORDS #.VERSION 1.0 08-Jun-2000 #.VERSION 1.1 01-Apr-2001: Allow several items in Query (add -go) #.VERSION 1.2 22-Apr-2002: Always issue the -go #.PURPOSE Convert Dic.par into an AWK Script #.COMMENTS Several catalogues may be queried -- just with -go ! # Option sesame ==> choose just _RAJ _DEJ + Main Identification #---------------- BEGIN { # A few definitions... # Default options for the Query from Simbad sesame_arg = "-pos\n-oc=dec\n-out.max=6\n" \ "-out=_RAJ,_DEJ, *ID_MAIN" roman["I"] = 1 ; roman["II"] = 2 ; roman["III"] = 3 ; roman["IV"] = 4 ; roman["V"] = 5 ; roman["VI"] = 6 ; roman["VII"] = 7 ; roman["VIII"] = 8 ; roman["IX"] = 9 ; roman["X"] = 10 ; nqueries = 0 ; } #### Convert an Identifier from Simbad into a valid set of ASU Queries #### 1) When Only the Table Name is Specified function pr5t(table, colval, colname) { #if (nqueries > 0) nqueries++ ; if (sesame>0) print sesame_arg; else print "-5\n-out.add=." ; printf("-source=%s/%s\n", N, table) ; if (colname == "") printf("%s===", M) ; else printf("%s===", colname) ; print colval ; } #### 2) When Source and Constraint are Specified function pr5s(source, column) { #if (nqueries > 0) print "-go" ; nqueries++ ; if (sesame>0) print sesame_arg; else print "-5\n-out.add=." ; printf("-source=%s\n", source) ; if (column != "") print column; } #### Write Position from an IAU Name function outside_range(msg) { # Error message print "#!***" msg " outside range: " input_name exit(1) } function coo_uai(uai_name) ############################################################### # Input = IAU Designation ############################################################### { input_name = uai_name ; name = input_name ; gsub(/[\. ,]/, "", name) ; # Remove the blanks eqx = substr(name,1,1) ; if ((eqx == "J") || (eqx == "j")) equinox = 2000 ; else equinox = 1950 ; gsub(/[A-Za-z]/, "",name) ; # Keep only digits... i = index(name, "+") ; if (i == 0) i = index(name, "-") ; if (i == 0) { print "#!***No +/- sign, can't locate declination part: " input_name exit(1) } if (match(name, /^[0-9][0-9][0-9][0-9][0-9+-]*[0-9][0-9][0-9]*$/) == 0) { print "#!***Can't be a legal IAU format: " input_name exit(1) } sra = substr(name,1,i-1) ; # String RA dec = substr(name,i) ; # String Dec # Compute declination dd = substr(dec, 1, 3) + 0; if ((dd >= 90) || (dd <= -90)) outside_range("Dec.(deg)") ; if ((substr(sra,1,2)+0) >= 24) outside_range("R.A.(hrs)") ; cosdec = cos(dd*atan2(1,0)/90) # Convert degrees --> radians if (cosdec < 0.02) cosdec = 0.02 ##################################### # Estimate Center + Dim of RA ##################################### qra = substr(sra,1,2) " " substr(sra,3,2) ; if ((substr(sra,3,2) +0) >= 60) outside_range("R.A.(min)") ; i = length(sra) if (i == 4) { qra = qra " 30" ; dimra = 15 } else if (i == 5) { sec = substr(sra, 5)*6 ; if (sec > 54) outside_range("R.A.(sec)") ; qra = qra " " sec+3; dimra = 1.5 } else { sec = substr(sra,5,2) ; qra = qra " " sec ; dimra = 0.25 ; if ((sec+0) >= 60) outside_range("R.A.(sec)") ; if (i == 6) qra = qra ".5" ; else { qra = qra "." substr(sra,7) "5" ; dimra /= 10 } } dimra = dimra * 1.2 * cosdec ; ##################################### # Estimate Center + Dim of Dec ##################################### qde = substr(dec, 1, 3) ; i = length(dec) if (i == 3) { qde = qde " 30 00" ; dimde = 60 } # Just degrees else if (i == 4) { sec = substr(dec, 4, 1)*6 ; if (sec > 54) outside_range("Dec.(min)") ; qde = qde " " substr(dec, 4, 1)*6+3 " 00"; dimde = 6 } else { sec = substr(dec, 4, 2) ; if (sec >= 60) outside_range("Dec.(min)") ; qde = qde " " substr(dec, 4, 2) ; dimde = 1 ; if (i == 5) qde = qde " 30" ; else if (i == 6) { sec = substr(dec, 6, 1) *6 ; if (sec > 54) outside_range("Dec.(sec)") ; qde = qde " " sec+3 ; dimde = 0.1 } else { sec = substr(dec, 6, 2) ; qde = qde " " sec ; dimde = 1/60 ; if ((sec+0) >= 60) outside_range("Dec.(sec)") ; if (i == 7) qde = qde ".5" ; else qde = qde "." substr(dec, 8) "5" ; } } dimde = dimde * 1.2 ; ##################################### # Write the Constraints ##################################### print "-c=" qra qde; print "-c.eq=" equinox ; print "-c.bm=" dimra "/" dimde ; } ############################################################### # The Question Mark is a test: is the system up ? ############################################################### /^[?]/ { print "-source=METAhst\nhstid=0\n-go %#Sesame#%"; fflush(); next } ############################################################### # Acronyms made of a single word: insert a blank! ############################################################### NF==1 { if (index($0,"_") > 0) gsub(/_/, " ") ; else sub(/([1-9]*[0-9]*[A-Za-z]*)/, "& ") ; } ############################################################### # Now Come the Catalog-Specific Coding ############################################################### /^AC2000 / { M="AC2000"; N=1247; pr5t("", $2) print "-go %#Sesame#%"; fflush(); next } /^ACO / { M="ACO"; N=7110; if (substr($2,1,1) == "S") pr5t("table5", substr($2,2), "ACOS") ; else pr5t("table[34]", $2) ; print "-go %#Sesame#%"; fflush(); next } /^ACRS / { M="ACRS"; N=1171; pr5t("", $2) print "-go %#Sesame#%"; fflush(); next } /^[R]*AFGL / { M="AFGL"; N=2094; pr5s("II/94", "RAFGL=" $2) print "-go %#Sesame#%"; fflush(); next } /^AG[+-]/ { M="AG"; N=1061; pr5s("1061", "") ; sgn = substr($1,3,1); z=substr($1,4); printf("AGsign=%s\nAGzone=%s\nAGnum=%d\n",sgn,z,$2); printf("-go\n-source=1176\nAGK3=%s%s%04d\n",sgn,z,$3); ### Also AGK3U print "-go %#Sesame#%"; fflush(); next } /^AGK1 [0-9]*.[1-9]/ { M="AGK1"; N=1141; if (index($2, ".")>0) { # YZC with a part number n = split($2, a, ".") pr5s("1141/yzc", "vol=" a[1] "\nvol_pt==" a[2] "\nAG=" $3) } else pr5s("1141/yzc", "vol=" $2 "\nAG=" $3) print "-go %#Sesame#%"; fflush(); next } /^ALS / { M="ALS"; N=5125; pr5t("", $2) print "-go %#Sesame#%"; fflush(); next } /^APG / { M="APG"; N=7074; pr5t("", $2) print "-go %#Sesame#%"; fflush(); next } /^ASCC2.5 / { M="ASCC2.5"; N=1280; pr5t("", $2) print "-go %#Sesame#%"; fflush(); next } /^ATESP J[012]/ { M="ATESP"; N=8063; pr5s("ATESP", "ATESP=" $2) ; print "-go %#Sesame#%"; fflush(); next } /^\[BBW2000\]/ { M="[BBW2000]"; N=73130641; pr5t("", $2 " " $3) print "-go %#Sesame#%"; fflush(); next } /^BD[^A-Z]*$/ { M="BD"; N=1122; if (substr($0,3,1) == " ") { sign = substr($2,1,1); zone = substr($2,2); num = $3; } else { sign = substr($1, 3, 1); zone = substr($1, 4); num = $2 } sub(/[a-z]/,"",num); if (sign == "-") pr5s("I/119/sd", "zone=-" zone "\nnum=" num "\n-go"); pr5s("I/122/bd", "zonesign=" sign "\nzone=" zone "\nnum=" num); print "-go %#Sesame#%"; fflush(); next } /^BWE / { M="BWE"; N=8013; pr5s("VIII/13", "Name==" $2) print "-go %#Sesame#%"; fflush(); next } /^3CR* / { M="3CR"; N=60970932; if (index($2,".") > 0) id = $2; else id = $2 ".0"; pr5t("3cr", id, "3CR") print "-go %#Sesame#%"; fflush(); next } /^4C / { M="4C"; N=8004; s = substr($2,1,1); if ((s=="+") || (s == "-")) id = $2; else id = "+" $2; pr5t("", id) print "-go %#Sesame#%"; fflush(); next } /^5C 5[.]/ { M="5C"; N=8030; pr5s("J/MNRAS/171/475", "Name=5C" $2) print "-go %#Sesame#%"; fflush(); next } /^5C 6[.]/ { M="5C"; N=8030; pr5s("J/MNRAS/182/276/5c6", "5C6=" substr($2,3)) print "-go %#Sesame#%"; fflush(); next } /^5C 7[.]/ { M="5C"; N=8030; pr5s("J/MNRAS/182/276/5c7", "5C7=" substr($2,3)) print "-go %#Sesame#%"; fflush(); next } /^5C 12[.]/ { M="5C"; N=8030; pr5s("J/MNRAS/200/747", "5C12=" substr($2,4)) print "-go %#Sesame#%"; fflush(); next } /^5C 13[.]/ { M="5C"; N=8030; pr5s("J/MNRAS/272/699", "5C13=" substr($2,4)) print "-go %#Sesame#%"; fflush(); next } /^5C 1[456][.]/ { M="5C"; N=8030; pr5s("8030", "ID=" substr($2,4)) print "-go %#Sesame#%"; fflush(); next } /^CABS / { M="CABS"; N=5076; pr5t("", $2) print "-go %#Sesame#%"; fflush(); next } /^CCDM / { M="CCDM"; N=1274; gsub(/[A-Z]*/, "", $2); # REMOVE the COMPONENT -- get ALL components pr5t("ccdm", $2) print "-go %#Sesame#%"; fflush(); next } /^CD[^A-Z]*$/ { M="CD"; N=1114; if (substr($0,3,1) == " ") { pr5s("1114/cd", "zone=" $2 "\nnum=" $3); } else pr5s("1114/cd", "zone=" substr($1,3) "\nnum=" $2); print "-go %#Sesame#%"; fflush(); next } /^CFRS / { M="CFRS"; N=7225; pr5s("CFRS", $2) print "-go %#Sesame#%"; fflush(); next } /^CGCS / { M="CGCS"; N=3227; pr5t("", $2) print "-go %#Sesame#%"; fflush(); next } /^\[CKS91\] / { M="[CKS91]"; N=51011763; pr5t("table*", $2) print "-go %#Sesame#%"; fflush(); next } /^Cl[*]* Mel[ote]* 22 HCG/ { M="Cl*"; N=2131; pr5t("catalog", $4) print "-go %#Sesame#%"; fflush(); next } /^CoRoT / { M="CoRoT"; N=102028; pr5t("exo", $2) print "-go %#Sesame#%"; fflush(); next } /^CPD[^A-Z]*$/ { M="CPD"; N=1108; if (substr($0,4,1) == " ") { pr5s("1108/cpd", "zone=" $2 "\nnum=" $3); } else pr5s("1108/cpd", "zone=" substr($1,4) "\nnum=" $2); print "-go %#Sesame#%"; fflush(); next } /^\[DBA2001\]/ { M="[DBA2001]"; N=73240580; pr5t("", $2) print "-go %#Sesame#%"; fflush(); next } /^DCMC J/ { M="DCMC"; N=2228; pr5t("", $2) print "-go %#Sesame#%"; fflush(); next } /^DENIS / { M="DENIS"; N=102002; pr5t("", $2) print "-go %#Sesame#%"; fflush(); next } /^DENISP / { M="DENISP"; N=41350133; pr5t("", $2 $3) print "-go %#Sesame#%"; fflush(); next } /^2dFGRS / { M="2dFGRS"; N=7250; pr5t("2dfgrs", $2, "Name") print "-go %#Sesame#%"; fflush(); next } /^\[DML87\] / { M="[DML87]"; N=40700095; pr5t("", $2) print "-go %#Sesame#%"; fflush(); next } /^DO / { M="DO"; N=2068; pr5t("catalog", $2) print "-go %#Sesame#%"; fflush(); next } /^3EG / { M="3EG"; N=21230079; pr5t("3eg", $2) print "-go %#Sesame#%"; fflush(); next } /^ESO-LV / { M="ESO-LV"; N=7115; n=split($2, a, "-"); if(n==2) ID=a[1]*10000 + a[2]; else ID=a[1]; pr5t("", ID) print "-go %#Sesame#%"; fflush(); next } /^EUVE / { M="EUVE"; N=2203; sub(/[.]/, "") # Remove the . in the true format pr5t("", $0) print "-go %#Sesame#%"; fflush(); next } /^FAUST / { M="FAUST"; N=20960461; pr5t("", $2) print "-go %#Sesame#%"; fflush(); next } /^Cl\* NGC 2682 FBC / { M="FBC"; N=51120628; pr5t("cat2000", $5, "ID") print "-go %#Sesame#%"; fflush(); next } /^FBS [0-9][0-9]*$/ { M="FBS"; N=2223; pr5t("", $2, "Seq") print "-go %#Sesame#%"; fflush(); next } /^FBS / { M="FBS"; N=2223; pr5t("", $2, "FBS") print "-go %#Sesame#%"; fflush(); next } /^\[FDP2000\] / { M="[FDP2000]"; N=51202206; pr5t("", $2) print "-go %#Sesame#%"; fflush(); next } /^FGC / { M="FGC"; N=7162; pr5t("", $2) print "-go %#Sesame#%"; fflush(); next } /^FIRSTJ/ { M="FIRST"; N=8059; pr5t("", "J" $2) print "-go %#Sesame#%"; fflush(); next } /^FIRST / { M="FIRST"; N=8059; pr5t("", $2) print "-go %#Sesame#%"; fflush(); next } /^FK5 / { M="FK5"; N=1149; pr5s("FK5", "FK5=" $2) print "-go %#Sesame#%"; fflush(); next } /^FK6 / { M="FK6"; N=1264; pr5t("", $2) print "-go %#Sesame#%"; fflush(); next } /^F3R / { M="F3R"; N=40850805; pr5t("", $2) print "-go %#Sesame#%"; fflush(); next } /^FSM / { M="FSM"; N=33720364; pr5t("", $1 "_" $2, "Source") print "-go %#Sesame#%"; fflush(); next } /^G [0-9][0-9]*-[0-9]/ { M="G"; N=1079; split($2, a, "-"); ID=sprintf("G%03d-%03d", a[1], a[2]); pr5s("1079/north,1112/south", "G=" ID) print "-go %#Sesame#%"; fflush(); next } /^V[*] / { M="GCVS"; N=102025; sub(/chi/, "khi"); # Another way in GCVS !!! Vn = $2; # Problem: V456 --> V0456 if((length(Vn)==4) && (substr(Vn,1,1)=="V")) Vn="V0" substr(Vn,2) pr5t("gcvs_cat", sprintf("%-6s%s", Vn,$3)) print "-go %#Sesame#%"; fflush(); next } /^GJ / { M="GJ"; N=5070; cata = "5070" ; qcol = "Name"; sub(/[A-Z][A-Z]*$/, "") ; # Remove trailing letters (give accees to all) sub(/[.]0$/, "") ; # Remove GJ 210.0 --> GJ 210 if ($2 > 9000) { cata = "5032"; qcol = "Woolley" } # Woolley else if ($2 > 3000) prefix = "[GN]* "; else prefix = "G* " pr5s(cata, qcol "=" prefix $2) # pr5t uses === equality #pr5t("", prefix $2, "Name") print "-go %#Sesame#%"; fflush(); next } /^\[GKL99\] / { M="[GKL99]"; N=41390555; pr5t("", $2, "Seq") print "-go %#Sesame#%"; fflush(); next } /^GLMP / { M="GLMP"; N=41260479; pr5t("table6", $2) print "-go %#Sesame#%"; fflush(); next } /^GMP / { M="GMP"; N=7042; pr5t("", $2) print "-go %#Sesame#%"; fflush(); next } /^GSC / { M="GSC"; N=1220; h = substr($2,1,1) ; if ((h=="N") || (h=="S")) { # GSC2 !! pr5s("1271", "GSC2.2==" $2) ; } else { if (index($2,"-")>0) { split($2,g,"-"); gsc=sprintf("%05d%05d", g[1], g[2]) } else gsc = $2; pr5s("1254", "GSC=" gsc); } #sub(/-/, "", $2) ; #pr5s("I/220,I/254,I/255", "GSC=" $2) print "-go %#Sesame#%"; fflush(); next } /^HD / { M="HD"; N=3135; if (($2+0) > 272150) pr5s("3182/catalog", "HD=" $2+0) else pr5t("catalog", $2+0) print "-go %#Sesame#%"; fflush(); next } /^HIC / { M="HIC"; N=1196; pr5t("", $2) print "-go %#Sesame#%"; fflush(); next } /^HIP / { M="HIP"; N=1311; pr5s("1311/hip2,1239/hip_main,V/137D/XHIP", "HIP=" $2) print "-go %#Sesame#%"; fflush(); next } /^HIPASS J/ { M="HIPASS"; N=8073; pr5t("", $2) print "-go %#Sesame#%"; fflush(); next } /^HR / { M="HR"; N=5050; pr5t("catalog", $2) print "-go %#Sesame#%"; fflush(); next } /^IERS / { M="IERS"; N=1251; pr5t("", substr($2,2)) print "-go %#Sesame#%"; fflush(); next } /^IRAS [012]/ { M="IRAS"; N=2125; pr5s("II/125/main,II/126/sources", "IRAS==" $2 "*") print "-go %#Sesame#%"; fflush(); next } /^IRAS F[012]/ { M="IRAS"; N=2125; pr5s("II/156/main", "IRAS==" $2 "*") print "-go %#Sesame#%"; fflush(); next } /^IRAS R[012]/ { M="IRAS"; N=2125; pr5s("II/274/iras_r", "IRAS==" substr($2,2)) print "-go %#Sesame#%"; fflush(); next } /^IRAS S[012]/ { M="IRAS"; N=2125; pr5s("II/126/sources", "IRAS==" substr($2,2) "*") print "-go %#Sesame#%"; fflush(); next } /^IRAS X[012]/ { M="IRAS"; N=2125; pr5s("VII/73/irassss", "IRAS==" $2 "*") print "-go %#Sesame#%"; fflush(); next } /^IRAS Z[012]/ { M="IRAS"; N=2125; pr5s("II/275/fsr", "IRAS==" $2 "*") print "-go %#Sesame#%"; fflush(); next } /^IRC / { M="IRC"; N=2002; pr5t("", $2) print "-go %#Sesame#%"; fflush(); next } /^ISOGAL[ -]PJ/ { M="ISOGAL"; N=2243; pr5t("", substr($0,9)) print "-go %#Sesame#%"; fflush(); next } /^IUE / { M="IUE"; N=6110; pr5s("VI/110", "Camera=" substr($2,1,3) "\nImage=" substr($2,4)) print "-go %#Sesame#%"; fflush(); next } /^\[L91b\] / { M="[L91b]"; N=5081; pr5t("", $2, "Seq") print "-go %#Sesame#%"; fflush(); next } /^K73 / { M="K73"; N=7082; pr5s("7082,J/A+A/411/391", "CIG=" $2) print "-go %#Sesame#%"; fflush(); next } /^Cl\* NGC 6205 KAD / { M="KAD"; N=2248; pr5t("catalog", $5, "KAD") print "-go %#Sesame#%"; fflush(); next } /^KIC / { M="KIC"; N=5133; pr5t("", $2) print "-go %#Sesame#%"; fflush(); next } /^K72 / { M="KPG"; N=7077; pr5t("", $2, "ID") print "-go %#Sesame#%"; fflush(); next } /^KPG / { M="KPG"; N=7077; id=$2; sub(/[a-z]/,"",id); pr5t("", id, "ID"); print "-go %#Sesame#%"; fflush(); next } /^\[KP2001\] / { M="[KP2001]"; N=1016004401; pr5t("", $2) print "-go %#Sesame#%"; fflush(); next } /^KUG / { M="KUG"; N=7179; pr5t("", $2) print "-go %#Sesame#%"; fflush(); next } /^Lan / { M="Lan"; N=2257; pr5t("lanning", $2) print "-go %#Sesame#%"; fflush(); next } /^LBQS / { M="LBQS"; N=51091498; pr5t("", $2) print "-go %#Sesame#%"; fflush(); next } /^LCRS / { M="LCRS"; N=7203; pr5s("VII/203/catalog", "") ; coo_uai($2); print "-go %#Sesame#%"; fflush(); next } /^LF / { M="LF"; N=2221; sub(/ *[+]/, "+"); sub(/ *[-]/, "-"); pr5t("", $0) print "-go %#Sesame#%"; fflush(); next } /^LHS / { M="LHS"; N=1087; pr5s("1087", "LHS=" $2) #pr5t("", $2, "LHS") # Col. name specified because LHS non left-adjested print "-go %#Sesame#%"; fflush(); next } /^LS / { M="LS"; N=3043; if ($2 in roman) { ### LS-North pr5s("III/76", "Vol=" roman[$2] ); print "LS=" $3 "* " $4; } else { ### LSs pr5t("", $2, "LSS") } print "-go %#Sesame#%"; fflush(); next } /^LSE / { M="LSE"; N=61070846; pr5t("catalog", $2) print "-go %#Sesame#%"; fflush(); next } /^LSPM J/ { M="LSPM"; N=1298; pr5t("lspm_n", $2) print "-go %#Sesame#%"; fflush(); next } /^LSPM [0-9]/ { M="LSPM"; N=1298; pr5t("lspm_n", "J" $2) print "-go %#Sesame#%"; fflush(); next } /^MACHO / { M="MACHO"; N=2247; if (index($2, ".") > 0) split(substr($0,7), t, ".") ; else { t[1]=$2; t[2]=$3; t[3]=$4 } pr5t("", t[1], "Field") ; print "Tile=" t[2] ; print "Seqn=" t[3] ; print "-go %#Sesame#%"; fflush(); next } /^2MASS [Jj]/ { M="2MASS"; N=102003; pr5s("II/246", "2MASS=" substr($2,2)) # Ignore the J print "-go %#Sesame#%"; fflush(); next } /^2MASS [012]/ { M="2MASS"; N=102003; pr5s("II/246", "2MASS=" $2) # No 'J' print "-go %#Sesame#%"; fflush(); next } /^2MASSI J/ { M="2MASSI"; N=102003; pr5s("II/241", "Name=" substr($2,2)) print "-go %#Sesame#%"; fflush(); next } /^2MASX [Jj]/ { M="2MASX"; N=7233; pr5s("VII/233", "2MASX===" substr($2,2)) # Ignore the J print "-go %#Sesame#%"; fflush(); next } /^MITG .*[abcd]/ { M="MG"; N=8052; pr5s("VIII/52", substr($2,1,length($2)-1)); print "m_MG=" substr($2,length($2)); print "-go %#Sesame#%"; fflush(); next } /^MITG / { M="MG"; N=8052; pr5s("VIII/52", $2) print "-go %#Sesame#%"; fflush(); next } /^MGC .*[0-9]/ { M="MGC"; N=7240; pr5t("", $2) print "-go %#Sesame#%"; fflush(); next } /^MLLA / { M="MLLA"; N=15730366; pr5t("table6", $2) print "-go %#Sesame#%"; fflush(); next } /^Cl[*] NGC 2682 MMJ / { M="MMJ"; N=51060181; pr5t("table3", $5) print "-go %#Sesame#%"; fflush(); next } /^astorb / { M="MP"; N=102001; pr5t("", $2) print "-go %#Sesame#%"; fflush(); next } /^MSX5C / { M="MSX5C"; N=5107; pr5t("", $2) print "-go %#Sesame#%"; fflush(); next } /^MSX6C / { M="MSX6C"; N=5114; pr5t("", $2) print "-go %#Sesame#%"; fflush(); next } /^MSX6C / { M="MSX"; N=5114; pr5t("", $2) print "-go %#Sesame#%"; fflush(); next } /^NGC [0-9][0-9]* *$/ { M="NGC"; N=7001; pr5t("", $2) print "-go %#Sesame#%"; fflush(); next } /^rNLTT / { M="rNLTT"; N=15821011; pr5s("J/ApJ/582/1011", "NLTT=" $2) print "-go %#Sesame#%"; fflush(); next } /^NLTT / { M="NLTT"; N=1098; pr5s("1098", "recno=" $2) print "-go %#Sesame#%"; fflush(); next } /^NOMAD[1-]* / { M="NOMAD1"; N=1297; if (index($2, "-") > 0) { split($2, a, "-"); pr5t("", sprintf("%04d-%08d", a[1], a[2])) ; } else pr5t("", $2) print "-go %#Sesame#%"; fflush(); next } /^NPM1 / { M="NPM1"; N=1199; pr5t("", $2, "Name") print "-go %#Sesame#%"; fflush(); next } /^NPM1G / { M="NPM1G"; N=1200; pr5t("", $2, "Name") print "-go %#Sesame#%"; fflush(); next } /^NPM2 / { M="NPM2"; N=1283; pr5t("", $2, "Name") print "-go %#Sesame#%"; fflush(); next } /^NSV / { M="NSV"; N=2250; pr5s("2250/nsv_cat", "NSV=" $2) print "-go %#Sesame#%"; fflush(); next } /^NVSS / { M="NVSS"; N=8065; s = $2; if(substr($2,1,1)=="J") s=substr(s,2); gsub(/[.][0-9]*/, "", s); pr5s("8065", "NVSS===" s) print "-c=J" s; print "-go %#Sesame#%"; fflush(); next } /^OGLE BWC [0-9][0-9]*$/ { M="OGLE"; N=1244; pr5s("1244", "OGLE-BWC=" $3) print "-go %#Sesame#%"; fflush(); next } /^OGLE BWC I [0-9][0-9]*$/ { M="OGLE"; N=1244; pr5s("1244", "OGLE-BWC=" $4) print "-go %#Sesame#%"; fflush(); next } /^OGLE BW[CM0-9][^V ]* V[0-9][0-9]*$/ { M="OGLE"; N=1244; pr5s("2213", "OGLE=" $2 " " $3) print "-go %#Sesame#%"; fflush(); next } /^OGLE SCL V[0-9][0-9]*$/ { M="OGLE"; N=1244; pr5s("J/A+AS/112/407", "ID=" substr($3,2)) print "-go %#Sesame#%"; fflush(); next } /^OGLE BUL-SC[0-9][0-9]* [0-9][0-9]*$/ { M="OGLE"; N=1244; pr5s("J/MNRAS/348/1439", "OGLE=" $3); print "SC=" substr($2,7); print "-go %#Sesame#%"; fflush(); next } /^OGLE LMC[_-]SC[0-9][0-9]* [0-9][0-9]*$/ { M="OGLE"; N=1244; pr5s("J/other/AcA/49.543/table1", "Cepheid=" $3) print "Field=LMC_SC" substr($2,7); print "-go %#Sesame#%"; fflush(); next } /^OGLE SMC[_-]SC[0-9][0-9]* [0-9][0-9]*$/ { M="OGLE"; N=1244; pr5s("J/other/AcA/49.543/table2", "Cepheid=" $3) print "Field=SMC_SC" substr($2,7); print "-go %#Sesame#%"; fflush(); next } /^OMHR / { M="OMHR"; N=41110169; pr5t("", $2) print "-go %#Sesame#%"; fflush(); next } /^\[P93\] / { M="[P93]"; N=2187; pr5t("", $2, "Num") print "-go %#Sesame#%"; fflush(); next } /^PB / { M="PB"; N=2239; pr5t("", $2) print "-go %#Sesame#%"; fflush(); next } /^PG / { M="PG"; N=2207; pr5t("catalog", $2) print "-go %#Sesame#%"; fflush(); next } /^PGC / { M="PGC"; N=7237; pr5t("pgc", $2) print "-go %#Sesame#%"; fflush(); next } /^PHL / { M="PHL"; N=3074; pr5t("phl", $2) print "-go %#Sesame#%"; fflush(); next } /^PLX [^0-9]*$/ { M="PLX"; N=1238; pr5t("picat", $2 ".00", "GCTP") print "-go %#Sesame#%"; fflush(); next } /^PLX [^0-9]*.[0-9]$/ { M="PLX"; N=1238; pr5t("picat", $2 "0", "GCTP") print "-go %#Sesame#%"; fflush(); next } /^PLX [^0-9]*.[0-9][0-9]$/ { M="PLX"; N=1238; pr5t("picat", $2, "GCTP") print "-go %#Sesame#%"; fflush(); next } /^PKS / { M="PKS"; N=8015; pr5s("VIII/15", "Bname=B" $2) print "-go %#Sesame#%"; fflush(); next } /^PMN / { M="PMN"; N=8038; pr5s("VIII/38", "PMNJ=PMN" $2) print "-go %#Sesame#%"; fflush(); next } /^PNG [0123]/ { M="PNG"; N=5084; pr5s("5084/main,5127/mash*", "PNG=*" $2) print "-go %#Sesame#%"; fflush(); next } /^PNG? G[0123]/ { M="PNG"; N=5084; pr5s("5084/main,5127/mash*", "PNG=*" substr($2,2)) print "-go %#Sesame#%"; fflush(); next } /^PPM / { M="PPM"; N=1146; if ($2 < 181732) pr5s("I/146", "PPM=" $2) ; else if ($2 < 400000) pr5s("I/193", "PPM=" $2) ; else if ($2 < 700000) pr5s("I/206", "PPM=" $2) ; else pr5s("I/208", "PPM=" $2) ; print "-go %#Sesame#%"; fflush(); next } /^PSR / { M="PSR"; N=7189; if (substr($2,1,1) == "J") pr5t("", substr($2,2), "Jname") ; else if (substr($2,1,1) == "B") pr5t("", substr($2,2), "Bname") ; else pr5t("", $2, "Bname") print "-go %#Sesame#%"; fflush(); next } /^2QZ J/ { M="2QZ"; N=7223; pr5t("", $2, "Name") print "-go %#Sesame#%"; fflush(); next } /^2RE J/ { M="2RE"; N=72741165; if (length($0) == 13) pr5s("J/MNRAS/274/1165/catalog", "2RE=" $0) else pr5s("J/MNRAS/274/1194", "2RE=" $0) ; print "-go %#Sesame#%"; fflush(); next } /^RFGC / { M="RFGC"; N=7219; pr5t("", $2) print "-go %#Sesame#%"; fflush(); next } /^RKK / { M="RKK"; N=41410123; pr5s("RKK", $2) print "-go %#Sesame#%"; fflush(); next } /^ROS-ORI/ { M="ROS-ORI"; N=1001032101; pr5s("ROS-ORI", "ROS-ORI=" $2) ; print "-go %#Sesame#%"; fflush(); next } /^RXC / { M="RXC"; N=34250367; pr5s("9010/1rxs,9029", "RXC===" $0) print "-go %#Sesame#%"; fflush(); next } /^1RXS / { M="1RXS"; N=9010; pr5s("9010/1rxs,9029", "1RXS===" $2) print "-go %#Sesame#%"; fflush(); next } /^1RXSJ / { M="1RXSJ"; N=9010; pr5s("9010/1rxs,9029", "1RXS=J" $2) print "-go %#Sesame#%"; fflush(); next } /^RZB2000 / { M="RZB2000"; N=33540823; pr5t("catalog", $2, "RZB2000") print "-go %#Sesame#%"; fflush(); next } /^SAO / { M="SAO"; N=1131; pr5t("", $2) print "-go %#Sesame#%"; fflush(); next } /^SDSS J/ { M="SDSS7"; N=2294; pr5s("2294", "-c=" $2 ",rs=1") print "-go %#Sesame#%"; fflush(); next } /^SDSS J/ { M="SDSS9"; N=5139; pr5s("2294", "-c=" $2 ",rs=1") print "-go %#Sesame#%"; fflush(); next } /^SPM4 / { M="SPM4"; N=1320; pr5t("", $2) print "-go %#Sesame#%"; fflush(); next } /^StHa / { M="StHa"; N=13000779; pr5t("", $2) print "-go %#Sesame#%"; fflush(); next } /^SUMSSJ / { M="SUMSS"; N=8070; pr5s("8070", "-c=J" $2 ",rs=10") print "-go %#Sesame#%"; fflush(); next } /^SUMSS / { M="SUMSS"; N=8070; s = $2; if(substr($2,1,1)!="J") s="J" s; pr5s("8070", "-c=" s ",rs=10") print "-go %#Sesame#%"; fflush(); next } /^TDSC / { M="TDSC"; N=1276; pr5s("I/276/[cs]*", "TDSC=" $2 "\nm_TDSC=" $3); print "-go %#Sesame#%"; fflush(); next } /^TYC / { M="TYC"; N=1259; if (index($2, "-") > 0) split(substr($0,5), t, "-") ; else if (NF==2) { t[1]=int($2/100000); t[2]=($2-100000*t[1]); t[3]=$2%10; t[2]=int(t[2]/10) } else { t[1]=$2; t[2]=$3; t[3]=$4 } pr5t("", t[1], "TYC1") ; print "TYC2=" t[2] ; print "TYC3=" t[3] ; print "-go %#Sesame#%"; fflush(); next } /^TYC2 / { M="TYC2"; N=1259; pr5t("", $2, "TYC1") ; print "TYC2=" $3 ; print "TYC3=" $4 ; print "-go %#Sesame#%"; fflush(); next } /^1UCAC / { M="1UCAC"; N=1268; pr5t("", $2) print "-go %#Sesame#%"; fflush(); next } /^UCAC1 / { M="UCAC1"; N=1268; pr5t("", $2) print "-go %#Sesame#%"; fflush(); next } /^2UCAC / { M="2UCAC"; N=1289; pr5t("", $2, "2UCAC") print "-go %#Sesame#%"; fflush(); next } /^UCAC2 / { M="UCAC2"; N=1289; pr5t("", $2, "2UCAC") print "-go %#Sesame#%"; fflush(); next } /^UCAC3 / { M="3UC"; N=1315; pr5t("", $2, "3UC") print "-go %#Sesame#%"; fflush(); next } /^UCAC3 / { M="UCAC3"; N=1315; pr5t("", $2, "3UC") print "-go %#Sesame#%"; fflush(); next } /^UCAC4 / { M="UCAC4"; N=1322; pr5t("", $2, "UCAC4") print "-go %#Sesame#%"; fflush(); next } /^UCM / { M="UCM"; N=20950387; pr5s("UCM", $2) print "-go %#Sesame#%"; fflush(); next } /^UGC / { M="UGC"; N=7026; pr5t("", $2+0) A=substr($2,length($2),1); if (A!="A") A="" ; print "A=" A ; print "-go %#Sesame#%"; fflush(); next } /^UDXS J/ { M="UDXS"; N=2316; pr5s("UDXS", "-c=" $2 ",rs=1") print "-go %#Sesame#%"; fflush(); next } /^UGCS J/ { M="UGCS"; N=2314; pr5s("UGCS", "-c=" $2 ",rs=1") print "-go %#Sesame#%"; fflush(); next } /^UGPS J/ { M="UGPS"; N=2316; pr5s("UGPS", "-c=" $2 ",rs=1") print "-go %#Sesame#%"; fflush(); next } /^ULAS J/ { M="ULAS"; N=2314; pr5s("ULAS", "-c=" $2 ",rs=1") print "-go %#Sesame#%"; fflush(); next } /^UM / { M="UM"; N=7171; pr5t("", sprintf("%d", $2+0)); ### Numeric Part m = substr($2,length($2)); if (m >= "A") print "m_UM=" m ; print "-go %#Sesame#%"; fflush(); next } /^USNO[-A]*1[.0]* / { M="USNO-A1.0"; N=1243; if (index($2, "-") > 0) { split($2, a, "-"); pr5t("", sprintf("%04d-%08d", a[1], a[2])) ; } else pr5t("", $2) print "-go %#Sesame#%"; fflush(); next } /^USNO[-A]*2[.0]* / { M="USNO-A2.0"; N=1252; if (index($2, "-") > 0) { split($2, a, "-"); pr5t("", sprintf("%04d-%08d", a[1], a[2])) ; } else pr5t("", $2) print "-go %#Sesame#%"; fflush(); next } /^USNO[-B]*1[.0]* / { M="USNO-B1.0"; N=1284; if (index($2, "-") > 0) { n = split($2, a, "-"); if (n == 3) { ### Sometimes uses the Tycho-2 pr5s("Tycho-2", "TYC1=" a[1] "\nTYC2=" a[2] "\nTYC3=" a[3]) } else pr5t("", sprintf("%04d-%07d", a[1], a[2])) ; } else pr5t("", $2) print "-go %#Sesame#%"; fflush(); next } /^VDB / { M="VDB"; N=7021; pr5t("", $2) print "-go %#Sesame#%"; fflush(); next } /^VSOP J/ { M="VSOP"; N=100520997; pr5t("", $2) print "-go %#Sesame#%"; fflush(); next } /^WD / { M="WD"; N=3210; id=$2; if(length($2)>8) id=substr($2,1,8); pr5s("WD/catalog", "WD=" id "*") print "-go %#Sesame#%"; fflush(); next } /^p. WDS J[012]/ { M="WDS"; N=102026; pr5s("B/wds/wds", "WDS===" substr($3,2,10)) print "-go %#Sesame#%"; fflush(); next } /^p. WDS [012]/ { M="WDS"; N=102026; pr5s("B/wds/wds", "WDS===" $3) print "-go %#Sesame#%"; fflush(); next } /^p WDS J[012]/ { M="WDS"; N=102026; pr5s("B/wds/wds", "WDS===" substr($3,2,10)) print "-go %#Sesame#%"; fflush(); next } /^p WDS [012]/ { M="WDS"; N=102026; pr5s("B/wds/wds", "WDS===" $3) print "-go %#Sesame#%"; fflush(); next } /^WDS J[012]/ { M="WDS"; N=102026; pr5s("B/wds/wds", "WDS===" substr($2,2,10)) print "-go %#Sesame#%"; fflush(); next } /^WDS [012]/ { M="WDS"; N=102026; pr5s("B/wds/wds", "WDS===" $2) print "-go %#Sesame#%"; fflush(); next } /^WISH .*[abpm]/ { M="WISH"; N=8069; pr5t("", substr($2, 1, length($2)-1), "Name") pr5t("", substr($2, length($2), 1), "f_Name") print "-go %#Sesame#%"; fflush(); next } /^WISH / { M="WISH"; N=8069; pr5t("", $2, "Name") print "-go %#Sesame#%"; fflush(); next } /^WKK98 / { M="WKK98"; N=33800441; pr5s("WKK98", $2) print "-go %#Sesame#%"; fflush(); next } /^WN [BJ][0-9]*/ { M="WN"; N=8062; gsub(/[A-Za-z]$/, "", $2); # REMOVE the COMPONENT -- get ALL components pr5s("8062,8069", "-c=" $2) print "-go %#Sesame#%"; fflush(); next } /^WN .*[abpm]/ { M="WN"; N=8062; pr5t("", substr($2, 1, length($2)-1), "Name") pr5t("", substr($2, length($2), 1), "f_Name") print "-go %#Sesame#%"; fflush(); next } /^WN / { M="WN"; N=8062; pr5t("", $2, "Name") print "-go %#Sesame#%"; fflush(); next } /^YZC [0-9]*.[1-9]/ { M="YZC"; N=1141; if (index($2, ".")>0) { # YZC with a part number n = split($2, a, ".") pr5s("1141/yzc", "vol=" a[1] "\nvol_pt==" a[2] "\nID=" $3) } else pr5s("1141/yzc", "vol=" $2 "\nID=" $3) print "-go %#Sesame#%"; fflush(); next } /^Cl\* NGC 2682 FBC / { M="ZTP"; N=41000243; pr5t("cat2000", $5, "ID") print "-go %#Sesame#%"; fflush(); next } { c = $1; s="="; for (i=2; i<=NF; i++) { c = c s $i; s = " " }\ exit(1); pr5s("not_found", c); \ print "-go %#Sesame#%"; fflush(); next}