Skip to content

Commit

Permalink
Merge pull request #26 from pysat/develop
Browse files Browse the repository at this point in the history
Version 0.2.0
  • Loading branch information
jklenzing committed Mar 7, 2020
2 parents b4dcade + ed47f8a commit 3b2ca51
Show file tree
Hide file tree
Showing 42 changed files with 2,465 additions and 1,322 deletions.
21 changes: 21 additions & 0 deletions .codeclimate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Save as .codeclimate.yml (note leading .) in project root directory
plugins:
radon:
enabled: true
pep8:
enabled: true
sonar-python:
enabled: true
ratings:
paths:
- "**.py"
exclude_paths:
- ".github/**/*"
- "pysatMissions/tests/**/*"
- "docs/**/*"
- "setup.py"
- ".*"
- "*.md"
- "*.in"
- "*.txt"
- "*.png"
3 changes: 3 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[flake8]
max-line-length = 90
exclude = .git,__pycache__,.eggs/,doc/,docs/,build/,dist/,archive/
30 changes: 15 additions & 15 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
os: linux
language: python
dist: xenial
matrix:
jobs:
include:
- python: 2.7
- python: 3.5
- name: Minimum NEP 029 versions
python: 3.6
env: NUMPY_VER=1.15
# Versions with latest numpy
- python: 3.6
- python: 3.7
- python: 3.8

services: xvfb
addons:
Expand All @@ -14,26 +18,26 @@ addons:
- gfortran

before_install:
- if [ -z ${NUMPY_VER} ]; then
echo 'Using latest numpy';
else
pip install -q numpy==$NUMPY_VER;
fi
- pip install pytest-cov
- pip install coveralls
- pip install future
# Install version specific packages for 2.7 and 3.5
- pip install 'pandas<0.25'
- pip install xarray
- pip install matplotlib
- pip install apexpy

# Prepare modified pysat install
- pip install numpy
- cd ..
- echo 'cloning pysat'
- git clone https://github.com/pysat/pysat.git >/dev/null
- echo 'installing pysat'
- cd ./pysat
- git checkout develop
# set up data directory
- mkdir /home/travis/build/pysatData
# install pysat
- git checkout develop-3
- python setup.py install >/dev/null

# install pyglow, space science models
Expand All @@ -44,21 +48,17 @@ before_install:
- cd ./pyglow
- make -C src/pyglow/models source >/dev/null
- python setup.py install >/dev/null
- cd ../pysatMissionPlanning
- cd ../pysatMissions

install:
- python setup.py install

before_script:
# set up display screen
- export DISPLAY=:99.0
- if [[ $TRAVIS_PYTHON_VERSION < "3.0" ]]; then
sh -e /etc/init.d/xvfb start;
sleep 3;
fi

script:
- pytest -vs --cov=pysatMissionPlanning/
- pytest -vs --cov=pysatMissions/

after_success:
- coveralls
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,20 @@
All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/).

## [0.2.0] - 2020-03-07
- Renamed as pysatMissions
- Added method files to access aacgmv2, apexpy, pyglow for any pysat instrument
- Added method for spacecraft to handle attitude and coordinates
- Added method for plotting simulated data
- Added support for readthedocs
- Updates to testing environment
- Split pysat_sgp4 into pysat_sgp4 and pysat_ephem to allow different propagators
- Removed basemap
- Added numeric strings as options for sat_id
- Added `_get_times` to streamline time steps for simulated instruments
- Bugs
- Fixed wrong metadata name for mlt in apexpy

## [0.1.1] - 2019-10-22
- pypi compatibility
- Add DOI badge
Expand Down
26 changes: 13 additions & 13 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,29 @@ Contributing
============

Bug reports, feature suggestions and other contributions are greatly
appreciated! pysatMissionPlanning is a community-driven project and welcomes both feedback and contributions.
appreciated! pysatMissions is a community-driven project and welcomes both feedback and contributions.

Short version
=============
-------------

* Submit bug reports and feature requests at `GitHub <https://github.com/pysat/pysatMissionPlanning/issues>`_
* Submit bug reports and feature requests at `GitHub <https://github.com/pysat/pysatMissions/issues>`_
* Make pull requests to the ``develop`` branch

Bug reports
===========
-----------

When `reporting a bug <https://github.com/pysat/pysatMissionPlanning/issues>`_ please
When `reporting a bug <https://github.com/pysat/pysatMissions/issues>`_ please
include:

* Your operating system name and version
* Any details about your local setup that might be helpful in troubleshooting
* Detailed steps to reproduce the bug

Feature requests and feedback
=============================
-----------------------------

The best way to send feedback is to file an issue at
`GitHub <https://github.com/pysat/pysatMissionPlanning/issues>`_.
`GitHub <https://github.com/pysat/pysatMissions/issues>`_.

If you are proposing a feature:

Expand All @@ -34,22 +34,22 @@ If you are proposing a feature:
are welcome :)

Development
===========
-----------

To set up `pysatMissionPlanning` for local development:
To set up `pysatMissions` for local development:

1. `Fork pysat on GitHub <https://github.com/pysat/pysatMissionPlanning/fork>`_.
1. `Fork pysat on GitHub <https://github.com/pysat/pysatMissions/fork>`_.
2. Clone your fork locally::

git clone git@github.com:your_name_here/pysatMissionPlanning.git
git clone git@github.com:your_name_here/pysatMissions.git

3. Create a branch for local development::

git checkout -b name-of-your-bugfix-or-feature

Now you can make your changes locally. Tests for new instruments are
performed automatically. Tests for custom functions should be added to the
appropriately named file in ``pysatMissionPlanning/tests``. For example, the averaging routines in avg.py are tested in ``pysatMissionPlanning/tests/test_avg.py``. If no
appropriately named file in ``pysatMissions/tests``. For example, the averaging routines in avg.py are tested in ``pysatMissions/tests/test_avg.py``. If no
test file exists, then you should create one. This testing uses pytest, which
will run tests on any python file in the test directory that starts with
``test_``.
Expand Down Expand Up @@ -80,7 +80,7 @@ For merging, you should:

1. Include an example for use
2. Add a note to ``CHANGELOG.md`` about the changes
3. Ensure that all checks passed (current checks include Scrutinizer, Travis-CI,
3. Ensure that all checks passed (current checks include Travis-CI
and Coveralls) [1]_

.. [1] If you don't have all the necessary Python versions available locally or
Expand Down
File renamed without changes.
6 changes: 3 additions & 3 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
include *.py
include *.f
include *.c
recursive-include pysatMissionPlanning *.py
recursive-include pysatMissions *.py
include *.md
include description.txt
include LICENSE
include pysatMissionPlanning/version.txt
prune pysatMissionPlanning/tests
include pysatMissions/version.txt
prune pysatMissions/tests
prune docs
prune demo
exclude *.pdf
Expand Down
65 changes: 52 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,22 @@
<img width="20%" src="/poweredbypysat.png" alt="pysat" title="pysat"</img>
</div>

# pysatMissionPlanning
[![Build Status](https://travis-ci.org/pysat/pysatMissionPlanning.svg?branch=master)](https://travis-ci.org/pysat/pysatMissionPlanning)
[![Coverage Status](https://coveralls.io/repos/github/pysat/pysatMissionPlanning/badge.svg?branch=master)](https://coveralls.io/github/pysat/pysatMissionPlanning?branch=master)
# pysatMissions
[![Documentation Status](https://readthedocs.org/projects/pysatMissions/badge/?version=latest)](http://pysatMissions.readthedocs.io/en/latest/?badge=latest)
[![DOI](https://zenodo.org/badge/209358908.svg)](https://zenodo.org/badge/latestdoi/209358908)

pysatMissionPlanning allows users to run build simulated satellites for TLE info and add empirical data. It includes the pysat_sgp4 instrument module which can be imported into pysat.
[![Build Status](https://travis-ci.org/pysat/pysatMissions.svg?branch=master)](https://travis-ci.org/pysat/pysatMissions)
[![Coverage Status](https://coveralls.io/repos/github/pysat/pysatMissions/badge.svg?branch=master)](https://coveralls.io/github/pysat/pysatMissions?branch=master)
[![Maintainability](https://api.codeclimate.com/v1/badges/83011911691b9d2076e9/maintainability)](https://codeclimate.com/github/pysat/pysatMissions/maintainability)

pysatMissions allows users to run build simulated satellites for Two-Line Elements (TLE) and add empirical data. It includes the pysat_ephem and pysat_sgp4 instrument modules which can be imported into pysat.

Main Features
-------------
- Simulate satellite orbits from TLEs and add data from empirical models
- Import ionosphere and thermosphere values through pyglow
- Import coordidnates through apexpy
- Import ionosphere and thermosphere model values through pyglow
- Import magnetic coordinates through apexpy and aacgmv2
- Import geomagnetic basis vectors through pysatMagVect

Documentation
---------------------
Expand All @@ -23,27 +27,62 @@ Documentation

# Installation

First, checkout the repository:
One way to install is through pip. Just type

```
pip install pysatMissions
```
into the terminal.

Or, if you prefer to work directly from github, checkout the repository:

```
git clone https://github.com/pysat/pysatMissionPlanning.git
git clone https://github.com/pysat/pysatMissions.git
```

Change directories into the repository folder and run the setup.py file. For
a local install use the "--user" flag after "install".

```
cd pysatMissionPlanning/
python setup.py install
cd pysatMissions/
python setup.py install
```

Note: pre-1.0.0 version
------------------
pysatMissions is currently in an initial development phase. Much of the API is being built off of the upcoming pysat 3.0.0 software in order to streamline the usage and test coverage. This version of pysat is planned for release later this year. Currently, you can access the develop version of this through github:
```
git clone https://github.com/pysat/pysat.git
cd pysat
git checkout develop-3
python setup.py install
```
It should be noted that this is a working branch and is subject to change.

A note on empirical models
--------------------------
pysatMissions allows users to interact with a number of upper atmospheric empirical models through the [pyglow](https://github.com/timduly4/pyglow) package. However, pyglow currently requires manual install through git. While pysatMissions can be installed and used without pyglow, it should be installed by the user to access the pyglow methods. Please follow the install instructions at https://github.com/timduly4/pyglow.

# Using with pysat

The module is portable and designed to be run like any pysat instrument.
The instrument modules are portable and designed to be run like any pysat instrument.

```
import pysat
from pysatMissions.instruments import pysat_ephem
simInst = pysat.Instrument(inst_module=pysat_ephem)
```

The methods that run empirical models can also be exported to any pysat instrument. For instance, to add thermal plasma predictions from the IRI model to the C/NOFS IVM instrument, one can invoke

```
import pysat
from pysatMissionPlanning.instruments import pysat_sgp4
from pysatMissions.methods import empirical
sgp4 = pysat.Instrument(inst_module=pysat_sgp4)
ivm = pysat.Instrument(platform='cnofs', name='ivm')
ivm.custom.attach(empirical.add_iri_thermal_plasma, 'modify',
glat_label='glat',
glong_label='glon', alt_label='altitude')
```
Once the custom function is added, the model will automatically be run when the dataset is loaded.
4 changes: 2 additions & 2 deletions description.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
pysatMissionPlanning allows users to run build simulated satellites for TLE info and add empirical data. It includes the pysat_sgp4 instrument module which can be imported into pysat.
pysatMissions allows users to run build simulated satellites for TLE info and add empirical data. It includes the pysat_sgp4 instrument module which can be imported into pysat.

Main Features
-------------
- Simulate satellite orbits from TLEs and add data from empirical models
- Import ionosphere and thermosphere values through pyglow
- Import coordidnates through apexpy
- Import coordinates through apexpy

Documentation
---------------------
Expand Down

0 comments on commit 3b2ca51

Please sign in to comment.