GithubHelp home page GithubHelp logo

zanderzhao / msise00 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from space-physics/msise00

0.0 1.0 0.0 7.85 MB

NRL MSISE-00 atmospheric model-- in Python and Matlab

Home Page: https://ccmc.gsfc.nasa.gov/pub/modelweb/atmospheric/msis/

License: MIT License

Python 6.40% MATLAB 2.82% M 0.02% Fortran 90.34% Makefile 0.17% CMake 0.25%

msise00's Introduction

MSISE-00 in Python and Matlab

Zenodo DOI Language grade: Python Actions Status Build Status Python versions (PyPI) PyPi Download stats

NRL MSISE-00 atmospheric model for Python. Also accessible via Matlab. Valid from altitude z = 0..1000 km.

The plot immediately below shows a slice at 200km on a world-wide grid. The yellow ball represents the sun footprint on Earth.

MSIS global time animation

This plot is from Matlab calling MSISE00:

MSISE00 Matlab

Units

  • Temperature: degrees Kelvin [K]
  • Density: particles per cubic meter [m^-3]
  • Mass density: kilograms per cubic meter [kg m^-3]

Install

This process is used for the Python and Matlab access to MSIS. Any Fortran compiler should work. Fortran compiler may be installed by

  • MacOS / Homebrew: brew install gcc
  • Linux: apt install gfortran
  • Windows

Get MSISE00 and install Python package:

pip install msise00

or for the latest development code

git clone https://github.com/space-physics/msise00

pip install -e msise00

optionally check that MSIS is working via:

pytest msise00

This Python module uses our build-on-run technique. The first time you use this Python module, you will see messages from the Meson build system.

Examples

MSISE00 can be used from the command line, as an imported module, and even from Matlab.

import module

import msise00
from datetime import datetime

atmos = msise00.run(time=datetime(2013, 3, 31, 12), altkm=150., glat=65., glon=-148.)

atmos is an xarray.Dataset containing all the simulation output values. atmos is 4-D: (time, altitude, lat, lon), and indexed like atmos['N2']

Command Line

Write NetCDF4 output (HDF5 compatible) with command line argument -w filename.nc.

Simple examples under Examples/

  • Altitude Profile at a single time:

    msise00 -t 2017-08-21T20:48 -c 40 -90
  • Alt. profile time-range with hourly time step:

    msise00 -t 2017-08-21 2017-08-22 -c 40 -90
  • Grid: time,lat,lon: generates the plots in the README:

    msise00 -t 2016-09-20 2016-09-21
  • single time lat/lon can be plotted:

    msise00 -t 2017-01-02T12

Matlab

Matlab use of MSISE00 is demonstrated in Examples

MSISE00 will automatically compile "build on run" on first run from Matlab as with Python.

Optionally, verify Matlab is working by from the top msise00/ directory in Terminal

matlab -batch msise00.test_mod

Fortran

Those wishing to use MSIS from a plain Fortran program can do from the top-level msise00/ directory:

cmake -B build
cmake --build build

optionally:

ctest --test-dir build

Reference

  • Original fortran code
  • 1200+ citations 2002 paper

msise00's People

Contributors

scivision avatar zanderzhao avatar danielk333 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.