Logo IMCCE-VOParis

THE IMCCE VIRTUAL OBSERVATORY
SOLAR SYSTEM PORTAL
Observatoire de Paris / CNRS

Logo IMCCE
Portal Home Page | Report issue | Legal notice | Contact us

Skybot 3D

.: getPlanet :.

.: Purpose

This method is intended to people who want to retrieve the state vectors of planets and their major satellites at a reference epoch. The state vectors of planets are computed on the fly using INPOP planetary theory. Those of major satellites are computed using dedicated solution of their motion: V. Lainey, V. Dehant and M. Pätzold 2007 for Mars, V. Lainey, L. Duriez and A. Vienne 2004 for Jupiter, A. Vienne and L. Duriez 1995 for Saturn, J. Laskar and R.A. Jacobson 1987 for Uranus, and C. Le Guyader 1993 for Neptune.

.: HTTP Request

The Skybot3D getPlanet service can be accessed using the Skybot3D query forms (TBD). If you are a software/solutions developer, you might want to include the Skybot3D getPlanet 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/getPlanet_query.php?[parameters]
ParameterDefinitionLimits
-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 planets or only the satellites. Leave empty to get all bodies. planets | satellites
-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.
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 planets and major satellites 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 getPlanet 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:
getPlanet  (inputArray)
- The input parameters of the method is an array which must contained the following parameters:
VariableTypeUnitsLimits or valuesDefaultComment
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 - planets | satellites empty To request only planets or satellites. Leave empty to request all bodies.
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 targets. 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
'nbtarg'
the number of targets 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.

- 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 target
json
the data are returned in the JSON (JavaScript Object Notation) data-interchange format

- For each object, the following parameters are given:

coord = rectangular
No.DefinitionComment
1 Planet or satellite id -
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 V(1,0)
9 Planet or satellite name -
10 Sso type Only in JSON format
coord = spherical
No.DefinitionComment
1 Planet or satellite id -
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 V(1,0)
8 Planet or satellite name -
9 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 getPlanet 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' => "",
    '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('getPlanet',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 "# nbPlanets : ".$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);
}