The method skybotresolver
is intended to people who need to
resolve the name of a Solar System object (asteroid, planet, natural satellite or comet)
in celestial coordinates. This method must be used only in the framework
of the SkyBoT service, in particular to resolve name in celestial coordinates for spacecrafts.
Please use instead SsODNet service
to resolve the name of any Solar System object.
If you are a software/solutions developer, you might want to include the SkyBoT skybotresolver
service into your application. This can be done by using the web service method or
by using the following HTTP request:
- https://ssp.imcce.fr/webservices/skybot/api/resolver.php?[parameters]
where [parameters] is a list of parameters separated by the character &
.
The allowed parameters are:
Parameter | Definition | Limits |
-name=<string> |
Name or designation of the target |
Ex.: 2, Pallas, 1999 TC36, p/halley |
-ep=<dateTime> |
Requested epoch, expressed
in Julian period, ISO format, or formatted as any English
textual datetime |
2411320.0 .. 2473540.0 1889-11-13 12h .. 2060-03-21 12h |
-mime=<string> |
Mime type of the results |
votable | html | text | json |
-observer=<string> |
Code or geographic coordinates of the observer's
location |
Ex.: 500 (geocenter), 007 (Paris), @kepler, ... |
-output=<string> |
Output parameters |
object | basic | obs | all |
-refsys=<string> |
Code to indicate the reference system of coordinates |
EQJ2000 (default) | ECJ2000 (optional) |
-from=<string> |
Word which define the name of the caller application, or which describes the request |
any short string (no space character) |
The output results are described in the following section, and are available
in VOTable (default), HTML, plain text format, and
JSON object (cf. examples). The -mime
and -output
arguments are optionnal and their value can be omitted (just write nothing or ...&-mime=&-output=
without
value). In this case, the output is the basic one displayed as VOTable.
The SkyBoT Web service provides methods based on SOAP and
HTTP POST verb which allow
one to interact between its own application and the SkyBoT service. Here is the useful information to
invoke the SkyBoT skybotresolver
method:
- Web Service URI:
- https://ssp.imcce.fr/webservices/skybot/skybot.php
- Namespace:
- https://ssp.imcce.fr/webservices/skybot
- WSDL:
- https://ssp.imcce.fr/webservices/skybot/skybot.php?wsdl
- SOAP header:
- name of the SOAP header element:
clientID
- SOAP header's content:
array('from' => 'YourName', 'hostip'=>'')
- Method:
- skybotresolver (inputArray)
The input parameter of the method is an array which must contained the following parameter:
Variable | Type | Units | Limits or values | Default | Comment |
name |
string |
designation |
- |
none |
Name or designation of the target |
epoch |
string |
dateTime |
2411320.0 .. 2473540.0 1889-11-13 12h .. 2060-03-21 12h |
none |
Requested epoch (julian period,
ISO format, English textual datetime) |
mime |
string |
- |
votable | html | text | json |
votable |
Mime type of the results |
observer |
string |
- |
Code (IAU or special) or geographic coordinates |
500 |
Code or geographic coordinates of the
observer's location |
output |
string |
- |
object | basic | obs | all |
basic |
Output parameters |
refsys |
string |
- |
Code to indicate the reference system of coordinates |
EQJ2000 |
Equatorial (EQJ2000) or ecliptic (ECJ2000) |
The output of the skybotresolver
method is an object containing the following attributes:
- 'flag'
- the status of the response:
flag=1
means ok; flag=0
or flag=-1
mean that an error occured
- 'status'
- the HTTP status-code of the response (e.g.
400: bad request
, 422: Unprocessable Entity
, 500: internal error
)
- 'ticket'
- the Unix timestamp of the response which can be useful to stamp the request
- 'result'
- a string containing the ephemeris of the requested solar system body with the parameters described in
the output results section
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 from VOTable to HTML by XSLT processing (SkyBoT XSL style sheet)
- text
- the data are returned in plain text where each value is separated by the pipe '|' character
- json
- the data are written in a JSON object.
The output parameters of the method is a string which contains the following information:
Field | Definition | Units | Output |
object | basic | obs | all |
1 |
Object number (blank if unnumbered) |
- |
x |
x |
x |
x |
2 |
Object name (official or preliminary designation) |
- |
x |
x |
x |
x |
3–4 |
Astrometric J2000 equatorial or ecliptic coordinates at the given epoch, relatively to the observer |
α in hour, δ in deg long and lat in deg |
x |
x |
x |
x |
5 |
Class |
- |
x |
x |
x |
x |
6 |
Visual magnitude |
mag |
x |
x |
x |
x |
7 |
Error on the position |
arcsec |
x |
x |
x |
x |
8–9 |
Motion on the celestial sphere (Δα'cos(δ), Δδ) or (Δlon cos(lat), Δlat) |
arcsec/h |
|
x |
x |
x |
10 |
Distance to observer |
au |
|
x |
x |
x |
11 |
Heliocentric distance |
au |
|
x |
x |
x |
12 |
Phase angle |
degree |
|
|
x |
x |
13 |
Solar elongation |
degree |
|
|
x |
x |
14–19 |
Mean J2000 heliocentric equatorial or ecliptic position and velocity vectors at epoch T0 |
au and au/d |
|
|
|
x |
20 |
Reference epoch of the position vector |
Julien Day |
|
|
|
x |
When the output mime type is the JSON data-interchange format,
the output of the skybotresolver
method is encapsulated into a structure defined as
follows (case output=all
):
[
{
"Num": {int | string},
"Name": {string},
"RA (deg)": {float},
"DEC (deg)": {float},
"Class": {string},
"VMag (mag)": {float},
"Err (arcsec)": {float},
"dRA (arcsec\/h)": {float},
"dDEC (arcsec\/h)": {float},
"dg (ua)": {float},
"dh (ua)": {float},
"Phase (deg)": {float},
"SunElong (deg)": {float},
"position (au)": { "x": {float}, "y": {float}, "z": {float} },
"velocity (au\/d)": { "x": {float}, "y": {float}, "z": {float} },
"ref_epoch": {float}
}
]
You have two ways to use the SkyBoT web service: by writting a client to send requests to the SkyBoT server and
to receive and analyze the response, or by using a command line interface and a data transfert program such as
curl
or wget
.
For that, just execute one of the following commands in a console:
$> curl "<URL>"
or
$> wget "<URL>"
where <URL>
is described in section HTTP request.
In order to help you to invoke the SkyBoT web service, we provide some clients
written in differents languages. Here are some detailed explanations to write a client with PHP
and SOAP which invokes the skybotresolver
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',
'name' => 'io',
'mime' => 'json',
'output' => 'object',
'observer' => 500,
'refsys' => 'EQJ2000');
2/ Define the SOAP options, the namespace and the WSDL URI of SkyBoT web service:
// Enables or disables the WSDL caching feature
ini_set('soap.wsdl_cache_enabled', 1);
// SkyBoT namespace
$namespace = 'https://ssp.imcce.fr/webservices/skybot';
// SkyBoT WSDL
$uriwsdl = $namespace.'/skybot.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'=>'', 'lang'=>'en');
$client->__setSoapHeaders(array(new SOAPHeader($namespace, 'clientID', $header)));
// Call the resolver method
$response = $client->__soapCall('skybotresolver',$param);
// Display the results
if ($param['mime'] == 'text') {
header("HTTP/1.0 200");
header("Content-Type: text/plain");
echo "# Flag: ".$response->flag.PHP_EOL;
echo "# Ticket: ".$response->ticket.PHP_EOL;
$res = explode(';', $response->result);
$nbr = count($res);
$newkey = array_keys($res);
for ($i=0; $i<$nbr; $i++) { echo $res[$newkey[$i]].PHP_EOL; }
} else if ($param['mime'] == 'json') {
header("HTTP/1.0 200");
header("Content-Type: application/json");
echo $response->result;
} else {
header("HTTP/1.0 200");
header("Content-Type: text/xml;content=x-votable");
echo $response->result;
}
}
catch (SoapFault $fault)
{
trigger_error("SOAP Fault: {$fault->getTraceAsString()} (faultcode: {$fault->faultcode},
faultstring: {$fault->faultstring})", E_USER_ERROR);
}