INAF logo
TOCats − HiPS catalogues browser, V. 1.4 − Developed using DIF
Project
Cat
Base image layer quick selection

Objects density map
External links
Toggle columns
[ Togglebale columns here ]
RA DEC Mag Nobjs HPXid Separation
Click to copy URL to clipboard

Direct access to these TOCats data

VO Cone Search link (e.g. in TOPCAT use URL ...):

Copy URL to clipboard
Note: radius in degrees; add &tab_fldnames to get the original table field names
Add &json to get a JSON structure or &tsv to get a Tab delimited table or &csv to get a comma delimited table.
Alternatively, to get the JSON structure of the shown table:

Query: ...used query here...

TOCats programmatic access reference
You can access TOCats from any application using our HTTP services. Data are returned in VOTable format unless the &json or &tsv or &csv selector is present in the URL.
  • Get the full list (parent and HiPS) of available catalogues, with number of objects:

    https://cats.oas.inaf.it/list (or catslist | catalogues | catalogs)

  • Get the list of available base (parent) catalogues, with number of objects:

    https://cats.oas.inaf.it/basecats

  • Get the number of objects in a catalogue:

    https://cats.oas.inaf.it/catalogue_name/?n_objects (or n_objs)

  • Get the number of objects in a circular region (coordinates in any notation, radius in degrees):

    https://cats.oas.inaf.it/catalogue_name/region_coords_and_size?n_objects

  • Get the objects in a circular region (coordinates in any notation, radius in degrees):

    https://cats.oas.inaf.it/catalogue_name/radius=X&ra=Y&dec=Z


    Note: add &tab_fldnames if you want to avoid conversion of the table field names to standard names.

Examples

Query using cURL

Note: you can also use wget, but curl is preferable.
curl -o mycat.vot 'https://cats.oas.inaf.it/gaiadr2e/radius=0.1&ra=253.816&dec=-42.192&limit=100'

curl -H "Accept: application/json" -H "Content-Type: application/json" \
     -o mycat.json \
     -X GET "https://cats.oas.inaf.it/gaiaedr3/radius=0.1&ra=253.816&dec=-42.192&limit=100&json"
or (better for use in a script - note the use of the -d option!)
curl -G https://cats.oas.inaf.it/gaiadr2e/ \
  -o mycat.vot \
  -d radius=0.1 -d ra=253.816 -d dec=-42.192 -d limit=100

A simple Python script

#!/usr/bin/env python
# Python 2 using "urllib"
#
import urllib, json
url = "https://cats.oas.inaf.it/gaiadr2e/radius=0.1&ra=253.816&dec=-42.192&limit=100&json"
response = urllib.urlopen(url)
output = json.loads(response.read())
print output
#!/usr/bin/env python
# Python 3 using "urllib"
#
from urllib.request import urlopen
url = "https://cats.oas.inaf.it/gaiadr2e/radius=0.1&ra=253.816&dec=-42.192&limit=100&json"
response = urlopen(url)
print(response.read())
#!/usr/bin/env python
# Python 3 using "requests"
#
import requests
url = "https://cats.oas.inaf.it/gaiadr2e/radius=0.1&ra=253.816&dec=-42.192&limit=100&json"
response = requests.get(url)
print(response.json())

A simple Julia script

using HTTP
r = HTTP.get("https://cats.oas.inaf.it/gaiadr2e/radius=0.1&ra=253.816&dec=-42.192&limit=100&json")
println(String(r.body))

A simple PHP script

1. Simplest (requesting json)
echo file_get_contents("https://cats.oas.inaf.it/gaiadr2e/radius=0.1&ra=253.816&dec=-42.192&limit=100&json");
2. Same request but using cURL functions
#!/usr/bin/env php
<?php
$ch = curl_init();
curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true );
curl_setopt( $ch, CURLOPT_URL,
    'https://cats.oas.inaf.it/gaiadr2e/radius=0.1&ra=253.816&dec=-42.192&limit=100&json'
);
$json = curl_exec( $ch );
echo $json;
curl_close( $ch );
?>
3. cURL programmatic, returning VOTable (default)
#!/usr/bin/env php
<?php
$url = 'https://cats.oas.inaf.it';
$cat = 'gaiadr2e';

$qry = http_build_query(array(
   'radius' => '0.1',
   'ra'     => '253.816',
   'dec'    => '-42.192',
   'limit'  => '100'
));

$ch = curl_init();
curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true );
curl_setopt( $ch, CURLOPT_URL, "$url/$cat/$qry" );
$json = curl_exec( $ch );
echo $json;
curl_close( $ch );
?>
L. Nicastro 2017 - 2021