Skybot 3D
.: getAster :.
Purpose
This method is intended to people who want to retrieve the state vectors of asteroids at a reference epoch.
The state vectors are those computed and stored in
SkyBoT database. No
ephemeris computation is performed. The data are just extracted from the database.
HTTP Request
The Skybot3D getAster service can be accessed using the
Skybot3D query forms (TBD).
If you are a software/solutions developer, you might want to include the Skybot3D getAster service into
your application. This can be done by using the
web service method or by using the following HTTP request:
- http://vo.imcce.fr/webservices/skybot3d/getAster_query.php?[parameters]
Parameter | Definition | Limits |
-ep=<string> |
Epoch requested, expressed in Julian day or formatted as any English textual datetime (default to now). |
2411320.0 .. 2473530.0 1889-11-13 12h .. 2060-03-21 12h |
-mime=<string> |
Mime type of the results (default to VOTable) (1) |
votable | html | text | json |
-class=<string> |
Allow to retrieve only the asteroids of the given population classes.
Leave empty to get all bodies. Use a comma separated list of classes to get the asteroids of the given population classes.
Use the MySQL wildcard % to match any number of characters, e.g. 'NEA%' requests
all Near Earth asteroids. |
Ex.: NEA>Apollo,Trojan,KBO>% |
-limit=<integer> |
Maximum number of asteroids to retrieve (default to all) |
Put 0 to retrieve all the known asteroids |
-coord=<string> |
Type of coordinates: rectangular for (x,y,z) coordinates, spherical for RA and DEC |
rectangular (default) | spherical |
-getFile=<0|1> |
Active only with mime types VOTable and text.
If set to 0 then the answer is an object which contains the URL to download the data.
If set to 1 then the answer provides directly the data (uncompressed).
Be aware that the amount of data to receive can be large (tens of Megabytes).
|
0 (default) | 1
|
-from=<string> |
Word which definite the name of the caller application, or which describes the request |
any short string (without space) |
All input parameters are optional and can be omitted. In that case, the query requests the rectangular ephemerides
of all known asteroids at the current epoch (now). The output is described in the following table
and is available in VOTable, HTML, JSon or plain text format
(cf. examples).
Web service
The Skybot3D Web service provides methods based on
SOAP and
HTTP POST verb which allow
one to interact between its own application and the Skybot3D service. Here is the useful information to
invoke the getAster method:
- Web Service URI:
- http://vo.imcce.fr/webservices/skybot3d/skybot3d.php
- Namespace:
- http://vo.imcce.fr/webservices/skybot3d
- WSDL:
- http://vo.imcce.fr/webservices/skybot3d/skybot3d.php?wsdl
- SOAP header:
- name of the SOAP header element: 'clientID'
- SOAP header's content: array('from' => 'YourName', 'hostip'=>'')
- Method:
- getAster (inputArray)
The input parameters of the method is an array
which must contained the following parameters:
Variable | Type | Units | Limits or values | Default | Comment |
epoch |
string |
- |
2411320.0 .. 2473540.0 (1889-11-13 12h .. 2060-03-21 12h) |
none |
Requested epoch, expressed in Julian day, ISO format or formatted as any English textual datetime |
class |
string |
- |
Comma separated list of SkyBoT population classes |
empty |
Requested population classes as known by SkyBoT. |
limit |
integer |
- |
≥ 0 |
0 |
Maximum number of asteroids to retrieve |
coord |
string |
- |
rectangular | spherical |
rectangular |
Requested type of coordinates of the targets: x,y,z or RA,DEC |
mime |
string |
- |
votable | html | text | json |
votable |
Mime type of the results |
The output of the method does not directly provide the
ephemerides of asteroids, except for the JSON format. Instead it provides an object which contains the information
needed to access the data:
- 'flag'
- the status of the response: flag=1 means ok; flag=0 means that no body has been found; flag=-1 means that an error occured
- 'ticket'
- the Unix timestamp of the answer which can be useful to stamp the request
- 'nbast'
- the number of asteroids contained in the result file
- 'refdate'
- the epoch of the ephemeris, in julian day
- 'filename'
- the URL of a Bzipped file which contains the result (extension .bz2)
- 'filesize'
- the size of the result file, in bytes
To get the result file, use a network downloader, such as wget or curl, or download the file by using
your preferred Web browser. You will need to (b)unzip the file to read it with any text editor (except for the JSON format)
Depending on the selected mime type, the output is formatted as:
- votable
- the data are written in the IVOA standard VOTable format
- html
- the data are transformed in a HTML document using a XSLT processing (Skybot3D XSL style sheet)
- text
- the data are returned in plain text (CSV-like) with one line of data per asteroid
- json
- the data are returned in the JSON (JavaScript Object Notation) data-interchange format
For each asteroid, the following parameters are given:
- coord = rectangular
-
No. | Definition | Comment |
1 |
Asteroid id in Skybot database |
- |
2-4 |
Heliocentric equatorial mean J2000 position vector (x,y,z) |
au |
5-7 |
Heliocentric mean J2000 velocity vector (x',y',z') |
au/d |
8 |
Absolute magnitude |
H-G mag. system (Bowell) |
9 |
Slope parameter |
H-G mag. system (Bowell) |
10 |
Asteroid class |
- |
11 |
Asteroid name or designation |
- |
12 |
Diameter |
km |
13 |
Sso type |
Only in JSON format |
- coord = spherical
-
No. | Definition | Comment |
1 |
Asteroid id in Skybot database |
- |
2-3 |
Heliocentric equatorial mean J2000 right ascension and declination |
deg |
4 |
Heliocentric distance |
au |
5-6 |
Heliocentric equatorial mean J2000 motion in right ascension and declination |
deg/d |
7 |
Absolute magnitude |
H-G mag. system (Bowell) |
8 |
Slope parameter |
H-G mag. system (Bowell) |
9 |
Asteroid class |
- |
10 |
Asteroid name or designation |
- |
11 |
Diameter |
km |
12 |
Sso type |
Only in JSON format |
Examples: click on the following links to get the state vectors of
ten Apollo bodies and:
- mime=text
- mime=json
- mime=html
- mime=votable
How to consume:
In order to help you to invoke the Skybot3D web service, we provide some
clients written in
differents languages. Here are some detailed explanations to see how to write a client with PHP and SOAP which invokes the
getAster
method:
1/ Provide the input parameters which are mandatory for the service:
// Client's ID: provide the name of your project or organisation or yourself
$from = 'MyName';
// Input parameters
$param = array(
'epoch' => "now",
'class' => "",
'limit' => 10,
'coord' => "rectangular",
'mime' => "html"
);
2/ Define the SOAP options, the namespace and the WSDL URI of Skybot3D web service:
// Enables or disables the WSDL caching feature
ini_set('soap.wsdl_cache_enabled', 1);
// Skybot3D namespace
$namespace = 'http://vo.imcce.fr/webservices/skybot3d';
// Skybot3D WSDL
$uriwsdl = $namespace.'/skybot3d.wsdl';
3/ Create a SoapClient object in WSDL mode, set the SOAP header, then call the method and catch exceptions:
try
{
// Constructs the client
$client = new SoapClient($uriwsdl, array('exceptions'=>1));
// SOAP header
$header = array('from'=>$from, 'hostip'=>'');
$client->__setSoapHeaders(array(new SOAPHeader($namespace, 'clientID', $header)));
// Call the resolver method
$response = $client->__soapCall('getAster',array($param));
// Display the results
if ($param['mime'] == 'text')
{
header("Content-Type: text/plain");
if ($response->flag > 0) {
echo "# Flag : ".$response->flag."\n";
echo "# Ticket : ".$response->ticket."\n";
echo "# nbAster : ".$response->nbsso."\n";
echo "# refDate : ".$response->refdate."\n";
echo "# fileName : ".$response->file."\n";
echo "# fileSize : ".$response->size." bytes\n";
} else {
echo "# Flag : ".$response->flag."\n";
echo "# Ticket : ".$response->ticket."\n";
echo "# Message : ".$response->result."\n";
}
else if ($param['mime'] == 'json')
{
header("Content-Type: application/json");
if ($response->flag > 0) {
echo $response->result."\n";
} else {
echo "# Flag : ".$response->flag."\n";
echo "# Ticket : ".$response->ticket."\n";
echo "# Message : ".$response->result."\n";
}
}
else
{
header("Content-Type: text/xml;content=x-votable");
echo $response->result."\n";
}
}
catch (SoapFault $fault)
{
trigger_error("SOAP Fault: {$fault->getTraceAsString()} (faultcode: {$fault->faultcode}, faultstring: {$fault->faultstring})", E_USER_ERROR);
}