7. This is Python

The advantage of doing this in Python is that it’s easy to add your own logic. Here’s how to add time constraints (SIAP version 1 unfortunately doesn’t specify how to tell the service you’re only interested in a specific time interval – we’ll later see how more modern standards let you push time constraints to the server) and search multiple positions:

  svc = pyvo.sia.SIAService(ACCESS_URL)
  for pos in [
      (10, 20),
      (45, 85)]:
    images = svc.search(pos, (0.5, 0.5), verbosity=2)
    for row in images:
      if not DATE_MIN<row.dateobs<DATE_MAX:
        continue
      row.cachedataset()

[See multisiap.py]

Also: row.cachdataset saves the image to your local disk under a name sensible for the metadata.

Files


Markus Demleitner, Hendrik Heinl