Skip to content
Frank Thomas Tveter edited this page Aug 8, 2019 · 6 revisions

cgi-bin/state.pl documentation

The cgi-bin/state.pl can be used to retrieved the state of the solar system as seen from an observer at any specified times.

cgi-bin/state.pl interface

All times are in UTC. Geographic coordinates are given with east and north as positive values. MJD2000 refers to the "mean system of date axis at epoch 2000-01-01T12:0:0Z", which is also commonly used in for instance star-catalogues.

A cgi-bin/state.pl? URL-request has the following parameters:

  • dtg: requested state time given as "YYYY-MM-DDTHH:MI:SSZ"
  • lat: geographic latitude of observer (deg)
  • lon: geographic longitude of observer (deg)
  • hgt: height of observer above reference ellipsoide (km).

Several dtg may be specified.

This is an example of a cgi-bin/state.pl? request: http://astro.met.no/astro/cgi-bin/state.pl/?lat=60.0;lon=0.0;hgt=0.0;dtg=2010-10-10T10:10:10Z;dtg=2011-11-11T11:11:11Z; (test) with the resulting XML output:

<?xml version="1.0" encoding="utf-8"?>  
<solarsystem xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://astro.met.no" xsi:schemaLocation="http://astro.met.no/astro state.xsd">  
 <location latitude="60.0" longitude="0.0" height="0.0"/>  
 <initial no="11" ref="MJD2000">  
  <body ra="163.869055332605" dec="63.874526903968" w="0.0" dwdt="14.18" main="" xmu="132712440018.0" id="1" name="sun"/>  
  <body ra="169.017706108833" dec="61.439382413179" w="0.0" dwdt="6.14" main="sun" xmu="22032.0" id="2" name="mercury"/>  
  <body ra="177.236120779122" dec="67.157315787878" w="0.0" dwdt="-1.48" main="sun" xmu="324859.0" id="3" name="venus"/>  
  <body ra="90.066722316563" dec="89.944349048088" w="0.0" dwdt="360.99" main="sun" xmu="398601.299999999988" id="4" name="earth"/>  
  <body ra="179.999855286323" dec="66.539997328525" w="0.0" dwdt="13.18" main="earth" xmu="4904.9" id="5" name="moon"/>  
  <body ra="132.408575347095" dec="52.838882390154" w="0.0" dwdt="350.89" main="sun" xmu="42828.0" id="6" name="mars"/>  
  <body ra="-178.048524048048" dec="64.501886918597" w="0.0" dwdt="870.54" main="sun" xmu="126686534.0" id="7" name="jupiter"/>  
  <body ra="49.855388703419" dec="83.49760061448" w="0.0" dwdt="810.79" main="sun" xmu="37931187.0" id="8" name="saturn"/>  
  <body ra="-167.1671914117" dec="-15.167709710059" w="0.0" dwdt="-501.16" main="sun" xmu="5793947.0" id="9" name="uranus"/>  
  <body ra="150.682959910166" dec="42.922713575609" w="0.0" dwdt="536.31" main="sun" xmu="6836529.0" id="10" name="neptune"/>  
  <body ra="137.133704430828" dec="6.122095306504" w="0.0" dwdt="-56.36" main="sun" xmu="1001.0" id="11" name="pluto"/>  
 </initial>  
 <times no="2">  
  <time id="1" dtg="2010-10-10T10:10:10Z" jd2000="2455479.923726851586">  
   <observer  body="4" ref="MJD2000">  
    <i x="-0.988523553739" y="0.15106306986" z="0.001064249971"/>  
    <j x="-0.151062975469" y="-0.988524126607" z="0.000168989305"/>  
    <k x="0.001077564816" y="0.000006281141" z="0.999999419407"/>  
    <location x="-3154.494975696932" y="483.000346842976" z="5503.891974230116" origo="earth"/>  
    <zenith x="-0.493328578364" y="0.075536974558" z="0.866557025962"/>  
   </observer>  
   <state no="11" ref="MJD2000">  
    <body x="-633575.196110725403" y="180757.092905804515" z="80981.455599933863" vx="-0.000207605075" vy="-0.010109203068" vz="-0.004362259011" id="1" name="sun"/>  
    <body x="-58200203.682300239801" y="-1142532.809157118201" z="5342041.704520888627" vx="-10.843774233355" vy="-41.657633607046" vz="-21.127337372839" id="2" name="mercury"/>  
    <body x="107311097.184686243534" y="12371974.47074227035" z="-1264054.059746958315" vx="-3.583198801895" vy="31.547447462647" vz="14.42079237403" id="3" name="venus"/>  
    <body x="142344924.963238537312" y="39914780.577260367572" z="17306312.663658857346" vx="-9.131538466804" vy="26.052320465797" vz="11.293496457187" id="4" name="earth"/>  
    <body x="142121058.479851901531" y="39652256.647573910654" z="17168212.110461562872" vx="-8.332018568052" vy="25.392483031142" vz="11.076747925891" id="5" name="moon"/>  
    <body x="-89606588.168689131737" y="-189252990.895396322012" z="-84404921.512483030558" vx="23.181090876678" vy="-6.575573477542" vz="-3.641881962653" id="6" name="mars"/>  
    <body x="740540341.430354118347" y="6377116.967590272427" z="-15308578.536362167448" vx="-0.153571041463" vy="12.579950480541" vz="5.395841556601" id="7" name="jupiter"/>  
    <body x="-1416038960.561456203461" y="-203827683.466675907373" z="-23231302.49462480098" vx="0.809327566702" vy="-8.85097805885" vz="-3.6906744364" id="8" name="saturn"/>  
    <body x="3003856583.943105220795" y="-49046084.840196184814" z="-63968647.042841330171" vx="0.110398058697" vy="5.945955865934" vz="2.602617685354" id="9" name="uranus"/>  
    <body x="3783991873.558643817902" y="-2201331846.175591945648" z="-995218316.690239191055" vx="2.888756047515" vy="4.296935874742" vz="1.686839748133" id="10" name="neptune"/>  
    <body x="377491572.793660581112" y="-4508647893.908324241638" z="-1520740267.24408531189" vx="5.51823462739" vy="0.033714936277" vz="-1.652102553605" id="11" name="pluto"/>  
   </state>  
  </time>  
  <time id="2" dtg="2011-11-11T11:11:11Z" jd2000="2455876.966099536978">  
   <observer  body="4" ref="MJD2000">  
    <i x="-0.789132106888" y="-0.614222812478" z="0.000924397353"/>  
    <j x="0.614222371851" y="-0.789132648207" z="-0.00073583394"/>  
    <k x="0.001181438123" y="-0.000012884652" z="0.999999302019"/>  
    <location x="-2516.446511770341" y="-1963.81098874394" z="5503.444203826342" origo="earth"/>  
    <zenith x="-0.393542898017" y="-0.307122564675" z="0.866486997991"/>  
   </observer>  
   <state no="11" ref="MJD2000">  
    <body x="-526769.097813785076" y="-140493.211361289024" z="-60400.243906661868" vx="0.006572825111" vy="-0.007903203948" vz="-0.00356267854" id="1" name="sun"/>  
    <body x="45001556.752486027777" y="-34718556.906538397074" z="-23251887.325293511152" vx="22.932073465689" vy="34.920939022827" vz="16.277858772488" id="2" name="mercury"/>  
    <body x="23344176.566058531404" y="-96406220.564957290888" z="-44883914.174971848726" vx="33.937160143036" vy="7.678061549756" vz="1.307432593759" id="3" name="venus"/>  
    <body x="97544254.944837018847" y="101695384.935091286898" z="44086963.83564388752" vx="-22.793895213023" vy="17.977904841552" vz="7.794803433503" id="4" name="earth"/>  
    <body x="97773523.270968750119" y="101994910.24783359468" z="44229796.282762609422" vx="-23.607004167486" vy="18.506653314381" vz="7.931211463793" id="5" name="moon"/>  
    <body x="-96020706.671770170331" y="201537601.271149754524" z="95022686.743527591228" vx="-21.344840965478" vy="-7.021088701384" vz="-2.643670391546" id="6" name="mars"/>  
    <body x="597657610.017404317856" y="409624260.952570438385" z="161011945.726745903492" vx="-7.900802072506" vy="10.176493233954" vz="4.554276315274" id="7" name="jupiter"/>  
    <body x="-1351430851.369195461273" y="-499495586.30251288414" z="-148140547.332563459873" vx="2.932844698192" vy="-8.312238496816" vz="-3.5595931553" id="8" name="saturn"/>  
    <body x="2998855064.30230140686" y="154797463.04666185379" z="25378847.922497220337" vx="-0.394507503628" vy="5.937116196242" vz="2.605884129241" id="9" name="uranus"/>  
    <body x="3879587922.456373214722" y="-2052184309.12223315239" z="-936559263.843494415283" vx="2.695641468856" vy="4.404160240247" vz="1.735535337392" id="10" name="neptune"/>  
    <body x="566249109.787489891052" y="-4504399735.952753067017" z="-1576369749.934535503387" vx="5.498657001973" vy="0.220681830391" vz="-1.587857860057" id="11" name="pluto"/>  
   </state>  
  </time>  
 </times>  
