Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
.ipynb_checkpoints/
*.egg-info/
*.pyf
*~
*.o
*.pyc
*.so
build/
build/
30 changes: 0 additions & 30 deletions README.md

This file was deleted.

28 changes: 28 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
===================================
Tsyganenko Geomagnetic Field Model
===================================


Fortran files and their scientific content have been developed by N.A. Tsyganenko and colleagues.

Installation
============
sudo is NOT needed or desired::

cd fortran
make
make install
python setup.py develop

Use
====
To use this module, simply follow the example provided in the tsygTrace object docstring, or try::

python demo.py

You can also use Jupyter notbook to visualize a more detailed example::

jupyter notebook

If you run the above command from this repository you should see a notebook called
'Tsyganenko - Python examples'.
489 changes: 264 additions & 225 deletions Tsyganenko - Python examples.ipynb

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions demo.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env python

import tsyganenko
Tsyg = tsyganenko.tsygTrace(65.,-148.,6371.) # earth surface near Fairbanks, AK
19 changes: 19 additions & 0 deletions fortran/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
MODULE=tsygFort
SOURCES=geopack08.for T96.f T02.f

all: $(SOURCES) $(MODULE)



# $(FC) -w -O2 -fbacktrace -fno-automatic -fPIC -c geopack08.for T96.f T02.f

$(MODULE): $(SOURCES)
f2py --overwrite-signature $^ -m $@ -h geopack08.pyf
f2py --quiet --f77flags="-std=legacy" -c geopack08.pyf $^

install:
mv $(MODULE)*.so ..

clean:
$(RM) *.o *.so
#"*.pyf"
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 4 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
setuptools
nose
numpy
matplotlib
20 changes: 14 additions & 6 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,21 @@
#!/usr/bin/env python
from numpy.distutils.core import setup, Extension
import setuptools #needed to enable develop
try:
import conda.cli
conda.cli.main('install','--file','requirements.txt')
except Exception as e:
print(e)

from numpy.distutils.core import setup,Extension

ext = Extension('tsyganenko.tsygFort',
sources=['tsyganenko/geopack08.pyf','tsyganenko/geopack08.for','tsyganenko/T96.f','tsyganenko/T02.f'])
sources=['fortran/'+f for f in ('geopack08.for','T96.f','T02.f')],
f2py_options=['--quiet'])

setup (name = "Tsyganenko",
version = "0.1",
description = "wrapper to call fortran routines from the Tsyganenko models",
author = "Sebastien de Larquier",
version = "0.1.1",
description = "wrapper for the Tsyganenko geomagnetic models",
author = "Sebastien de Larquier, Michael Hirsch",
author_email = "sdelarquier@vt.edu",
url = "",
long_description =
Expand All @@ -16,7 +24,7 @@
http://ccmc.gsfc.nasa.gov/models/modelinfo.php?model=Tsyganenko%20Model
""",
packages = ['tsyganenko'],
ext_modules = [ext],
# ext_modules = [ext],
keywords=['Scientific/Space'],
classifiers=[
"Programming Language :: Python/Fortran"
Expand Down
12 changes: 0 additions & 12 deletions tsyganenko/Makefile

This file was deleted.

Loading