INAF logo
TOCats − HiPS catalogues browser, V. 2.0 − Developed using DIF and Aladin Lite v3
Project
DB Table:
Upload
Drag & drop your MOS file here...   or
no file
or input GraceDB URL
Drag & drop your MOC file here...   or
no file
Drag & drop your REG file here...   or
no file
Drag & drop your CSV file here...   or
File format: RA, Dec [,reg. radius][,...]

Loading...

Base image layer quick selection





ROSAT eRASS1
Objects density map
External Tools
Ref. Cat.
Options


Toggle columns
[ Togglebale columns here ]
RA Dec Mag Nobjs HPXid Id Sep
Click to copy URL to clipboard

Direct access to catalogue

Please refer to the section below for details about direct access to TOCats!
Cone Search: open
Click to copy URL to clipboard
Note: radius in degrees; add &tab_fldnames to get the original table field names
Example of TOCats access from TOPCAT and STILTS. You can use any VO-enabled tool to access TOCats:
TOPCAT tip: VO → Cone search → Cone URL: ... RA: ... Dec: ... Radius: ...
STILTS tip: stilts cone serviceurl=...
To get the JSON structure of the shown summary table above:

Show/hide the database query used
...used query here...

TOCats programmatic access reference
In addition to the web interface, TOCats can be queried 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 list of available base (parent) catalogues, with number of objects:

    https://cats.oas.inaf.it/list (or catslist | catalogues | catalogs | 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/gaiadr3/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/gaiadr3/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/gaiadr3/ \
  -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/gaiadr3/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/gaiadr3/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/gaiadr3/radius=0.1&ra=253.816&dec=-42.192&limit=100&json"
response = requests.get(url)
print(response.json())

A simple Julia script

# Eventually first run `import Pkg; Pkg.add("HTTP")`
using HTTP
r = HTTP.get("https://cats.oas.inaf.it/gaiadr3/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/gaiadr3/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/gaiadr3/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 = 'gaiadr3';

$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 - 2023