</solarsystem>

The XML master node, <solarsystem/> contains a <location/>, <initial/> and <times/> node.

The <location/> node repeats the geographic location of observer.

The time independent <initial/> node contains a list of <body/> nodes, where each <body/> node contains the right ascencsion and declination of the rotational poles, along with rotational rate and standard gravitional parameters for the available celestial bodies in the solar system.

The <times> node contain a list of <time/> nodes, one for each of the requested times. The jd2000 attribute in the <time/> node refers to the number of julian days since the epoch 2000-01-01T12:0:0Z. Each <time/> node contains an <observer/> node and a <state/> node.

The <observer/> node attribute body indicates which celestial body is used as origo and the attribute ref indicates the coordinate axis used. MJD2000 is the commonly used "mean system of date at the epoch 2000-01-01T12:0:0Z" coordinate axis. The <i/>, <j/> and <k/> nodes indicate the axis of the earth fixed coordinate system with k-axis pointing along the rotational axis of the celestial body and i-axis pointing from the rotational axis towards the observer. The <location/> indicates the Cartesian coordinates of the observer. The <zenith/> node indicates the zenith-direction relative to the reference ellipsoide.

The <state/> node contains a list of <body/> nodes that specify the position and velocity of the available celestial bodies in the solar system. The default origo is here the solar system barycentre.