Skip to content
This repository was archived by the owner on Dec 22, 2020. It is now read-only.

[WIP] Frames #14

Open
wants to merge 41 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
b1bf3c9
Add singledispatch_method
RazerM Mar 21, 2016
6352920
Clear up licenses
RazerM Mar 21, 2016
d570d4b
Start implementation of Rotation class
RazerM Mar 21, 2016
7839d9d
Start implementing Frames
RazerM Mar 21, 2016
835ee42
Install SciPy wheel too
RazerM Mar 21, 2016
399de56
Add enum34 dependency
RazerM Mar 21, 2016
b4c88e3
Add __eq__ and __repr__ to Rotation
RazerM Mar 22, 2016
5cceaab
Use bi00 for EME2000 transform
RazerM Mar 22, 2016
b876a13
Update Python
RazerM Mar 22, 2016
7dc4266
Fix scipy install on Travis
RazerM Mar 23, 2016
b89d976
Fix classmethod
RazerM Mar 23, 2016
0da1d68
More rotation tests
RazerM Mar 23, 2016
4008e82
Revert "Add singledispatch_method"
RazerM Mar 23, 2016
e4d15cc
Pass CI env var to tox
RazerM Mar 23, 2016
7e689f6
Install latest packaging tools
RazerM Mar 23, 2016
1ec8ebf
Move dev extra to dev-requirements.txt
RazerM Mar 24, 2016
f05ef5e
Implement Rotation.get_euler_angles
RazerM Mar 27, 2016
2248faa
Fix EME2000 rotations
RazerM Mar 27, 2016
e4b3b92
Use for loops instead of test parametrization
RazerM Mar 28, 2016
02683df
Improved Frames API, added CIRF.
RazerM Mar 30, 2016
97d48d5
Proxy class shouldn't be slow.
RazerM Mar 31, 2016
616906d
Clean up rotation implementation, add documentation
RazerM Apr 3, 2016
22c6cec
Add first two frame tests, some clean up.
RazerM Apr 3, 2016
8663989
Fix frames for Rotation changes
RazerM Apr 3, 2016
2022462
Fix units, Python 2 abc module
RazerM Apr 3, 2016
6f97019
Better units in tests
RazerM Apr 3, 2016
244e3bc
flake8
RazerM Apr 3, 2016
8fc4f63
Move check functions to central place, add test
RazerM Apr 3, 2016
ea3f748
Format imports
RazerM Apr 6, 2016
15ab942
Add test_mod.py
RazerM Apr 6, 2016
df8e84d
Format imports
RazerM Apr 6, 2016
366cf48
Use itertools product for test_rotation
RazerM Apr 13, 2016
1dc5fa1
Fix rotation __invert__ to match commons-math, add distance_to
RazerM Apr 13, 2016
1fe63af
Add inherit_doc helper
RazerM Apr 13, 2016
30fd979
Add neighbor/nearest helpers
RazerM Apr 13, 2016
3598d47
Add __eq__ proxy to FrameProxy, change API slightly
RazerM Apr 13, 2016
8363458
Add iers interface
RazerM Apr 13, 2016
7d4582d
Add latest WIP frames
RazerM Apr 13, 2016
fdafc9b
Update frame tests. TOD/CIRF not yet done.
RazerM Apr 13, 2016
3c1da80
Fix check_rotation
RazerM Apr 13, 2016
95d2a18
Minor docs update
RazerM Apr 13, 2016
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 22 additions & 11 deletions .appveyor/install_numpy.py → .appveyor/install_numpy_scipy.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,14 @@
from six.moves.urllib.request import urlretrieve


def download_numpy_wheel():
base_url = os.getenv('NUMPY_URL')
def download_wheel(name, version):
base_url = os.getenv('WHEEL_URL')
if base_url is None:
raise ValueError('NUMPY_URL environment variable is missing.')
raise ValueError('WHEEL_URL environment variable is missing.')

version = '1.10.4+mkl'
py = 'cp{0[0]}{0[1]}'.format(sys.version_info)
if py not in {'cp27', 'cp34', 'cp35'}:
print('NumPy wheel not available for {}'.format(py))
print('{} wheel not available for {}'.format(name, py))
return None

bits = struct.calcsize('P') * 8
Expand All @@ -29,26 +28,38 @@ def download_numpy_wheel():
else:
raise ValueError("Couldn't determine 32/64 bits.")

filename = 'numpy-{}-{}-none-{}.whl'.format(version, py, arch)
filename = '{}-{}-{}-none-{}.whl'.format(name, version, py, arch)

