aboutsummaryrefslogtreecommitdiff
path: root/vo/src/OLD
diff options
context:
space:
mode:
Diffstat (limited to 'vo/src/OLD')
-rw-r--r--vo/src/OLD/datascope.cl152
-rw-r--r--vo/src/OLD/fchart.cl136
-rw-r--r--vo/src/OLD/sloanspec.cl413
-rw-r--r--vo/src/OLD/vizier.cl65
4 files changed, 766 insertions, 0 deletions
diff --git a/vo/src/OLD/datascope.cl b/vo/src/OLD/datascope.cl
new file mode 100644
index 00000000..6eb1cdec
--- /dev/null
+++ b/vo/src/OLD/datascope.cl
@@ -0,0 +1,152 @@
+#{ DATASCOPE -- Toy DataScope task that returns a table of data services
+# and the number of results that can be expected for each given either an
+# input image or object name. For image input, the WCS footprint is computed
+# and used as the search parameters; For an object name the coordinates are
+# resolved and the search radius specified by the user is used.
+#
+# Example: Query a specific set of services, finding how many hits would
+# be returned against the dev$wpix test image
+#
+# cl> datascope dev$wpix service="GSC2.2,USNO-B1,DSS2"
+# #Num ShortName Count IVO Identifier
+# #--- --------- ----- --------------
+# 1 GSC2.2 50 ivo://archive.stsci.edu/gsc/gsc2.2
+# 2 USNO-B1 344 ivo://fs.usno/cat/usnob
+# 3 DSS2 1 ivo://archive.stsci.edu/dss/dss2
+#
+# REQUIRES: NVO package and VO-CL builtin functions.
+#
+# M. Fitzpatrick, Aug 2006
+
+
+procedure datascope (what)
+
+string what { prompt = "Object Name or Image" }
+string service = "cone" { prompt = "Service Type or list" }
+string bandpass = "optical" { prompt = "Bandpass of search" }
+real sr = 0.25 { prompt = "search radius" }
+
+bool filter = yes { prompt = "Filter results?" }
+bool verbose = yes { prompt = "Verbose output?" }
+int status = 0 { prompt = "Service status code" }
+
+begin
+ string url, tname, stype, this, bpass
+ string sname, ivorn, regResults, junk, svctyp
+ string zresp, eresp
+ real ra, dec, size
+ bool verb, filt
+ int dal, index, count, lnum
+
+ this = what
+ bpass = bandpass
+ verb = verbose
+ stype = service
+ filt = filter
+
+ if (stype == "catalog") {
+ stype = "cone"
+ } else if (stype == "image") {
+ stype = "siap"
+ }
+ ;
+
+ if (imaccess (this)) {
+ iferr { wcsinfo (this) } then {
+ error (0, "Cannot determine image coords for `"//this//"'")
+ } else {
+ ra = wcsinfo.midx
+ dec = wcsinfo.midy
+ size = max (wcsinfo.width, wcsinfo.height) / 60.0
+ }
+
+ } else {
+ # Assume it's an object name, resolve to coords.
+ sesame (this)
+ if (sesame.status < 0)
+ error (0, "Cannot resolve object `"//this//"'")
+ ra = sesame.ra
+ dec = sesame.dec
+ size = sr
+ }
+
+ # Initialize
+ zresp = ""
+ eresp = ""
+
+ # Now do a Registry query for the given service type and bandpass.
+ regResults = mktemp ("tmp$reg")
+ if (stype == "all") {
+ s1 = mktemp ("tmp$reg")
+ print (stype) | translit ("STDIN",",","\n",del-, > s1)
+ list = s1
+ i = 1
+
+ # Convert the list of specific services to a table we use below to
+ # query each.
+ while (fscan (list, s2) != EOF) {
+ printf ("%4d %s\n", i,
+ regResolver (s2,"","ShortName,ServiceType,Identifier"),
+ >> regResults)
+ i = i + 1
+ }
+ delete (s1, verify-)
+
+ } else {
+ registry ("", svc=stype, bandpass=bpass, verb-, header-,
+ >& regResults)
+ }
+
+
+ if (verbose) {
+ count (regResults) | scan (i)
+ printf ("#\n")
+ printf ("# Search Terms: RA=%H Dec=%h SR=%.3f\n", ra, dec, size)
+ printf ("# Service Type: %s\n", stype)
+ printf ("# Total Querys: %d\n", i)
+ printf ("#\n#\n")
+ printf ("#Num ShortName Count IVO Identifier\n")
+ printf ("#--- --------- ----- --------------\n")
+ }
+
+ # Loop over the registry and query by service type.
+ list = regResults
+ lnum = 1
+ while (fscan (list, index, sname, svctyp, ivorn) != EOF) {
+
+ count = 0
+ if (substr (svctyp,1,4) == "CONE")
+ count = dalRecordCount (\
+ dalConeSvc(\
+ regResolver(ivorn,"cone"), ra, dec, size))
+ else if (substr (svctyp,1,4) == "SIAP")
+ count = dalRecordCount (\
+ dalSiapSvc(\
+ regResolver(ivorn,"siap"), ra, dec, size, size))
+
+ if (count == 0)
+ zresp = zresp // sname // ","
+ if (!filter) {
+ printf ("%4d %-14.14s ", lnum, sname)
+ if (count < 0) {
+ printf (" ERROR %s\n", ivorn)
+ eresp = eresp // sname // ","
+ } else
+ printf ("%6d %s\n", count, ivorn)
+ lnum = lnum + 1
+ } else if (filter && count > 0) {
+ printf ("%4d %-14.14s %6d %s\n", lnum,sname,count,ivorn)
+ lnum = lnum + 1
+ } else if (count < 0)
+ eresp = eresp // sname // ","
+ }
+
+ if (verbose) {
+ printf ("#\n")
+ printf ("# Zero Values: ") ; prettystr(zresp,start=15,comment+)
+ printf ("# Err Returns: ") ; prettystr(eresp,start=15,comment+)
+ }
+
+ # Clean up.
+ delete (regResults, verify-)
+end
diff --git a/vo/src/OLD/fchart.cl b/vo/src/OLD/fchart.cl
new file mode 100644
index 00000000..d438c5db
--- /dev/null
+++ b/vo/src/OLD/fchart.cl
@@ -0,0 +1,136 @@
+# CHART -- Toy finder chart program using an object name, a user-supplied
+# image, or a position spec to display a point on the sky and an overlay
+# of known NED objects.
+
+procedure chart (object)
+
+string object { prompt = "Object to plot" }
+string image = "" { prompt = "Image name" }
+real ra = INDEF { prompt = "RA of position" }
+real dec = INDEF { prompt = "Dec of position" }
+string inwcs = "icrs" { prompt = "Input coord system" }
+real size = 0.2 { prompt = "Size (degrees)" }
+string fields = "G_Lens,Xray,Radio,QSO" { prompt = "Objects to mark" }
+bool grid = yes { prompt = "Overlay coordinate grid?" }
+
+begin
+ real lra, ldec, lsz
+ int count, siap, col
+ string imname, pos, fstr, obj, img, isys
+ bool do_grid
+
+ reset stdimage = imt1024 # Set the environment
+ reset imclobber = yes
+ reset clobber = yes
+
+ obj = object # get a local variable of the param value
+ lsz = size
+ fstr = fields
+ lra = ra
+ ldec = dec
+ img = image
+ isys = inwcs
+ do_grid = grid
+
+ # Get the starting position. Use an image if specified, the check
+ # for an ra/dec pos, and finally a user-supplied object name.
+ if (imaccess (img, verbose=no)) {
+ iferr { wcsinfo (img) } then {
+ error (0, "Cannot determine image coords for `"//img//"'")
+ } else {
+ lra = wcsinfo.midx
+ ldec = wcsinfo.midy
+ lsz = max (wcsinfo.width, wcsinfo.height) / 60.0
+ }
+ imname = img
+
+ } else if (ra != INDEF && dec != INDEF) {
+ # No image specified, use the parameters (assume it's in hours).
+ lra = ra * 15.
+ ldec = dec
+ lsz = size # size in degrees
+ imname = mktemp ("chart") // ".fits" # create temp filenames
+
+ } else {
+ # Sample Test Objects:
+ # abell2235 # has QSOs
+ # abell1689 # has G_Lens
+ # abell2255 # has lotsa Galaxies
+
+ # Resolve the Abell number to coordinates.
+ sesame (obj)
+ lra = sesame.ra
+ ldec = sesame.dec
+ lsz = size
+ imname = mktemp ("chart") // ".fits" # create temp filenames
+ }
+
+ # Convert alternate input coordinate system values.
+ if (isys != "icrs") {
+ print (lra // " " // ldec) | \
+ skyctran ("STDIN", "STDOUT", isys, "icrs", transform+,
+ olngu="deg", olatu="deg", olngf="%f", olatf="%f") | \
+ fields ("STDIN","1,2",lines="9") | scan (x, y)
+ if (verb) {
+ print ("#")
+ print ("# Input coords: ("//lra//","//ldec//") ("//isys//")")
+ print ("# Output coords: ("//x//","//y//") (ICRS)")
+ print ("#")
+ }
+ lra = x
+ ldec = y
+ }
+ pos = mktemp ("chart")
+
+
+ # Get an image of the field if the user didn't supply one.
+ if (obj != "" || (ra != INDEF && dec != INDEF)) {
+
+ dss ("", ra=ra, dec=dec)
+ imname = dss.imname
+ }
+
+ # Display the image. We're using DSS so we need to specify an image
+ # extension, other SIAP services
+ display (imname, 1, fill+, >& "dev$null")
+
+ # Get NED sources
+ #vocatalog (regResolver("NED","cone"), lra, ldec, lsz, output="ned.txt")
+ s1 = "http://nedwww.ipac.caltech.edu/cgi-bin/nph-NEDobjsearch?search_type=Near+Position+Search&of=xml_main&"
+ vocatalog (s1, lra, ldec, lsz, output="ned.txt")
+
+ # Select the RA,Dec from the output NED table.
+ fields ("ned.txt","3,4", >& "pos_all")
+
+ # Expand the list of object types we want to mark.
+ print (fstr) | translit ("STDIN",",","\n",del-, > "fields")
+
+ # Mark the Galaxies on the display.
+ match (" G ","ned.txt") | fields("STDIN","3,4", >& "pos_all")
+ wcsctran ("pos_all", "c1", imname, verb-,
+ inwcs="world",outwcs="logical",units="n n")
+ tvmark (frame=1,coords="c1",mark="plus", color=206, txsize=3)
+
+ # Mark the rest of the requested objects on the display.
+ list = "fields"
+ while (fscan (list, s1) != EOF) {
+ match (s1,"ned.txt") | fields("STDIN","3,4,5", >& "pos_w")
+ wcsctran ("pos_w","pos_l", imname, "world","logical",
+ verb-, units="n n") | \
+ tvmark (frame=1, coords="pos_l",mark="plus",color=204,txsize=3,lab+)
+ }
+
+ if (do_grid)
+ wcslab (imname, 1, use-, fill+, overplot+, append+,
+ labout-, dev="imdy")
+
+ # Clean up.
+ if (access (pos)) delete (pos, verify-, >& "dev$null")
+ if (access (imname)) delete (imname, verify-, >& "dev$null")
+
+ # Update params.
+ object = ""
+ image = ""
+ ra = INDEF
+ dec = INDEF
+end
diff --git a/vo/src/OLD/sloanspec.cl b/vo/src/OLD/sloanspec.cl
new file mode 100644
index 00000000..c6f24aed
--- /dev/null
+++ b/vo/src/OLD/sloanspec.cl
@@ -0,0 +1,413 @@
+#{ SLOANSPEC -- Query the SDSS Spectral Data (DR4) given an image footprint,
+# object name, or equatorial position and search size.
+
+procedure sloanspec (what)
+
+string what { prompt = "Image or Object name" }
+
+real ra = INDEF { prompt = "RA of Field (hours)" }
+real dec = INDEF { prompt = "Dec of Field (degrees)" }
+real sr = 0.25 { prompt = "Search size (degrees)" }
+
+int maxrecords = 100 { prompt = "Max records to return" }
+bool display = no { prompt = "Display result?" }
+bool interactive = yes { prompt = "Interactive mode?" }
+bool autosave = yes { prompt = "Auto-save downloaded data?" }
+bool verbose = yes { prompt = "Verbose output?" }
+bool ned = no { prompt = "Overlay NED objects?" }
+bool grid = no { prompt = "Overlay coord grid?" }
+bool download = no { prompt = "Automatically download data?" }
+
+string spectype = "all" { prompt = "Spectra type (qso|galaxy|all)",
+ enum="qso|galaxy|all" }
+real zlow = INDEF { prompt = "Low redshift filter" }
+real zhigh = INDEF { prompt = "High redshift filter" }
+
+real size = 15.0 { prompt = "Size of marker (pixels)" }
+int color = 207 { prompt = "Marker color" }
+int status = 0 { prompt = "Service status code" }
+
+string *llist
+
+begin
+ string this, img, obj, stab, ttab, mtab, coords, tvcoords, filter
+ string name, class, oclass, ch, cmd, tnames, imlist, sv_img, stype
+ bool verb, disp, do_grid, interact, saving, do_ned, found, getdata
+ int maxrec, mkcolor, n, wcs, siap, count
+ real szmark, d0, d1, xp, yp, z, x1, x2, y1, y2
+ real lra, ldec, lsr, sra, sdec, sz, sx, sy
+ real llx, lly, urx, ury, cx, cy, bsz, z1, z2
+ string sname, sid, sclass, mission
+
+
+ lra = ra
+ ldec = dec
+ this = ""
+ if (isindef(lra) && isindef(ldec))
+ this = what
+
+ lsr = sr
+ disp = display
+ maxrec = maxrecords
+ szmark = size
+ mkcolor = color
+ verb = verbose
+ interact = interactive
+ do_grid = grid
+ do_ned = ned
+ saving = autosave
+ stype = spectype
+ z1 = zlow
+ z2 = zhigh
+ getdata = download
+ sv_img = ""
+
+ # Set the environment.
+ set clobber = yes
+ set imclobber = yes
+
+
+ if (imaccess (this)) {
+ img = this
+ obj = ""
+ iferr { wcsinfo (this) } then {
+ error (0, "Cannot determine image coords for `"//this//"'")
+ } else {
+ ra = wcsinfo.midx
+ dec = wcsinfo.midy
+ size = max (wcsinfo.width, wcsinfo.height) / 60.0
+ }
+
+ } else {
+ # Assume it's an object name, resolve to coords.
+ sesame (this)
+ if (sesame.status < 0)
+ error (0, "Cannot resolve object `" // this // "'")
+ lra = sesame.ra
+ ldec = sesame.dec
+ lsr = sr
+ img = ""
+ obj = this
+ }
+
+ filter = ""
+ if (stype == "qso") {
+ filter = "Qso"
+ } else if (stype == "galaxy") {
+ filter = "Galaxy"
+ }
+ ;
+
+ # Create temp files.
+ stab = mktemp ("tmp$stab")
+ ttab = mktemp ("tmp$ttab")
+
+ # Display an image early on so we have something to look at.
+ if (display) {
+ if (img == "" || imaccess(img) == no) {
+ # Display an image from the DSS.
+ img = mktemp ("tmp$sspec") // ".fits"
+ sv_img = img
+
+ # Get an image of the field if the user didn't supply one.
+ siap = dalSiapSvc(regResolver("ivo://nasa.heasarc/skyview/dss1","siap"), lra,ldec,lsr,lsr)
+
+ count = dalRecordCount(siap)
+ if (count <= 0)
+ error (0, "No optical images found")
+ s1 = dalGetData(siap, 0, osfn(img))
+
+ display (img//"[0]", 1, fill+, bpmask="", >& "dev$null")
+ img = ""
+ } else {
+ display (img, 1, fill+, bpmask="", >& "dev$null")
+ }
+ }
+
+
+ # Query for the spectra.
+ if (verb) {
+ printf ("#\n")
+ if (img != "")
+ printf ("# Search Params: Img='%s' RA=%.5f Dec=%.5f SR=%.2f\n",
+ img, lra, ldec, lsr)
+ else if (obj != "")
+ printf ("# Search Params: Obj='%s' RA=%.5f Dec=%.5f SR=%.2f\n",
+ obj, lra, ldec, lsr)
+ else
+ printf ("# Search Position: RA=%.5f Dec=%.5f SR=%.2f\n",
+ lra, ldec, lsr)
+ print ("#\n")
+ }
+ ssquery (image=img, object=obj, ra=lra, dec=ldec, sr=(lsr * 60.0),
+ zlow=z1, zhigh=z2, output="STDOUT", maxrec=maxrec, verb-) | \
+ match (filter, "STDIN", >& stab)
+
+ status = ssquery.status
+ if (ssquery.status < 0) {
+ error (0, "No results found.")
+
+ } else if (img != "") {
+ wcsinfo (img)
+ lra = wcsinfo.midx # decimal degrees
+ ldec = wcsinfo.midy
+
+ } else if (obj != "") {
+ sesame (obj)
+ lra = sesame.ra # decimal degrees
+ ldec = sesame.dec
+ }
+ #printf("img='%s' obj='%s' ra=%.4f dec=%.4f sr=%.2f\n",img,obj,lra,ldec,lsr)
+
+
+
+ # See whether we display the image or simply download a cutout of the
+ # field we want.
+ if (display) {
+ coords = mktemp ("tmp$coords")
+ tvcoords = mktemp ("tmp$coords")
+
+ if (img == "" || imaccess(img) == no) {
+# # Display an image from the DSS.
+# img = mktemp ("tmp$sspec") // ".fits"
+ img = sv_img
+#
+# # Get an image of the field if the user didn't supply one.
+# siap = dalSiapSvc(regResolver("DSS2R","siap"), lra,ldec,lsr,lsr)
+#
+# count = dalRecordCount(siap)
+# if (count <= 0)
+# error (0, "No optical images found")
+# s1 = dalGetData(siap, 0, osfn(img))
+#
+# display (img//"[0]", 1, fill+, bpmask="", >& "dev$null")
+ fields (stab, "2,3", >& coords)
+ wcsctran (coords, tvcoords, img//"[0]", "world", "logical",
+ units="h n", columns="1 2", verb-)
+
+ wcsinfo (img//"[0]")
+
+ sv_img = img
+ img = img // "[0]"
+
+ if (!interact && imaccess(sv_img//".fits"))
+ delete (sv_img//".fits", verify-, >& "dev$null")
+
+ } else {
+ # Display the image.
+# display (img, 1, fill+, bpmask="", >& "dev$null")
+ fields (stab, "2,3", >& coords)
+ wcsctran (coords, tvcoords, img, "world", "logical",
+ units="h n", verb-)
+ sv_img = img
+ wcsinfo (img)
+ }
+
+ if (verb) {
+ printf ("#\n")
+ if (img != "")
+ printf ("# Image: %s\n", img)
+ else if (obj != "")
+ printf ("# Object %s\n", obj)
+
+ if (img == "" && obj == "")
+ printf ( "# Search Pos: (%H,%h) Size: %.2fx%.2f arcmin\n",
+ ra, dec, lsr, lsr)
+ else
+ printf ( "# Search Pos: (%H,%h) Size: %.2fx%.2f arcmin\n",
+ wcsinfo.midx, wcsinfo.midy, wcsinfo.width, wcsinfo.height)
+ printf ("#\n")
+ fields (stab, "1-5")
+ }
+
+ # Create local catalog of spectra.
+ joinlines (tvcoords//","//stab) | match ("-", "STDIN", stop+, >& ttab)
+
+ if (access(coords)) delete (coords, verify-, >& "dev$null")
+ if (access(tvcoords)) delete (tvcoords, verify-, >& "dev$null")
+
+
+ mtab = mktemp ("tmp$mtab")
+ fields (ttab, "1,2,3", >& mtab)
+type (mtab)
+ tvmark (1, mtab, mark="circle", radii=szmark, col=mkcolor,
+ lab+, txsize=1)
+
+ if (access(mtab)) delete (mtab, verify-, >& "dev$null")
+
+ # Overlay the NED objects?
+ if (do_ned)
+ nedoverlay (img)
+
+ # Draw the coordinate overlay grid?
+ if (do_grid)
+ wcslab (img, 1, use-, fill+, overplot+, append+,
+ labout-, dev="imdy")
+
+ if (interact) {
+ # When verbose we printed the table above, otherwise we want some
+ # kind of summary visible here.
+ if (!verbose)
+ type (ttab)
+
+ print ("\n\nIMSSPEC Command Summary:")
+ print ("b Batch display w/in a box")
+ print ("d Download spectrum")
+ print ("i Print Info about spectrum")
+ print ("n NED Overlay")
+ print ("r Radio contour overlay")
+ print ("s Show spectrum")
+ print ("w WCS Overlay")
+ print ("q Quit")
+ printf ("\nCommand? ")
+
+ while (fscan (imcur, x, y, wcs, cmd) != EOF) {
+ # Find nearest point. All other commands will depend on the
+ # chosen spectrum.
+ d0 = 999999999.0
+ d1 = 0.0
+ found = no
+ llist = ttab
+ while (fscan(llist, xp,yp, name,ra,dec,z,class,line) != EOF) {
+ d1 = sqrt ((xp-x)*(xp-x) + (yp-y)*(yp-y))
+ if (d1 < d0) {
+ d0 = d1
+ sx = xp ; sy = yp
+ sra = lra ; sdec = ldec
+ sz = z
+ sname = name
+ sclass = class
+ found = yes
+ }
+ }
+ llist = ""
+ if (!found)
+ print ("Error: object not found")
+
+ print ("")
+ switch (cmd) {
+ case "i": # Show info on spectrum
+ { printf ("%s %H %h %.5f %s\n",
+ sname, (sra*15.), sdec, sz, sclass)
+ }
+
+ case "b": # Get spectrum in the box
+ { printf ("Again...")
+ x1 = x
+ y1 = y
+ n = fscan (imcur, x2, y2, wcs, ch)
+ tnames = mktemp ("tmp$tname")
+ imlist = mktemp ("tmp$imlist")
+ tabclip (ttab, "STDOUT", "c1","c2", x1,y1, x2,y2) | \
+ fields ("STDIN", "1,2,3,9", >& tnames)
+
+ # Draw a box around the selected region
+ printf ("%f %f 101 b\n%f %f 101 b\n", x1,y1,x2,y2) | \
+ tvmark (1, "", commands="STDIN", lab-, col=200)
+
+ print ("\nDownloading images ....")
+ llist = tnames
+ while (fscan (llist, x, y, sname, sid) != EOF) {
+ name = substr (sname, 1, 10) // ".fits"
+ print (name, >>& imlist)
+ printf ("%f %f %s\n", x, y, sname) | \
+ tvmark (1, "STDIN", mark="circle",
+ radii=szmark, col=205, lab+, txsize=1)
+ if (imaccess(name) == no)
+ ssget (sid, name, verbose+)
+ else
+ printf ("Image '%s' exists already...\n", name)
+ }
+ llist = ""
+
+ printf ("Running SPECLOT ....")
+ specplot ("@"//imlist, label="imname",cursor="dev$null")
+
+ if (!saving)
+ imdelete ("@"//imlist, >& "dev$null")
+ delete (imlist, verify-, >& "dev$null")
+ delete (tnames, verify-, >& "dev$null")
+ gflush
+
+ }
+ case "d": # Get spectrum
+ {
+ match (sname, stab) | scan (line)
+ print (line) | fields ("STDIN","1,7") | scan(sname,sid)
+ name = substr (sname, 1, 10) // ".fits"
+ printf ("%f %f %s\n", sx, sy, sname) | \
+ tvmark (1, "STDIN", mark="circle", radii=szmark,
+ col=205, lab+, txsize=1)
+ if (imaccess(name) == no)
+ ssget (sid, name, verbose+)
+ }
+ case "o": # Observation Overlay
+ { while (yes) {
+ printf ("Mission (HST|XMM|Spitzer|Chandra|Rosat)? "
+ i = scan (mission)
+ if (i > 0)
+ break
+ }
+ obslogoverlay (img, mission)
+ }
+ case "r": # NVSS Radio contour overlay
+ { radiooverlay (img)
+ }
+ case "n": # NED Overlay
+ { nedoverlay (img)
+ }
+ case "w": # WCS Overlay
+ { wcslab (img, 1, use-, fill+, overplot+, append+,
+ labout-, dev="imdy")
+ }
+ case "s": # SPLOT spectrum
+ {
+ match (sname, stab) | scan (line)
+ print (line) | fields ("STDIN","1,7") | scan(sname,sid)
+ name = substr (sname, 1, 10) // ".fits"
+ printf ("%f %f %s\n", sx, sy, sname) | \
+ tvmark (1, "STDIN", mark="circle", radii=szmark,
+ col=205, lab+, txsize=1)
+ if (imaccess(name) == no)
+ ssget (sid, name, verbose+)
+
+ if (imaccess(name) == yes) {
+ printf ("Running SPLOT on image '%s'....", name)
+ splot (name)
+ } else
+ printf ("Error loading image '%s'\n", name)
+
+ if (!saving)
+ imdelete (name, >& "dev$null")
+ gflush
+ }
+ case "q": # Quit
+ { break
+ }
+ }
+
+ printf ("\nCommand? ")
+ }
+ }
+
+ } else {
+ type (stab)
+
+ if (getdata) {
+ spectab (stab, imroot="", verbose+)
+ }
+ }
+
+
+ # Clean up
+ if (access(stab)) delete (stab, verify-, >& "dev$null")
+ if (access(ttab)) delete (ttab, verify-, >& "dev$null")
+
+ ra = INDEF # reset params
+ dec = INDEF
+
+ if (interact && imaccess(sv_img//".fits"))
+ delete (sv_img//".fits", verify-, >& "dev$null")
+end
+
+
diff --git a/vo/src/OLD/vizier.cl b/vo/src/OLD/vizier.cl
new file mode 100644
index 00000000..bf9209ba
--- /dev/null
+++ b/vo/src/OLD/vizier.cl
@@ -0,0 +1,65 @@
+#{ VIZIER -- Call a service Vizier TABULARSKY service.
+
+procedure vizier (tab_id)
+
+string tab_id { prompt = "Table reference" }
+
+string output = "STDOUT" { prompt = "Output filename" }
+string otype = "ascii" { prompt = "Output format",
+ min="ascii|csv|votable|fits" }
+bool all = yes { prompt = "Get all matching tables?" }
+bool verbose = no { prompt = "Verbose output?" }
+
+int status = 0 { prompt = "Service status code" }
+
+begin
+ string id, url, oname, tname, ctype, oroot
+ string sfile, fields, catid, svc_type
+ bool verb, do_all
+ int fnum, nrecords
+
+
+ id = tab_id
+ ctype = otype
+ oroot = output
+ do_all = all
+ verb = verbose
+
+ svc_type = "tabularskyservice"
+ fields = "ServiceURL,Identifier"
+ fnum = 1
+
+
+ # Create a temporary url file and output name.
+ sfile = mktemp ("tmp$vizier")
+ tname = mktemp ("tmp$vizier") // ".xml"
+
+ if (do_all)
+ print (regResolver (id, svc_type, fields, -1), > sfile)
+ else
+ print (regResolver (id, svc_type, fields), > sfile)
+
+ nrecords = nresolved()
+
+ list = sfile
+ while (fscan (list, url, catid) != EOF) {
+
+ if (nrecords > 1)
+ oname = oroot // "." // fnum
+ else
+ oname = oroot
+
+ if (verb)
+ printf ("Downloading %s ... to %s\n", catid, oname)
+
+ # Call the Vizier service url
+ rawcaller (url, otype="votable", output=tname)
+
+ # Output the table.
+ tabout (tname, oname, ctype)
+
+ delete (tname, verify-)
+ fnum = fnum + 1
+ }
+
+end