Table Of Content7
1
0
MOSiC
2
n
a an analysis tool for IRIS spectral data
J
6
1
]
M
R.Rezaei
I
. InstitutodeAstrof´ısicadeCanarias (IAC), V´ıaLacte´a, 38200LaLaguna(Tenerife), Spain
h
p
- [email protected], and [email protected]
o
r
t MOSiCwebpage
s
a
[
1 January 18, 2017
v
1
2
4
4
0
.
1
0
7
1
:
v
i
X
r
a
Contents
Introduction
1 2
1.1 Preface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1.2 WhatisMOSiC? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.3 Thetarfile . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.4 Quickoverview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.4.1 Correctionfortheorbitalvelocity . . . . . . . . . . . . . . . . . . . . . 4
1.4.2 CommentsontheGaussianfits: . . . . . . . . . . . . . . . . . . . . . . 4
1.5 Off-limbobservations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
Preparations
2 6
2.1 Converting level2datatolevel3 . . . . . . . . . . . . . . . . . . . . . . . . . . 6
2.2 Timeseries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
2.3 FITSmanipulation usingPython . . . . . . . . . . . . . . . . . . . . . . . . . . 7
2.4 Reorderthedatacube . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
The main program
3 9
3.1 280nmcontinuum : /do cont . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
3.2 TheOi135.6nm: /do o1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
3.3 TheMgiihandk: /do mg,/do h,/do gauss . . . . . . . . . . . . . . . . . . . . 11
3.4 TheSiiv140.277nm: /do si . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
3.5 TheCii133.5nm: /do cii . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
3.6 TheCli135.17nm: /do cl . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
3.7 IRIScoronal lines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
3.8 Evaluatingtheresults . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
3.9 Flaringregions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
3.10 Contact . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
1
Chapter 1
Introduction
1.1 Preface
Thesolarchromosphere isastructured layerontopofthephotosphere. Itisoptically thininUV,
visible, and near-IR continua, but optically thick in strong spectral lines (Carlsson&Stein 1997;
Judge&Peter 1998). Although the Caii and Mgii lines are the main sources of the radiative
loss in the solar chromosphere, there are many emission lines which form gradually at higher
temperatures than the typical low chromospheric value of 10,000K. Many of these lines form in
the transition region (TR) where the temperatures spans a range from a few 104K up to a few
105K(Gabriel1976;Peter2001;Wilhelmetal.2007).
The Interface Region Imaging Spectrograph (IRIS) is a satellite observatory launched by
NASAon June 27, 2013 (DePontieuetal. 2014). It has a 19 cm telescope for UltraViolet (UV)
spectroscopy. IRIShasaSun-synchronous orbitwithaperiodof97.5min. SpectralbandsofIRIS
mainlycoversthechromosphere andthetransition region.
Istarted towork withIRIS1 Mgdata afew month after release of theIRIScalibrated data on
Oct2013. AsIhave worked for myPhDthesis and afterward withthe CaiiH line observed with
the POLISinstrument (Becketal. 2005) at the German Vacuum Tower Telescope at the Spanish
ObservatoriodelTeide. itwasinterestingtoworkwithsharpandcleanemissionpeaksoftheMgii
lines compared to the one on the either sides of the CaiiH line core. The Mgii lines and nearby
continuum are recorded in the Near UltraViolet (NUV) spectrograph. Beside the NUV spectra,
IRIShas also a FarUltraViolet (FUV)spectrograph. TheFUVspectra contains manyinteresting
emission lines. Some of the FUV lines like the Oi135.6nm are optically thin (Rutten 2003) so
the line profiles are like a Gaussian function while other lines like the Cii line pair are almost
always optically thick and show the self-absorption pattern in the line core. MOSiC fits these
linesthroughacontrolledfittingprocedureinwhichthedegreesoffreedomisgraduallyincreased
and each parameter can span only the specified range. Measurement errors due to the photon
noise(Poisson)andthereadoutnoise(Gaussian)areconsideredinthefit(DePontieuetal.2014).
One (two) Gaussians are fitted to optically thin (thick) lines. The UV continuum is measured
through inspecting the continuum windows in the wing of strong lines (see below). MOSiCuses
1http://iris.lmsal.com
2
theMPFIT2 packageforfitting(Markwardt2009).
1.2 What is MOSiC?
MOSiC is a collection of IDL programs for profile analysis and Gaussian fitting of the Mgii
line along with Gaussian fitting of the Cii133.5nm line pair, the Oi135.6, the Cli135.2, the
Siiv139.7 and 140.3 and the Oiv140.0 and 140.1nm lines observed with the IRIS near UV and
farUVspectrograph.
1.3 The tar file
Youcandownloadthewholepackage orpartsoffromthispage.
After downloading and unpacking the fiels, it creates several directories. You should add
the path to the some directories (reza lib, iris reza, other lib if you have already installed the
SolarSoft)oralldirectoriestoyourIDLpath. OtherdirectoriesincludesFitsioprograms fromNasa,
MPFITpackage,afewroutines fromIRIS/EISidlsoftware,aswellasafewotherindividual pro-
grams.
1.4 Quick overview
YoucangetMOSiCworkingwithorwithoutSolarSoft. Therefore,youhavetode-Ricethelevel2
datathatyoudownloadfrominternet. Converting thedatatolevel3isoneofthewaystoconvert
theRice-compresseddatatoanormalFitsdatacube. Thismethodisexplainedinthenextsection.
An alternative approach is to use the Python interpreter which reads the Rice-compressed level
2 data correctly and then write it as a new FITS file. Please note that a few SolarSoft programs
whichyouneedforanalysisareincludedinthetarfilebutitdoesnotcontainbulkoftheSolarSoft.
MOSiCdoesnotusetheheaderinformation aboutthelineposition. Theuserinteractively selects
lines and the program estimates the amount of the dispersion. Then it compares the estimated
dispersion with teh one in teh header and when they are fairely close, it takes teh header value
and continues. If not, the program prompt a warning and stops. Each sub-program checks if the
input profile isempty before executing anything, so theprogram does not crash in case ofadead
pixel/column. Please note that analyzing NUVand FUVdata, or every two wavelength band are
completelyindependent.
A common block is used to pass the spectral dispersion to the functions fitting the profiles.
The user does not need to edit any IDL file, except if you want e.g., to push to fit profiles below
thedefaultnoiselevel. Howevertheprogramsaredocumentedsoyoucanreadthedocumentation
ineachprogram.
MOSiCwasdesignedtosaveasmuchRAMaspossible. Tothisend,Irewrotealargenumber
of programs and configured the programs such that each set of lines should be called separately.
As a consequence, there is one extra step at the beginning where we reshape the full array, and
2http://www.physics.wisc.edu/craigm/idl/fitting.html
3
Table 1.1: MOSiC overview. The quiet command (/do quiet) can be used in all cases except for
thecontinuum. Theplotcommand(/do plot)isuseful forevaluation. Itplotstheanalyzed profile
foreachpixel.
wavelength (nm) spectral feature
280 photosphere /do cont
279 Mgii /do mg,/do h
279 Mgii /do mg,/do h,/do gauss,/do improve
135.6 Oi+Ci /do o1
135.1 Cli /do cl
133.5 Cii /do cii,/fast
133.5 Cii /do cii
140 Siiv+Oiv /do si,/do 1394
thenreadeachrasterspectraseparately. MOSiCshouldbecalledinthefollowingorder:
>reorder, ’/path/to/data/’
>analyze iris, ’/path/to/data/’, /do cont
>analyze iris, ’/path/to/data/’, /do mg,/do h,/do gauss,/do improve
>analyze iris, ’/path/to/data/’, /do o1
>analyze iris, ’/path/to/data/’, /do cl
>analyze iris, ’/path/to/data/’, /do cii,/do fast
>analyze iris, ’/path/to/data/’, /do si,/do 1394
Pleasenotethat/do o1shouldbeexecutedbeforeanyotherFUVchannelaswegetthesystematic
FUVvelocityformtheOiline.
1.4.1 Correction forthe orbitalvelocity
Thetemporalgradientduetoorbitalvelocityofthesatelliteshouldbecorrected. Onewayistouse
themethoddescribed ontheIRISwebpage. Iuseanalternative methodandcalculate thespectral
drift separately for NUV and FUV spectra. In NUV, one of the strong unblended photospheric
lines is used after analyzing the NUV continuum data. In FUV, we first take average profile of
eachslitpositionandthenusetheOilinecentertoconstructatemporalcurve. Thevelocitymaps,
e.g. from OiorClishould notshowanytraceofresidual wavelength drift duetoorbital velocity
ofthesatellite.
1.4.2 Comments ontheGaussianfits:
A common feature to all analysis programs is that at the very beginning, it analyzes an average
profile. Theusercancheckthedisplayandmakesurethateverythingisalright. Alsoitisadvisable
torun afewsplit positions withvisualization active soone can make sure that parameters are set
correctly. Theactualruntimesdependsonthenumberofspectralpointsselectedfortheanalysis,
thecomplexityoftheobservedlineprofiles,aswellastheperformanceofthecomputingfacilities.
4
SomeofthefeaturesoftheGaussianfittingsarethefollowing:
a) InallGaussianfits,eachparametervariesinalimitedrange. This(hopefully)preventsthepro-
gramtoreturnmeaningless results. Alsoinseveralcases, thestepsizeofagivenparameter
has also a maximum limit, so for instance in case of a line width, we know that it spans a
limitedrangeofafewpixels,sothemaximumstepsizeisabout0.5pixel.
b) In each case, output of the fit for each pixel is checked and the fit is repeated if the result is
not acceptable. When the reduced chi-square is still not satisfactory a new procedure with
random initialization is triggered. This slows down the program but helps in case of noisy
data.
c) Thedegreeoffreedomincreasesgradually,i.e.,wealwaysstartfromasingleGaussianfit,then
try a double Gaussian fit, .... Each fit then provides an initial guess for the next fit. This
procedure takesalittlebitlongerbutifonestarts afitwith13freeparameter atonce, there
is a larger chance to have a failure. This holds for all spectral bands except the Cli line
where weonly perform a single Gaussian fit. A guided multi-Gaussian fitting method was
presented previously byseveralauthors (e.g., Peter2000;Tianetal.2011).
d) Thequality ofthefitisevaluatedusingthereduced chi-square (Bevington&Robinson1992).
Thereducedchi-squarehasthechi-squaredistribution aroundunitywhichisanindicatorof
asatisfactory fit.
e) The line width calculated in any program is the 1/e width of the maximum which is needed
tocalculate the non-thermal line width. Thenon-thermal line width iscalculated using the
iris nonthermal.pro providedthrough IRISIDLpackage.
1.5 Off-limb observations
Currently the program runs experimentally on off-limb observations. I have not notices a crash
but as it was mainly developed for the disk observations, it is experimental for the time being. It
should betested against amorediverse setof off-limb data. Ifyou use itfor off-disk data, please
becareful,e.g.,bykeepingthevisualizationactiveduringexecutionforafewslitpositions. Ifyou
noticeabug,pleasesendmeane-mail.
5
Chapter 2
Preparations
MOSiCreadsthedatacubeslice-by-slice, youdonotneedtoreadthewholedatacubeatoncein
any reduction step. This is particularly helpful for machines with limited memory (RAM). As a
result, there are a few necessary steps to prepare a level2 data cube in a format that MOSiC can
use it. In short, it is converting the level 2 data to a normal FITS file without Rice compression
andthentransposing thearraytohavethewavelength asthefirstaxis.
2.1 Converting level2 data to level3
Aneasywaytoconvertlevel2datatoanormaldatacubeistoconvertittolevel3data. Thereisa
program written by Prof.Mats Carlsson (iris make fits level3) and is available through SolarSoft
andIRISwebpage. YoushoulddownloadtheprogramsandputtheminyourIDLpath.
> !path = !path+‘: ‘+expand path(′+/scratch/programs/′)
Thiswillincludeallsub-directories inthegivepath.
Fora singlefileora few files:
Nowitisveryeasytoconvertalevel2datatolevel3:
filepath = ‘/data/obs/iris/spots/mercyry/‘
infile = [‘iris l2 20160509 131630 3684510004 raster t000 r00000.fits‘]
iris make fits level3,ww+infile,/all,wdir = filepath.
If there are more than one level2 file, list them in the infile variable. Please note that size of
theoutput fileisabout twiceasbigastheinput file. Forverylarge files,thelevel3filewillbeso
large that you cannot allocate enough memory in the IDL. In this case, you can convert different
spectral band to level3 one by one. This is the alternative way compared to using /all command
whichpacksalllevel3spectral bandsinoneFITSfile.
6
iris make fits level3,filepath+infile,0,wdir = ww
iris make fits level3,filepath + infile,1,wdir = ww
...
Ifthere aremany level2 files:
Whentherearetoomanylevel2files,thenitiseasiertoproceed asfollowing:
filepath = ‘/data/obs/iris/mercury/‘
files d = read dir(filepath,filter = ‘iris l2∗.fits‘)
num = n elements(files d.files)
save,filename = ‘temp.sav‘,files d
nowrestartIDLandactivatethepath:
> idl
> !path = !path+‘: ‘+expand path(′+/scratch/programs/′)
restore,‘temp.sav‘
infile = files d.files
iris make fits level3,filapath + infile,/all,wdir = filepath
2.2 Timeseries
Afterconvergingtimeseriedatatolevel3,ithasa4Dstructure. TogetMOSiCworking,weshould
converting itbacktoa3Dform. Onewayistoflattenthefourthaxis:
> iris timeseri,‘/path/to/data/file/‘
Itconverts the4D data structure toa3D cube like anormal scan. Alternatively, you can cuteach
slitposition andanalyze itindependently.
2.3 FITS manipulation using Python
TheAstropy package has a powerful FITSinterpreter. It reads the Rice-compressed level2 FITS
fileswithoutanyextracost. Inthepythonenvironment:
>>> from astropy.io import fits
>>> hdulist = fits.open(‘/data/iris l2 20160506 151211 3610014160 raster t000 r00000.fits‘)
>>> hdulist.info()
Filename: /data/iris l2 20160506 151211 3610014160 raster t000 r00000.fits
7
No. Name Type Cards Dimensions Format
0 PRIMARY PrimaryHDU 346 ()
1 ImageHDU 33 (669,1093,64) int16(rescales tofloat32)
2 ImageHDU 33 (825,1093,64) int16(rescales tofloat32)
3 ImageHDU 33 (387,1093,64) int16(rescales tofloat32)
4 ImageHDU 33 (674,1093,64) int16(rescales tofloat32)
5 ImageHDU 33 (120,1093,64) int16(rescales tofloat32)
6 ImageHDU 33 (153,1093,64) int16(rescales tofloat32)
7 ImageHDU 33 (762,1093,64) int16(rescales tofloat32)
8 ImageHDU 54 (47,64) float64
9 TableHDU 53 64Rx7C [A10,A10,A3,A10,A3,A66,A66]
>>> prihdr = hdulist[0].header
>>> print repr(prihdr)
>>> data = hdulist[1].data
>>> data.shape
(64,1093,669)
Thelast command actually read the data. You can inspect the data by plotting some line profiles
orshowing2Drasters. Nowwehavethedataandwecanwriteitusingastropy1
2.4 Reorder the data cube
RegardlessifyouhaveusedAstrpyorSolarSoft,atthispointyouhaveanormalFITSfile(without
compression). MOSiC assumes that the data has the traditional format of raster spectra: the first
axis should bethe wavelength, thesecond the slit, and the third the scanning direction. Todoso,
the 3D data cube should be transposed, but wedo it slightly differently just tomake sure that we
donotreadthewholecubeatonce:
> reorder,‘/path/to/data/file/‘
Now,wehavethefinalcalibrated dataandwearereadytostarttheanalysisroutines.
1ChecktheastropyinstructionsforwritingnewFITSfile.
8
Chapter 3
The main program
Thecoreprogramiscalled”analyze iris.pro”. Thisprogramcallsafewsubroutines andperforms
the analysis. The user does not directly interact with other subroutines during the data analysis.
I reduce the data in the following order: at first the continuum channel, then the Oi135.6nm
channel, and then anything else. This is because the 280nm continuum and the Oi data are used
toestimatetheorbitalvelocityofthesatellite intheNUVandFUV,respectively.
3.1 280nm continuum : /do cont
Thecontinuum analysis mustbedonebefore anyotherstep. Theprogram firstcreatesanaverage
spectra and anaverage intensity along the slit. Thelater isuseful toselect only arestricted range
for analysis. The user then selects the spectral range in the NUV and FUV (by mouse click).
Pleasereadthecommentsintheterminalcarefully. Theprogramasksforallmajorlinesobserved
byIRIS(Table1). Itcanhappenthattheprogramasksyoutoclickaroundaparticularlinelikethe
Cli which was not recorded. In this case, you can simply click anywhere as you will not reduce
that particular line later. This selection is done once and then used in the other subroutines. The
measuredspectraldispersionwillbeprintedintheterminalandcomparedtotheofficialdispersion
in the header. Allrelevant information are saved. The continuum reduction program also creates
aquasi-continuum mapsinoneJpegfile(byaveragingsomespectralbands). Itisusefulforafirst
lookinthedatacube,although onecanusetheIRISSlitjawimagesforanoverview.
Afterthat,the280nmrangewillbeanalyzedindetail: theprogramcalculateslineparameters
fortwophotospheric linesselectedbytheuser. Irecommendtousealinewhichisdeep,isolated,
and not at the border of the spectral range. Next it computes a photospheric continuum map
by analyzing the whole 280nm spectra, and calculates the photospheric velocities. The orbital
velocity correction happens in this step: the user answers a few questions and interactively fit a
curvetothe average velocity asafunction oftime. Userenters anorder forthepolynomial fit. If
you do not get asatisfactory fitby any polynomial, you can enter anegative number: it stops the
program. Youcanthenmanuallyconstructthepropercurve,callitcurveinIDLandthencontinue.
Theestimatedorbitalvelocityisthenappliedtothephotosphericvelocitymapssothetwovelocity
maps shown at the end of this step must have meaningful rad/blue structure e.g., for granulation
orEvershedflow. Ifnot,pleasere-runthisstepandselectadifferentspectralline. Alsonotethata
9