Giter VIP home page Giter VIP logo

igrf12's Introduction

Build Status Coverage Status Build status Python versions (PyPI) Distribution format (PyPI) PyPi Download stats

IGRF 2012 in Python

International Geomagnetic Reference Field IGRF12 and IGRF11...in simple, object-oriented Python ≥ 3.6 or Matlab ≥ R2014b.

image

image

Install

A Fortran compiler is required, such as gfortran:

To get the IGRF12 development version, git clone and then:

python -m pip install -e .

Otherwise, for the latest release from PyPi:

python -m pip install igrf12

Optionally, test the install with:

pytest

Windows

If you get ImportError on Windows for the Fortran module, try from the iri2016 directory:

del *.pyd
python setup.py build_ext --inplace --compiler=mingw32

Example

To make the plots in this readme:

igrf12

using as a Python module at geodetic coordinates 65N, 148W:

import igrf12

mag = igrf12.igrf('2010-07-12', glat=65, glon=-148, alt_km=100)

returns an xarray.Dataset:

<xarray.Dataset>
Dimensions:  (alt_km: 1)
Coordinates:
  * alt_km   (alt_km) int64 100
Data variables:
    north    (alt_km) float64 1.122e+04
    east     (alt_km) float64 4.148e+03
    down     (alt_km) float64 5.302e+04
    total    (alt_km) float64 5.436e+04
    incl     (alt_km) float64 77.29
    decl     (alt_km) float64 20.29

The IGRF model may be specified with the igrf12.igrf(model=) option:

  • 11: IGRF11
  • 12: IGRF12

Matlab

Matlab ≥ R2014b can seamlessly call Python modules, as in igrf12.m. Instead of the $1000 Aerospace Toolbox, use this free IGRF12 for Matlab.

Reference

If you only want the plain Fortran program, you can do:

cd bin

cmake ../src
cmake --build .

./testigrf

References

igrf12's People

Contributors

scivision avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.