Skip to content

JamieJQuinn/coronal-fluting-instability-analysis

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Flute and kink instabilities in a dynamically twisted flux tube with anisotropic plasma viscosity: Analysis code

This repository contains the analysis scripts used in the production of the paper "Flute and kink instabilities in a dynamically twisted flux tube with anisotropic plasma viscosity". Most of the data analysed by the included scripts are generated by the 3D magnetohydrodynamics code Lare3d. Due to the size of the data it is not stored, however it can be easily (though perhaps not quickly) reproduced using the parameters and specific code versions specified in the appendix of the thesis. The remainder of this README describes the folder layout, how to reproduce the simulation data and how to run the analysis.

Folder Layout

This material is adapted from my thesis hence why there is a shared folder. This contains:

  • energy.py - functions for manipulating and plotting the continuous energy outputs from lare3d stored in en.dat files
  • fan_plane_integrator.py - functions for integrating around the fan plane in chapter 6 (null_point_khi)
  • field_line_integrator.py - functions for integrating along field lines in chapters 5 and 6
  • parameters.py - holds relevant physical parameters used in the simulations
  • plotting.py - functions for plotting
  • sdf_helper.py - functions for manipulating SDF files

The kink_instability_from_straight folder contains analysis scripts specific to this paper:

  • exploratory_data_analysis.Rmd - exploratory analysis
  • main.Rmd - production of all figures
  • sdf_file_subsampler.Rmd - notebook used to extract and save parts of the SDF files for more efficient analysis
  • plotting_parameters.py - settings relevant for plotting
  • field_line_plots - scripts used to plot field lines using VisIt

Analysis

Requirements

Required

  • MPI (for the SDF library)

Optional

  • VisIt (for field line plotting)

Setup

These steps set up the SDF library and python requirements and link the SDF python bindings

Ensure SDF submodule and all its submodules are set up:

[in /]
git submodule update --init --recursive

Make SDF's C interface:

[in SDF/C]
make

Install virtual environment and python requirements via pipenv:

[in /]
pipenv install

Make and link SDF's python interface inside pipenv environment:

[in /]
pipenv shell
cd SDF/utilities
./build -3 -s

Running an analysis

Run notebook:

[in /kink_instability_from_straight]
pipenv run jupyter <notebook>

Plotting field lines

The field lines are not plotted in jupyter notebooks. These are, instead, plotted using the package VisIt. The plotting scripts can be found in the field_line_plots folder. A field line plot is produced by specifying the input SDF files in the fill_filelist.sh script and calling make. This runs VisIt with the plotting script plot.py. This script is mostly constructed from the output from VisIt's Macro feature which records the user's actions in the GUI and represents them programatically. Saving this output in plot.py allows quick reproduction of a figure.

Reproduction of simulation data

The code which implements only the anisotropic viscosity module can be found in its github repository in the feature/anisotropic_viscosity branch and it should be a simple process to merge the changes into another version of Lare3d for future research. The specific boundary conditions, basic parameters and initial conditions can be found in the branch run/kink-from-straight-field. The specific parameters used in each individual simulation can be found in the methods sections of the corresponding paper.

About

Analysis scripts for the paper in coronal-fluting-instability-paper

Resources

Stars

0 stars

Watchers

1 watching

Forks

Packages

 
 
 

Contributors