Level 2 (Inverted SOT-SP Data)
SOT-SP Level 2 data are the output of a spectral-line inversion scheme. The Milne-Eddington gRid Linear Inversion Network (MERLIN) is a Milne-Eddington inversion code that is based on the least-squares fitting of the observed Stokes profiles using the Levenberg-Marquardt algorithm. MERLIN can use one or multiple spectral lines to retrieve the magnetic field vector, the line-of-sight velocity, the source function, the Doppler broadening as well as the contribution of macroturbulence and the stray-light factor. The MERLIN source code is publicly available from the Community Spectro-polarimetric Analysis Center (CSAC) at HAO. Some additional information on compiling and running MERLIN can be found in the section below.
Each Level 2 dataset is stored in a FITS file containing 42 extensions, one per inversion parameter or ancillary data product:
Extension | Quantity |
---|---|
1 | Magnetic field strength |
2 | Magnetic field inclination angle, in [0°, 180°] |
3 | Magnetic field azimuth angle, in [0°, 180°] |
4 | Doppler shift of 6301.5 Å line |
5 | Doppler shift of 6302.5 Å line |
6 | Doppler width |
7 | Line strength |
8 | Damping parameter |
9 | Source function |
10 | Source function gradient |
11 | Macroturbulence |
12 | Stray light fraction |
13 | Stray light shift |
14 | Magnetic field strength error |
15 | Magnetic field inclination error |
16 | Magnetic field azimuth error |
17 | Doppler shift error of 6301.5 Å line |
18 | Doppler shift error of 6302.5 Å line |
19 | Doppler width error |
20 | Line strength error |
21 | Damping parameter error |
22 | Source function error |
23 | Source function gradient error |
24 | Macroturbulence error |
25 | Stray light fraction error |
26 | Stray light shift error |
27 | \( \chi^2 \) for Stokes \( I \) |
28 | \( \chi^2 \) for Stokes \( Q \) |
29 | \( \chi^2 \) for Stokes \( U \) |
30 | \( \chi^2 \) for Stokes \( V \) |
31 | Total \( \chi^2 \) |
32 | Continuum intensity |
33 | Original continuum intensity |
34 | Polarization degree |
35 | Magnitude of Stokes \( V \) |
36 | Final status of inversion |
37 | Number of iterations |
38 | \( x \) coordinate (at each slit position) |
39 | \( y \) coordinate (at each slit position) |
40 | Observation time (at each slit position) |
41 | Mechanical slit position |
42 | Scattered light profile |
Compiling and Running MERLIN
As mentioned above, the MERLIN source code is publicly available from the Community Spectro-polarimetric Analysis Center (CSAC) at HAO, and is distributed under GPLv3.
After downloading, uncompressing, and expanding and the archive file, you
should have a directory structure as follows, according to the INSTALL
file:
merlin |--> client |--> lib | |--> fico | |--> tinyxml | |--> initialization |--> m4 |--> helpers
The INSTALL
file indicates that MERLIN also requires the following libraries
to be compiled and installed:
- FFTW version 3+ (available at http://www.fftw.org)
- CFITSIO version 3+ (available at https://heasarc.gsfc.nasa.gov/fitsio)
- NetCDF version 4+ (available at https://www.unidata.ucar.edu/software/netcdf)
As mentioned in the INSTALL
file, there is a configure
script that will
set up the compilation environment. One may need to set the CPPFLAGS
and
LDFLAGS
environment variables to point to directories containing the include
directories and library directories.
Once the configure
script exits without any errors, the user can run
make
. If the compilation process successfully completes, a merlin
executable will appear in the client
directory. Running merlin
without any
arguments should show the help output:
MERLIN: -h -v -x [XML_INPUT_FILE_NAME] -d [DEBUG LEVEL] -p where -d [DEBUG LEVEL]: set program to debug mode. This flag is optional.Debug level can be 1 or .2 -x [XML_INPUT_FILE_NAME]: provides the name of an XML file with the instructions about the inversion. -v: show program version in standard output and exits. This flag is optional. -p: Dump both, the observed and the fitted profiles. This flag is optional. -h: writes this help and exits. Consult the manual for complete documentation.
If there is an error regarding dynanmically linked libraries, then one may
need to set the LD_LIBRARY_PATH
environment variable.
To use MERLIN to perform an inversion, one needs an input XML file and a corresponding FITS file
containing the input spectrum. In this SOT-SP-specific example, we can use as input the first spectrum
in a scan from June 5, 2015, SP3D20150605_122327.9C.fits
, which can be downloaded from this
link. The
corresponding XML file, SP3D20150605_122327.9C.fits.xml
, may be downloaded from this
link. After
updating the directories specified by the <INPUT>
and <OUTPUT>
keywords in
the XML file, the inversion can be performed by specifying the name of the XML file via
the -x
switch:
merlin -x SP3D20150605_122327.9C.fits.xml
After a short wait, an output NetCDF file named
SP3D20150605_122327.9C.fits.nc
should appear.