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

Miriade Ephemeris Generator

.: rts :.

.: Purpose

This method is intended to people who need to compute the rise, transit and set of the major Solar system objects at a given epoch for a given geographic location.

.: HTTP Request

If you are a software/solutions developer, you might want to include the Miriade rts service into your application. This can be done by using the the Web service method or by using the following HTTP request:
http://vo.imcce.fr/webservices/miriade/rts_query.php?[parameters]
where [parameters] is a list of parameters separated by the character &. The allowed parameters are:
ParameterDefinitionLimits or value
-ep=<dateTime> Requested epoch, expressed in Julian day, ISO format,
or formatted as any English textual datetime
2433647.0 .. 2460676.0
(1951-01-01 12h .. 2024-12-31 12h)
-body=<integer> The number (or a comma separated list of numbers) of the requested solar system body c.f. the list of recognized bodies
-nbd=<integer> The number of dates to compute (default 1) 1 ≤ nbd < 731
-step=<integer> Step between dates, in day (default 1) 1 ≤ step ≤ 100
-long=<real> Longitude of the observer location, negative toward east, in decimal degrees -180° ≤ long ≤ 180°
-lat=<real> Latitude of the observer location, negative toward south, in decimal degrees -90° < lat < 90°
-tz=<real> Timezone of the observer location, in hours -
-mime=<string> Mime type of the results votable | html | text | text/csv
-extrap=<int> Number of significant digits of output parameters default = 0
-from=<string> Word which definite the name of the caller application, or which describes the request (optional) any short string (without space)

The output is described in the following table and is available in VOTable, HTML, CSV or plain text format (cf. examples).

The -mime parameter is optional and its value can be omitted (just write nothing or &-mime= without value). In this case, the output is displayed in VOTable.

The -extrap parameter is optional and its value can be omitted. This parameter applies on the second of time of the rise, transit and set events, and the values of the local coordinates (azimut and altitude) of the body at the time of events. Its default value is 0 (e.g. time and coordinates are truncated, respectively, at second and degree levels).

List of bodies recognized by Miriade.rts:
The first column provides the number to use to compute the ephemeris of the corresponding body.
  1. Mercury
  2. Venus
  3. Mars
  4. Jupiter
  5. Saturn
  6. Uranus
  7. Neptune
  8. Moon
  9. Sun
You can request the ephemeris of several bodies by submitting a list of numbers separated by a comma, e.g.: -body=11,10,4,5

.: Web service

The Miriade Web service provides methods based on SOAP and HTTP POST verb which allow one to interact between its own application and the Miriade services. Here is the useful information to invoke the rts method:
Web Service URI:
http://vo.imcce.fr/webservices/miriade/miriade.php
Namespace:
http://vo.imcce.fr/webservices/miriade
WSDL:
http://vo.imcce.fr/webservices/miriade/miriade.php?wsdl
SOAP header:
name of the SOAP header element: 'clientID'
SOAP header's content: array('from' => 'YourName', 'hostip'=>'')
Method:
rts  (inputArray)

(*) Note that you should preferably leave the header field 'hostip' empty.

- The input parameters of the method is an array which must contained the following parameters:
VariableTypeUnitsLimits or valuesDefaultComment
body integer - 1,2,4,5,6,7,8,10,11 11 The number (or a comma separated list of numbers) of the requested solar system body
epoch string epoch 2433647.0 .. 2460676.0
(1951-01-01 12h .. 2024-12-31 12h)
none Requested epoch (julian day, ISO format, English textual datetime)
nbd integer - 1 .. 730 1 The number of date of computation
longitude double degree -180° .. 180° (decimal) none Longitude of the observer location, negative toward east
latitude double degree -90° .. +90° (decimal) none Latitude of the observer location, negative toward south
tz double hour - 0 Timezone of the observer location
mime string - votable | html | text | text/csv votable Mime type of the results
extrap int - Positive integer 0 Number of significant digits of output parameters
- The output parameters of the method is an object containing the following attributes:
'flag'
the status of the response: flag=1 means that all is right; flag=-1 means that an error occured
'ticket'
the Unix timestamp of the answer which can be useful to stamp the request
'result'
a string containing the ephemerides with the following parameters:
No.DefinitionUnitsComment
1 Name of the Solar system body -
2 Date of the event yyyy-mm-dd
3 Rise time hh:mm:ss.s (*)
4 Azimut of the rising deg. (*)
5 Transit time hh:mm:ss.s (*)
6 Elevation of the transit deg. (*)
7 Set time hh:mm:ss (*)
8 Azimut of the setting deg. (*)
9 Astronomical down hh:mm:ss for the Sun only
10 Nautical down hh:mm:ss for the Sun only
11 Civil down hh:mm:ss for the Sun only
12 Civil twilight hh:mm:ss for the Sun only
13 Nautical twilight hh:mm:ss for the Sun only
14 Astronomical twilight hh:mm:ss for the Sun only

(*) The number of significant digits is defined by the parameter 'extrap'. The default value is 0 (time and coordinates are truncated, respectively, at second and degree levels). The number of digits does not define, in any case, the true accuracy of the computed values. It has to be taken as a computational precision.

- 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 (Miriade XSL style sheet)
text
the data are returned in plain text where each value is separated by the comma character
- Examples: click on the following links to get the rise, transit and set now of the Moon, Mars and Jupiter, at geographic coordinates W2°,N48.2°, and with:
mime=text
mime=text/csv
mime=html
mime=votable

.: How to consume:

You have two ways to use the Miriade web service: by writting a client to send requests to the Miriade 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 Miriade 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 rts 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(
  'body' => '11,10,4',
  'epoch' => 2454579.5,
  'nbd' => 1,
  'step' => 1,
  'longitude' => -2.3511111,
  'latitude' => 48.8566667,
  'tz' => 0,
  'mime' => 'text',
  'extrap' => 1
);

2/ Define the SOAP options, the namespace and the WSDL URI of Miriade Web service:

// Enables or disables the WSDL caching feature
ini_set('soap.wsdl_cache_enabled', 1);
// Miriade namespace
$namespace = 'http://vo.imcce.fr/webservices/miriade';
// Miriade WSDL
$uriwsdl = $namespace.'/miriade.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_version'=>"SOAP_1_2"));
  // SOAP header
  $header = array('from'=>$from, 'hostip'=>'');
  $client->__setSoapHeaders(array(new SOAPHeader($namespace, 'clientID', $header)));
  // Call the resolver method
  $response = $client->__soapCall('rts', array($param));
  // Display the results
  if ($param['mime'] == 'text')
  {
    header("Content-Type: text/plain");
    echo "Flag : ".$response->flag."\n";
    echo "Ticket: ".$response->ticket."\n";
    echo "Result: ";
    $res = explode(';', $response->result);
    $nbr = count($res);
    $newkey = array_keys($res);
    for ($i=0; $i<$nbr; $i++) { echo $res[$newkey[$i]],"\n"; };
  }
  else
  {
    header("Content-Type: text/xml");
    echo $response->result."\n";
  }
}
catch (SoapFault $fault)
{
  trigger_error("SOAP Fault: {$fault->getTraceAsString()} (faultcode: {$fault->faultcode}, faultstring: {$fault->faultstring})", E_USER_ERROR);
}