directory = 'astrodynamics-numpy-wheels'
os.mkdir(directory)
directory = 'astrodynamics-wheels'
try:
os.mkdir(directory)
except OSError:
pass

filepath = os.path.join(directory, filename)
url = base_url + filename

# Disable SSL. Shouldn't do this ever. This is just a script.
ssl._create_default_https_context = ssl._create_unverified_context
urlretrieve(url, filepath)
return filepath


def install_numpy():
filepath = download_numpy_wheel()
filepath = download_wheel('numpy', '1.10.4+mkl')
if filepath:
pip.main(['install', filepath])
else:
pip.main(['install', 'numpy'])


def install_scipy():
filepath = download_wheel('scipy', '0.17.0')
if filepath:
pip.main(['install', filepath])
else:
pip.main(['install', 'scipy'])

if __name__ == '__main__':
# Disable SSL. Shouldn't do this ever. This is just a script.
ssl._create_default_https_context = ssl._create_unverified_context
install_numpy()
install_scipy()
14 changes: 14 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,16 @@ cache:
- $HOME/.cache/pip
# OS X cache not yet enabled: https://github.com/travis-ci/travis-ci/issues/4011
- $HOME/Library/Caches/pip
addons:
apt:
packages:
- libatlas-dev
- libatlas-base-dev
- liblapack-dev
- gfortran
env:
global:
- TOX_TESTENV_PASSENV=CI
matrix:
include:
- python: 2.7
Expand All @@ -24,6 +34,10 @@ matrix:
addons:
apt:
packages:
- libatlas-dev
- libatlas-base-dev
- liblapack-dev
- gfortran
- libenchant-dev
- graphviz
- language: generic
Expand Down
15 changes: 10 additions & 5 deletions .travis/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ if [[ "$(uname -s)" == 'Darwin' ]]; then
pyenv global 3.3.6
;;
py34)
pyenv install 3.4.3
pyenv global 3.4.3
pyenv install 3.4.4
pyenv global 3.4.4
;;
py35)
pyenv install 3.5.0
pyenv global 3.5.0
pyenv install 3.5.1
pyenv global 3.5.1
;;
esac
pyenv rehash
Expand All @@ -38,4 +38,9 @@ fi

python -m virtualenv ~/.venv
source ~/.venv/bin/activate
pip install tox codecov
pip install -U tox codecov setuptools wheel

# Build wheels for cache, but do it here so pip output prevents Travis timing out.
# We install numpy since it has to be installed before we can build scipy wheel.
pip install numpy
pip install scipy
4 changes: 2 additions & 2 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ environment:
# /E:ON and /V:ON options are not enabled in the batch script intepreter
# See: http://stackoverflow.com/a/13751649/163740
BUILD: "cmd /E:ON /V:ON /C .\\.appveyor\\build.cmd"
NUMPY_URL:
WHEEL_URL:
secure: drCgBIMN3vdVjPRXNyiBAHa4g9VeRmnylFuhd7aUUA7XYhA8FfyJ5bHdXtzkFhgT6GzUSXqp19RcXW6DOX9eow==

matrix:
Expand Down Expand Up @@ -41,7 +41,7 @@ install:
- python -m virtualenv C:\projects\venv
- C:\projects\venv\Scripts\activate.bat
- pip install -U codecov coverage setuptools six wheel
- "%BUILD% python .appveyor\\install_numpy.py"
- "%BUILD% python .appveyor\\install_numpy_scipy.py"
- "%BUILD% pip install .[test]"

build: off
Expand Down
18 changes: 18 additions & 0 deletions dev-requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
-e .[test]
doc8
flake8
flake8-coding
flake8-future-import
isort
pep8-naming
plumbum>=1.6.0
pyenchant
pytest-cov
shovel
sphinx>=1.4.0
sphinx_rtd_theme
sphinxcontrib-spelling
tabulate
tox
twine
watchdog
4 changes: 2 additions & 2 deletions docs/astrodynamics-docs.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# coding: utf-8
# This file is dual licensed under the terms of the Apache License, Version
# 2.0, and the BSD License. See the LICENSE file in the root of this repository
# for complete details.
# 2.0, and the BSD License. See the licenses/CRYPTOGRAPHY.txt file in this
# repository for complete details.
#
# This file is adapted from cryptography-docs.py by the The Cryptography
# Developers.
Expand Down
2 changes: 2 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@
# ones.
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.autosectionlabel',
'sphinx.ext.doctest',
'sphinx.ext.inheritance_diagram',
'sphinx.ext.intersphinx',
'sphinx.ext.mathjax',
Expand Down
6 changes: 3 additions & 3 deletions docs/development/getting-started.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ Getting started

