Example: SIAP, the VO’s protocol to access image servers.
Query a VO service for a list of images covering a small field on the sky, and download one of these images:
svc = pyvo.sia.SIAService(ACCESS_URL) images = svc.search((11,35), (0.1, 0.1), verbosity=2) image=iamges[0] image.cachedataset()
For SIAP, pos (as a tuple of ra and dec) and size (in degrees, either one radius or extent in ra and dec) are mandatory. More parameters: in the pyvo docs.
Note how you don’t actually have to know anything about the service except its access URL. Since PyVO uses a standard protocol, it knows enough to be able to, in this case, retrieve the file and (mostly) give it a reasonable name.
This is a very basic example though. PyVO provides you with more functionality that helps analysing the results before selecting the images. We will see some of these functions by using PyVO in an interpreter (e.g. ipython).
(1)
Get the full program from the attachment trivialsiap.py and inspect it to see how things work.
Find some other image service – use WIRR to access the VO Registry for now – and see if they have some images for the positions given (or positions you’re actually interested in).
What’s coming back from SIAService’s search is a sequence of SIARecords. Have a quick look a its pyvo documentation and make your program print the file size, too. If you find some frames of reasonable size, download them into your favourite FITS viewer.