Inversion Codes

During the two weeks of the school we will present three different spectral line inversion codes that allow users to tackle and interpret different kinds of spectropolarimetric observations. Additionally, we will work with the non-LTE radiative synthesis code RH. Here, you will find pointers to the source codes and instructions to download them and install them prior to the school.

SIR

The Stokes Inversion based on Response functions (Ruiz Cobo & Del Toro Iniesta, 1992) is a general-purpose spectral line inversion code that works in the Local Thermodynamical Equilibrium (LTE) regime, which dictates that the populations of the energy levels of the atoms depend only on local values of temperature and density. The polarization in spectral lines is induced by the Zeeman effect. SIR is able to infer the height stratification of the thermodynamical and magnetic properties of the solar atmosphere, and admits one or two atmospheric components. Below, you can find a Dropbox link to download the source code. Videos with installation instructions for SIR, DeSIRe and RH can be found under the INSTALLATION subsection bellow.

  • Download SIR (Download the tar.gz file for the latest version of the SIR distribution)

DESIRE

The Departure coefficient aided Stokes Inversion based on Response functions (Ruiz Cobo et al., 2022.) is a non-LTE spectral line inversion code that integrates the inversion code SIR with the forward modeling non-LTE radiative transfer solver RH. It used analytical response functions computed in LTE, modified with fixed departure coefficients to account for non-LTE effects of chromopsheric spectral lines.

  • Download DeSIRe (Download the most recent (20220404) tar file for the latest version of the DeSIRe distribution)

SIR and DeSIRe tutorial scripts

This is the Dropbox link to the different exercise scripts that will be used during the hands-on sessions.

RH

The Rybicki & Hummer code (Uitenbroek, 2001) is numerical radiative transfer code for multi-level atoms and molecules under general non-LTE conditions. The RH distribution can be found on GitHub (link below) and can be installed following the instructions in the installation manual. Alternatively, follow Carlos Quintero's video tutorial linked under the INSTALLATION subsection below.

INSTALLATION

Here are some helpful videos walking through the installation of GCC as well as the SIR, DeSIRe and RH codes:

In part #1 you will find instructions on how to install GCC on MacOS with Apple Silicon CPUs. In part #2 Carlos Quintero describes the installation of SIR, DeSIRe and RH on MacOS with the Apple Silicon CPU architecture. This tutorial is also valid for any Unix-based machine.

HAZEL

HAnle and ZEeman Light (Asensio Ramos et al., 2008) is a computer program for the synthesis and inversion of Stokes profiles caused by the joint action of atomic level polarization and the Hanle and Zeeman effects in some spectral lines of diagnostic interest, such as those of the He I 1083.0 nm and 587.6 nm (or D3) multiplets. It is based on the quantum theory of spectral line polarization, which takes into account in a rigorous way all the relevant physical mechanisms and ingredients (optical pumping, atomic level polarization, level crossings and repulsions, Zeeman, Paschen-Back and Hanle effects). The influence of radiative transfer on the emergent spectral line radiation is taken into account through a suitable slab model. For the purpose of this school, participants will use version 2.0 of the HAZEL code. The code is available to download here and detailed documentation can be found here.

HAZEL TUTORIAL EXERCISES AND DATA

You will be able to download the exercises for the HAZEL tutorial from Ivan's Github, as well as the data that we will be working with.

MAGNETIC FIELD DISAMBIGUATION

Here is a link to download the ME disambiguation code that Graham is going to show on Friday. You will need to install the Intel Fortran compiler (ifort) and then:

  • Extract all the files from the tarball (tar -xvzf ambig.tgz).
  • Load the Intel compiler (ml intel).
  • Compile the code (make), which should create an executable ambig.
  • Run a default example (./ambig), which should create a file azimuth.dat.

From Graham:

The parenthetical commands should work on Linux machines, but I can't guarantee syntax on anything else.
The first thing that's likely to break compiling is the location of the cfitsio library, used for reading FITS files. In the make file, it is given as /usr/include/cfitsio, but that's probably going to be wrong for many people, so the students will need to edit makefile to specify the correct location. If that's causing problems, I can fairly easily create a version that does not allow for FITS i/o, but if we can get it working, that would be nice. It may also be necessary to explicitly specify MKLROOT, which is the location of the MKL libraries.