PyDL / MONAMI-to-NDCube

Python codes which will allow you to convert the output of MONAMI into NDCubes

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

MONAMI-to-NDCube

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)

Change Log

  • v1.1: Add support for the NLFFF extrapolation result (2019.12).

Note:

  • 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).

System Requirements

OS Requirements

MONAMI2NDCube can be run on Windows, Mac OSX or Linux systems with Python 3 and the following dependencies installed.

Dependencies:

Python 3 with libraries including numpy, scipy, matplotlib, astropy, sunpy, datetime, ndcube
Python management softwares including Anaconda or Virtualenv are recommended

Hardware Requirements:

MONAMI2NDCube requires a standard computer with enough CPU and computation power depending on the dataset used.

Installation Guide:

MONAMI2NDCube is a stand-alone Python package, no installation is needed.

Description of Files (More information can be found in each file):

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

Instructions for Use:

Suppose you have a magnetic field observation (either from SDO/HMI or SOHO/MDI).

  1. 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.
  2. Git clone thes MONAMI2NDCube package, extract it.
  3. Copy your observational fits file and result generated by MONAMI into the extracted folder from step 2.
  4. Run Python in your terminal.
  5. Run command bxcube, bycube, bzcube = generate_ndcube(obs, pf), where obs and pf are the initial observation fits file and MONAMI generated file, respectively.
  6. See example.py for more information and functions to use these NDCubes.
  7. 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.

Demo

A demo example.py is available:

  1. To run the demo, run python example.py

Structure of monami2ndcube.py

There are 4 very useful functions in monami2ndcube.py:

  1. read_data: reads IDL sav file which stores the potential/NLFFF field extrapolation generated by MONAMI.
  2. construct_wcs: constructs the wcs coordinate for the NDCubes.
  3. get_roi: get the region of interested for performing the potential field extrapolation.
  4. 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.

About

Python codes which will allow you to convert the output of MONAMI into NDCubes

License:GNU General Public License v3.0


Languages

Language:Python 100.0%