Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
O
Orekit Python Wrapper
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Orekit Labs
Orekit Python Wrapper
Commits
9def8e31
Commit
9def8e31
authored
10 years ago
by
Petrus Hyvönen
Browse files
Options
Downloads
Patches
Plain Diff
Added build files
parent
6429f33a
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
wrapper-build/bld.bat
+42
-0
42 additions, 0 deletions
wrapper-build/bld.bat
wrapper-build/build.sh
+42
-0
42 additions, 0 deletions
wrapper-build/build.sh
wrapper-build/pyhelpers.py
+87
-0
87 additions, 0 deletions
wrapper-build/pyhelpers.py
with
171 additions
and
0 deletions
wrapper-build/bld.bat
0 → 100644
+
42
−
0
View file @
9def8e31
python
-m
jcc
^
--use
_full_names
^
--python
orekit
^
--version
6
.1.0
^
--jar
orekit
-
6
.1.jar
^
--jar
commons
-math
3
-
3
.2.jar
^
--package
java
.io
^
--package
java
.util
^
--package
java
.text
^
java
.util.Arrays
^
java
.util.HashMap
^
java
.util.HashSet
^
java
.util.List
^
java
.util.Locale
^
java
.util.ArrayList
^
java
.util.Collection
^
java
.util.Collections
^
java
.util.Date
^
java
.util.Map
^
java
.util.TreeSet
^
java
.util.Set
^
java
.io.InputStream
^
java
.io.InputStreamReader
^
java
.io.PrintStream
^
java
.io.FileInputStream
^
java
.io.StringWriter
^
java
.io.StringReader
^
java
.lang.System
^
java
.text.DecimalFormat
^
java
.text.DecimalFormatSymbols
^
--module
pyhelpers
^
--reserved
INFINITE
^
--reserved
ERROR
^
--reserved
NAN
^
--reserved
OVERFLOW
^
--reserved
NO_DATA
^
--reserved
min
^
--reserved
max
^
--reserved
mean
^
--build
^
--bdist
_wininst
This diff is collapsed.
Click to expand it.
wrapper-build/build.sh
0 → 100644
+
42
−
0
View file @
9def8e31
#!/bin/bash
python
-m
jcc
\
--use_full_names
\
--python
orekit
\
--version
6.1.0
\
--jar
orekit-6.1.jar
\
--jar
commons-math3-3.2.jar
\
--package
java.io
\
--package
java.util
\
--package
java.text
\
java.util.Arrays
\
java.util.HashMap
\
java.util.HashSet
\
java.util.List
\
java.util.Locale
\
java.util.ArrayList
\
java.util.Collection
\
java.util.Collections
\
java.util.Date
\
java.util.Map
\
java.util.TreeSet
\
java.util.Set
\
java.io.StringReader
\
java.io.InputStream
\
java.io.InputStreamReader
\
java.io.PrintStream
\
java.io.FileInputStream
\
java.lang.System
\
java.text.DecimalFormat
\
java.text.DecimalFormatSymbols
\
--module
pyhelpers
\
--reserved
INFINITE
\
--reserved
ERROR
\
--reserved
OVERFLOW
\
--reserved
NO_DATA
\
--reserved
NAN
\
--reserved
min
\
--reserved
max
\
--reserved
mean
\
--build
\
--install
This diff is collapsed.
Click to expand it.
wrapper-build/pyhelpers.py
0 → 100644
+
87
−
0
View file @
9def8e31
# encoding: utf-8
# Copyright 2014 SSC
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""
This document contains classes that are useful for using the orekit
library in Python.
"""
# Set up the orekit namespace
import
orekit
from
java.io
import
File
from
org.orekit.data
import
DataProvidersManager
,
ZipJarCrawler
from
org.orekit.time
import
TimeScalesFactory
,
AbsoluteDate
from
org.orekit.utils
import
ElevationMask
from
orekit
import
JArray
import
math
from
datetime
import
datetime
def
setup_orekit_curdir
():
'''
Setup the java engine with orekit.
This functionsand loads the orekit-data.zip from the current directory
and sets up the orekit DataProviders to access it.
The JVM needs to be initiated prior to calling this function:
orekit.initVM()
'''
DM
=
DataProvidersManager
.
getInstance
()
datafile
=
File
(
'
orekit-data.zip
'
)
if
not
datafile
.
exists
():
print
'
File :
'
,
datafile
.
absolutePath
,
'
not found
'
crawler
=
ZipJarCrawler
(
datafile
)
DM
.
clearProviders
()
DM
.
addProvider
(
crawler
)
def
absolutedate_to_datetime
(
orekit_absolutedate
):
'''
Converts between orekit.AbsoluteDate objects
and python datetime objects (utc)
'''
utc
=
TimeScalesFactory
.
getUTC
()
or_comp
=
orekit_absolutedate
.
getComponents
(
utc
)
or_date
=
or_comp
.
getDate
()
or_time
=
or_comp
.
getTime
()
seconds
=
or_time
.
getSecond
()
return
datetime
(
or_date
.
getYear
(),
or_date
.
getMonth
(),
or_date
.
getDay
(),
or_time
.
getHour
(),
or_time
.
getMinute
(),
int
(
math
.
floor
(
seconds
)),
int
(
1000.0
*
(
seconds
-
math
.
floor
(
seconds
))))
def
to_elevationmask
(
az
,
el
):
'''
Converts an array of azimuths and elevations to a
orekit ElevationMask object. All unts in degrees.
mask = to_elevationmask([0, 90, 180, 270], [5,10,8,5])
'''
mask
=
JArray
(
'
object
'
)(
len
(
az
))
for
i
in
range
(
len
(
az
)):
mask
[
i
]
=
JArray
(
'
double
'
)([
math
.
radians
(
az
[
i
]),
math
.
radians
(
el
[
i
])])
return
ElevationMask
(
mask
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment