Skip to content

Commit

Permalink
Merge pull request #39 from rstoneback/develop
Browse files Browse the repository at this point in the history
Name Update
  • Loading branch information
rstoneback authored Mar 6, 2020
2 parents 561d965 + bdd4905 commit b873309
Show file tree
Hide file tree
Showing 19 changed files with 378 additions and 349 deletions.
17 changes: 10 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,30 +16,33 @@ before_install:
- 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 'xarray<0.15'
# Install version specific packages for 2.7 and 3.5
- pip install matplotlib
- pip install apexpy
- pip install numpy
- pip install pysatCDF >/dev/null
- cd ..
- git clone https://github.com/pysat/pysat.git >/dev/null
- cd ./pysat
- cd ./pysat # set up data directory
- git checkout develop
- git pull origin develop
- python setup.py install >/dev/null
- cd ..
# set up data directory

# set up data directory
- mkdir /home/travis/build/pysatData
- python -c 'import pysat; pysat.utils.set_data_dir("/home/travis/build/pysatData")'

install:
# install pysatMagVect
- cd ./pysatMagVect
# install OMMBV
- cd ./OMMBV
- python setup.py develop

# command to run tests
script:
- nosetests -vs --with-coverage --cover-package=pysatMagVect
- nosetests -vs --with-coverage --cover-package=OMMBV

after_success:
- coveralls
4 changes: 2 additions & 2 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
include pysatMagVect/version.txt
include OMMBV/version.txt
include LICENSE
include CONTRIBUTING.md
prune pysatMagVect/tests
prune OMMBV/tests
8 changes: 4 additions & 4 deletions pysatMagVect/__init__.py → OMMBV/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@
on_rtd = os.environ.get('ONREADTHEDOCS') == 'True'

if not on_rtd:
from pysatMagVect import igrf
from OMMBV import igrf
else:
igrf = None

from pysatMagVect import _core
from pysatMagVect._core import *
from pysatMagVect import satellite
from OMMBV import _core
from OMMBV._core import *
from OMMBV import satellite

__all__ = []
File renamed without changes.
6 changes: 3 additions & 3 deletions pysatMagVect/_core.py → OMMBV/_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
import datetime
import pysat
# import reference IGRF fortran code within the package
from pysatMagVect import igrf as igrf
import pysatMagVect.fortran_coords
from OMMBV import igrf as igrf
import OMMBV.fortran_coords

# parameters used to define Earth ellipsoid
# WGS84 parameters below
Expand Down Expand Up @@ -111,7 +111,7 @@ def geodetic_to_ecef(latitude, longitude, altitude):
return x, y, z


ecef_to_geodetic = pysatMagVect.fortran_coords.ecef_to_geodetic
ecef_to_geodetic = OMMBV.fortran_coords.ecef_to_geodetic


def python_ecef_to_geodetic(x, y, z, method=None):
Expand Down
File renamed without changes.
29 changes: 15 additions & 14 deletions pysatMagVect/satellite.py → OMMBV/satellite.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import pysatMagVect as pymv
import OMMBV as OMMBV


def add_mag_drift_unit_vectors_ecef(inst, **kwargs):
def add_mag_drift_unit_vectors_ecef(inst, lat_label='latitude', long_label='longitude',
alt_label='altitude', **kwargs):
"""Adds unit vectors expressing the ion drift coordinate system
organized by the geomagnetic field. Unit vectors are expressed
in ECEF coordinates.
Expand All @@ -10,8 +11,6 @@ def add_mag_drift_unit_vectors_ecef(inst, **kwargs):
----------
inst : pysat.Instrument
Instrument object that will get unit vectors
max_steps : int
Maximum number of steps allowed for field line tracing
**kwargs
Passed along to calculate_mag_drift_unit_vectors_ecef
Expand All @@ -27,11 +26,11 @@ def add_mag_drift_unit_vectors_ecef(inst, **kwargs):
"""

# add unit vectors for magnetic drifts in ecef coordinates
zvx, zvy, zvz, bx, by, bz, mx, my, mz = pymv.calculate_mag_drift_unit_vectors_ecef(inst['latitude'],
inst['longitude'],
inst['altitude'],
inst.data.index,
**kwargs)
zvx, zvy, zvz, bx, by, bz, mx, my, mz = OMMBV.calculate_mag_drift_unit_vectors_ecef(inst[lat_label],
inst[long_label],
inst[alt_label],
inst.index,
**kwargs)

inst['unit_zon_ecef_x'] = zvx
inst['unit_zon_ecef_y'] = zvy
Expand Down Expand Up @@ -168,7 +167,8 @@ def add_mag_drift_unit_vectors_ecef(inst, **kwargs):
return


def add_mag_drift_unit_vectors(inst, **kwargs):
def add_mag_drift_unit_vectors(inst, lat_label='latitude', long_label='longitude',
alt_label='altitude', **kwargs):
"""Add unit vectors expressing the ion drift coordinate system
organized by the geomagnetic field. Unit vectors are expressed
in S/C coordinates.
Expand Down Expand Up @@ -198,19 +198,20 @@ def add_mag_drift_unit_vectors(inst, **kwargs):
"""

# vectors are returned in geo/ecef coordinate system
add_mag_drift_unit_vectors_ecef(inst, **kwargs)
add_mag_drift_unit_vectors_ecef(inst, lat_label=lat_label, long_label=long_label,
alt_label=alt_label,**kwargs)
# convert them to S/C using transformation supplied by OA
inst['unit_zon_x'], inst['unit_zon_y'], inst['unit_zon_z'] = pymv.project_ecef_vector_onto_basis(
inst['unit_zon_x'], inst['unit_zon_y'], inst['unit_zon_z'] = OMMBV.project_ecef_vector_onto_basis(
inst['unit_zon_ecef_x'], inst['unit_zon_ecef_y'], inst['unit_zon_ecef_z'],
inst['sc_xhat_x'], inst['sc_xhat_y'], inst['sc_xhat_z'],
inst['sc_yhat_x'], inst['sc_yhat_y'], inst['sc_yhat_z'],
inst['sc_zhat_x'], inst['sc_zhat_y'], inst['sc_zhat_z'])
inst['unit_fa_x'], inst['unit_fa_y'], inst['unit_fa_z'] = pymv.project_ecef_vector_onto_basis(
inst['unit_fa_x'], inst['unit_fa_y'], inst['unit_fa_z'] = OMMBV.project_ecef_vector_onto_basis(
inst['unit_fa_ecef_x'], inst['unit_fa_ecef_y'], inst['unit_fa_ecef_z'],
inst['sc_xhat_x'], inst['sc_xhat_y'], inst['sc_xhat_z'],
inst['sc_yhat_x'], inst['sc_yhat_y'], inst['sc_yhat_z'],
inst['sc_zhat_x'], inst['sc_zhat_y'], inst['sc_zhat_z'])
inst['unit_mer_x'], inst['unit_mer_y'], inst['unit_mer_z'] = pymv.project_ecef_vector_onto_basis(
inst['unit_mer_x'], inst['unit_mer_y'], inst['unit_mer_z'] = OMMBV.project_ecef_vector_onto_basis(
inst['unit_mer_ecef_x'], inst['unit_mer_ecef_y'], inst['unit_mer_ecef_z'],
inst['sc_xhat_x'], inst['sc_xhat_y'], inst['sc_xhat_z'],
inst['sc_yhat_x'], inst['sc_yhat_y'], inst['sc_yhat_z'],
Expand Down
File renamed without changes.
Loading

0 comments on commit b873309

Please sign in to comment.