Herschel Footprint Tools

documentation

command-line examples

We suggest using curl to access the Herschel Footprint Database REST API.

  • Find observations by coordinates (J2000 decimal)
curl -H "Accept:text/plain" "http://herschel.vo.elte.hu/Api/Observations?findby=eq&ra=207.25&dec=-28.4"
  • See footprint description of observation
curl -H "Accept:text/plain" "http://herschel.vo.elte.hu/Api/Observations/1342182235/Footprint"

region examples

Circle with a radius of 20 arcminutes centered on J2000 coordinates

CIRCLE J2000 207.25 -28.4 20

Rectangle with two corners specified in J2000 coordinates

RECT J2000 207.0 -28.3 207.1 -28.4

Polygon with J2000 coordinates (please avoid bowtie and don't repeat first point as last)

POLY J2000 0 10 10 10 10 0

Convex hull of a list of J2000 coordinates (please avoid points spreading more than half of the sphere)

CHULL J2000 0 10 10 10 10 0

python examples

Find and plot footprints

import matplotlib.pyplot as plt
import numpy as np
import urllib.parse
import urllib.request
import json

baseURL = "http://herschel.vo.elte.hu/Api/"

def openURL(url, values, headers):
    if values == None:
        url = baseURL + url
    else:
        params = urllib.parse.urlencode(values)
        url = baseURL + url + '?' + params
    req = urllib.request.Request(url, headers=headers)
    with urllib.request.urlopen(req) as response:
        data = response.read()
        data = data.decode("ascii")
        return data
    
def openTable(url, params):
    data = openURL(url, params, {'Accept': 'text/plain'})
    return np.loadtxt(data.splitlines())

def openJSON(url, params):
    data = openURL(url, params, {'Accept': 'application/json'})
    return json.loads(data)

def findObsIntersect(inst, region):
    url = "Observations"
    params = { "findby": "intersect", "inst": inst, 
               "region": region }
    return openJSON(url, params)

def getOutlinePoints(inst, obsID, res):
    url = "Observations/" + inst + "/" + str(obsID) + 
    	  "/Footprint/Outline/Points"
    params = { "res": res }
    return openTable(url, params)
    
obs = findObsIntersect("PACS", "CIRCLE J2000 207.25 -28.4 20")
for o in obs:
    points = getOutlinePoints(o["inst"], o["obsID"], 0.2)
    plt.plot(points[:,1], points[:,2], '-')

database schema

Database schema