Working on ``astrodynamics`` requires the installation of some
development dependencies. These can be installed in a `virtualenv`_
using `pip`_ with the ``dev`` extras. You should install
``astrodynamics`` in ``editable`` mode.
using `pip`_ with the ``dev-requirements.txt`` file. This installs the
dependencies and installs ``astrodynamics`` in editable mode.

For example:

.. code-block:: console

$ # Create a virtualenv and activate it
$ pip install --editable .[dev]
$ pip install -r dev-requirements.txt

You are now ready to run the tests and build the documentation.

Expand Down
3 changes: 3 additions & 0 deletions docs/module.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,7 @@ Module Reference

modules/bodies/index
modules/constants
modules/frames/index
modules/lowlevel/index
modules/rotation
modules/utils/index
2 changes: 1 addition & 1 deletion docs/modules/constants.rst
Original file line number Diff line number Diff line change
Expand Up @@ -136,4 +136,4 @@ WGS84_MU WGS84 geocentric gravitational constant
WGS84_ANGULAR_VELOCITY WGS84 nominal earth mean angular velocity World Geodetic System 1984
================================= =============================================== ===============================================================

.. _`license`: https://raw.githubusercontent.com/python-astrodynamics/astrodynamics/master/licenses/ASTROPY_LICENSE.txt
.. _`license`: https://raw.githubusercontent.com/python-astrodynamics/astrodynamics/master/licenses/ASTROPY.txt
7 changes: 7 additions & 0 deletions docs/modules/frames/frame.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
********************
Frame Implementation
********************

.. automodule:: astrodynamics.frames.frame
:members:
:show-inheritance:
11 changes: 11 additions & 0 deletions docs/modules/frames/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
******
Frames
******

.. py:module:: astrodynamics.frames

.. toctree::
:maxdepth: 2

frame
mod
7 changes: 7 additions & 0 deletions docs/modules/frames/mod.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
**************************
Mean Equinox of Date Frame
**************************

.. automodule:: astrodynamics.frames.mod
:members:
:show-inheritance:
8 changes: 8 additions & 0 deletions docs/modules/lowlevel/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
*********
Low Level
*********

.. py:module:: astrodynamics.frames

.. toctree::
:maxdepth: 2
58 changes: 58 additions & 0 deletions docs/modules/rotation.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
*********
Rotations
*********

.. currentmodule:: astrodynamics.rotation

.. autoclass:: astrodynamics.rotation.Rotation
:members: __init__, from_axis_angle, from_matrix, from_euler_angles, angle,
get_axis, get_angles, matrix, apply_to, compose, distance_to
:show-inheritance:

.. autoclass:: astrodynamics.rotation.RotationOrder
:members:
:show-inheritance:

Rotation Convention
===================

Vector Operator
---------------

Pass ``convention='vector'`` to use the semantics of a vector operator.
According to this convention, the rotation moves vectors with respect to a fixed
reference frame.

This means that if we define rotation r is a 90 degrees rotation around the Z
axis, the image of vector I would be J, the image of vector J would be -I, the
image of vector K would be K, and the image of vector with coordinates (1, 2, 3)
would be vector (-2, 1, 3). This means that the vector rotates counterclockwise.

The difference with the frame transform convention is only the semantics of the
sign of the angle. It is always possible to create or use a rotation using
either convention to really represent a rotation that would have been best
created or used with the other convention, by changing accordingly the sign of
the rotation angle.

Frame Transform
---------------

Pass ``convention='frame'`` to use the semantics of a frame conversion.

According to this convention, the rotation considered vectors to be fixed, but
their coordinates change as they are converted from an initial frame to a
destination frame rotated with respect to the initial frame.

This means that if we define rotation r is a 90 degrees rotation around the Z
axis, the image of vector I would be -J, the image of vector J would be I, the
image of vector K would be K, and the image of vector with coordinates (1, 2, 3)
would be vector (2, -1, 3). This means that the coordinates of the vector
rotates clockwise, because they are expressed with respect to a destination
frame that is rotated counterclockwise.

The difference with vector operator convention is only the semantics of the sign
of the angle. It is always possible to create or use a rotation using either
convention to really represent a rotation that would have been best created or
used with the other convention, by changing accordingly the sign of the rotation
angle.

File renamed without changes.
Loading