"Orekit is an open-source library for a number of space related calculations such as:\n",
"\n",
"* Orbit Propagation\n",
"* Coordinate system transformations\n",
"* Time systems\n",
"\n",
"The orekit webpage can be accessed at http://www.orekit.org.\n",
"\n"
]
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"The java - pyhon bridge"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"The orekit library is written in java. For interactive work a bridge to Python has been made, which will be used in this tutorial."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"The orekit java library has been wrapped using the open source JCC tool, that enables interaction with java objects from the Python ecosystem. Python has quick and high quality routines for plotting and a easily read code.\n",
"Orekit needs to be initiated before used, partly setting up the Python - both the Java gateway and partly setting up access to the data needed for different orekit functions, such as the shape of the earth, leap time seconds etc."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"First we need to intitilize the iPython notebook, that we want to use the inline pylab functionality and how large defalt plots should be. This is not orekit specific."
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"%pylab inline\n",
"figsize(15,15)"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Populating the interactive namespace from numpy and matplotlib\n"
]
}
],
"prompt_number": 1
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"To start up the orekit JVM:"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"import orekit\n",
"vm = orekit.initVM()\n",
"print 'Java version:',vm.java_version"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Java version: 1.7.0_45\n"
]
}
],
"prompt_number": 2
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"The orekit library needs a data file with various information on time and earth rotation parameters. This file, called orekit-data.zip is loaded from current dir. A basic version of this file can be downloaded from the orekit [webpage](https://www.orekit.org/forge/projects/orekit/files).\n",
"\n",
"This routine is commonly used in the notebooks, so a python specific function is created for this, setup_orekit_curdir()"
"Now we are set up to import and use objects from the orekit library."
"cell_type": "markdown",
"metadata": {},
"source": [
"# Orekit in Python - The basics"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Orekit is an open-source library for a number of space related calculations such as:\n",
"\n",
"* Orbit Propagation\n",
"* Coordinate system transformations\n",
"* Time systems\n",
"\n",
"The orekit webpage can be accessed at http://www.orekit.org.\n",
"\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## The java - pyhon bridge"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"The orekit library is written in java. For interactive work a bridge to Python has been made, which will be used in this tutorial."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"The orekit java library has been wrapped using the open source JCC tool, that enables interaction with java objects from the Python ecosystem. Python has quick and high quality routines for plotting and a easily read code.\n",
"Orekit needs to be initiated before used, partly setting up the Python - both the Java gateway and partly setting up access to the data needed for different orekit functions, such as the shape of the earth, leap time seconds etc."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"First we need to intitilize the iPython notebook, that we want to use the inline pylab functionality and how large defalt plots should be. This is not orekit specific."
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Populating the interactive namespace from numpy and matplotlib\n"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"from org.orekit.utils import Constants"
],
"language": "python",
"metadata": {},
"outputs": [],
"prompt_number": 4
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"print Constants.WGS84_EARTH_EQUATORIAL_RADIUS"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"6378137.0\n"
]
}
],
"prompt_number": 5
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"SI base units are used in the library, such as seconds, meter, m/s"
}
],
"source": [
"%pylab inline\n",
"figsize(15,15)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"To start up the orekit JVM:"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Java version: 1.8.0_25\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"*Petrus Hyv\u00f6nen, SSC, 2014*"
}
],
"source": [
"import orekit\n",
"vm = orekit.initVM()\n",
"print 'Java version:',vm.java_version"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"The orekit library needs a data file with various information on time and earth rotation parameters. This file, called orekit-data.zip is loaded from current dir. A basic version of this file can be downloaded from the orekit [webpage](https://www.orekit.org/forge/projects/orekit/files).\n",
"\n",
"This routine is commonly used in the notebooks, so a python specific function is created for this, setup_orekit_curdir()"