This is a Python package which will allow you to convert the output of MONAMI (https://github.com/komabi/MONAMI-Mapping-Of-Non-potentiAl-Magnetic-fIeld)
- v1.1: Add support for the NLFFF extrapolation result (2019.12).
- 2019.12: NDCube currently does not support ctyes of 'crln-cea', 'crlt-cea' and 'hprz'. Warning messages will be shown when using some functions of the NDCube. I am now contacting the NDCube team to fix this (sunpy/ndcube#226).
MONAMI2NDCube can be run on Windows, Mac OSX or Linux systems with Python 3 and the following dependencies installed.
Python 3 with libraries including numpy, scipy, matplotlib, astropy, sunpy, datetime, ndcube
Python management softwares including Anaconda or Virtualenv are recommended
MONAMI2NDCube requires a standard computer with enough CPU and computation power depending on the dataset used.
MONAMI2NDCube is a stand-alone Python package, no installation is needed.
monami2ndcube.py: Main programm of converting the output of MONAMI into NDCube
pfe.py: Python code for potential field extrapolation, see https://github.com/gyengen/Magnetic-Field-Extrapolation
example.py: example
example.fits.gz: SDO/HMI line-of-sight magnetic field observation on 2011-02-11 00:00:26.90 UT
example.sav: Output of MONAMI on the observation example.fits.gz
Suppose you have a magnetic field observation (either from SDO/HMI or SOHO/MDI).
- process the data with MONAMI to get the potential/NLFFF magnetic field extrapolation done and feature parameters extracted. Please see the detailed manual of MONAMI to perform the analysis. Result will be saved in the folder PF/FITS.
- Git clone thes MONAMI2NDCube package, extract it.
- Copy your observational fits file and result generated by MONAMI into the extracted folder from step 2.
- Run
Python
in your terminal. - Run command
bxcube, bycube, bzcube = generate_ndcube(obs, pf)
, where obs and pf are the initial observation fits file and MONAMI generated file, respectively. - See example.py for more information and functions to use these NDCubes.
- Alternatively, if you don't have the output from MONAMI, you can run
bxcube, bycube, bzcube = generate_ndcube(obs)
instead. Then, the code will calculate the potential magnetic field extrapoaltion first before generating these NDCubes.
A demo example.py is available:
- To run the demo, run
python example.py
There are 4 very useful functions in monami2ndcube.py:
- read_data: reads IDL sav file which stores the potential/NLFFF field extrapolation generated by MONAMI.
- construct_wcs: constructs the wcs coordinate for the NDCubes.
- get_roi: get the region of interested for performing the potential field extrapolation.
- generate_ndcube: main program for generating the NDCubes.
More information including the input parameters, returns and usage of the above functions can be found in there corresponding comments in the file monami2ndcube.py.