Introduction to SODAS & SolarSoft

Introduction to SODAS & SolarSoft
INTRODUCTION TO THE
SOLAIRE DATA ANALYSIS SCHOOL
Lyndsay Fletcher
University of Glasgow
The variety of solar data
Aims of the workshop
The aims of the SODAS workshop are to:
• Provide an overview of commonly-used data analysis software
and techniques
• Build confidence in carrying out basic data tasks
• Point the way to more advanced data processing methods
The workshop participants have different levels of experience
in data analysis
– I hope that people will help each other to learn.
Timetable and topics
USB drive
Each participant receives a 8GB USB drive with the information
and data needed during the workshop. This includes:
•  The parts of the SolarSoft software that we will use;
•  The data and calibration files required for the exercises;
•  Some (but not all) instructions for the exercises.
(Have a look now at what is on the USB drive and copy it onto
your laptop)
Installation
Instructions for installing SolarSoft - see later
Everyone will need to have the sswdb files and data files on
their laptop
IDL - the Interactive Data Language
The vast majority of solar data analysis is currently carried out
in the IDL language.
IDL is GOOD for data analysis (esp. arrays), visualisation
IDL is BAD for number crunching (esp. ‘for’ loops)
IDL comes with a huge library of pre-written software,
automatically installed.
Someone has probably already written a routine to do what you
want to do! See e.g.
http://www.astro.washington.edu/docs/idl/htmlhelp/
http://idlastro.gsfc.nasa.gov/homepage.html
SolarSoft
SolarSoft is a library of IDL routines and functions for solar
physics data analysis
It is a community-written library, but major labs employ
programmers to provide code for their instruments
It must be installed separately from IDL, and then IDL must
know how to find the library.
Solarsoft installation information
http://sohowww.nascom.nasa.gov/solarsoft/
Individual routines also available to download from the web,
e.g. http://sohowww.nascom.nasa.gov/solarsoft/trace/
Provided in this workshop
We are using a restricted set of SolarSoft routines.
GEN (general software – time, imaging, mapping etc)
SOHO: EIT, CDS, MDI
Hinode: EIS, SOT, XRT
Orbital Observatories: TRACE, HESSI
Yohkoh: HXT
Packages: BINARIES, SPEX, XRAY,CHIANTI
We are also using a small part of the database libraries
(sswdb).
The database tree contains calibration and engineering files for
some (not all) of the missions. If you do your own data analysis
after this workshop, you may need to install more of sswdb.
More about SolarSoft
For full SolarSoft installation instructions
http://sohowww.nascom.nasa.gov/solarsoft/
Individual bits of code also available to download from the web,
e.g. http://sohowww.nascom.nasa.gov/solarsoft/trace
Individual instrument analysis guides, e.g.:
http://hinode.nao.ac.jp/sbsc/XAG.pdf
http://www.mssl.ucl.ac.uk/surf/guides/tag/tag_top.html
http://solarwww.mtk.nao.ac.jp/katsukaw/sot_fits/
SOT00042_C_SOT_Analysis_Guide_(SAG).pdf
http://msslxr.mssl.ucl.ac.uk:8080/SolarB/EIS_DA_guide.html
Installing SolarSoft - Windows
Windows
1). Copy ssw directory to c:\ssw
2a). If you don't want default options/paths edit main
configuration file c:\ssw\site\setup\sswidl.bat i.e. Edit paths if personal install is different
If d:\ssw then change set SSW=C:\ssw to
set SSW=D:\ssw
2b). Also in sswidl.bat you can set up instrument
preferences – see later.
3). To launch ssw run/click c:\ssw\site\setup
\sswidl.bat Installing SolarSoft – Linux/Unix/Mac OSX
Linux/Unix/Mac OS X
1)  Make sure you are in a c-shell (tcsh or csh)
2)  Copy ssw directory to /usr/local/ssw
3a) Put the following in your .cshrc file
setenv SSW /usr/local/ssw
3b) (also in .cshrc file, you can set environmentals for data
directories - see later)
4) Then in the Linux/Unix command line (in the c-shell) do
source .cshrc
[see below]
source $SSW/gen/setup/setup.ssw
Environment variables/preferences 1
IDL Environment variables are system variables available to all
IDL program units. When IDL starts, it sets the values of these.
This can be done in three ways:
1)  In the appropriate SolarSoft instrument setup file
2)  In the IDL command line (for that IDL session only)
3)  In your .cshrc file
Only SolarSoft environment variables which you do not need to
change should be set in your .chsrc (c-shell) or .profile
(Bourne shell) or your sswidl.bat file (Windows)
Environment variables/preferences 2
Changing the setup.*_env files
To set-up environment variables/ preferences for each
instrument edit appropriate setup.*_env file
These files are run by SSWIDL on startup
They should be copied from \ssw\*** to \ssw\site\setup
and edited.
e.g. RHESSI, in file \ssw\site\setup\setup.hessi_env
change
setenv HSI_DATA_ARCHIVE /hessi/data1/hessidata
setenv HSI_DATA_USER ""
to where you have copied the data to locally
Environment variables/preferences 3
You can also set or change an environment variable an IDL
session using set_logenv at the IDL prompt
IDL> set_logenv, ‘SSWDB’, ‘/usr/local/sswdb’
The value of this variable is lost at the end of the session.
To inspect the values of your environment variables from IDL
IDL> pr_env ;;shows everything!
IDL> pr_env, /xrt
;shows xrt env variables
Environment variables/preferences 4
e.g. in .cshrc set the variable SSWDB. Warning – this will be
overwritten by value in a setup.*_env file
Unix/Linux/Mac OS X:
The calibration database is in /usr/local/sswdb
In .cshrc file do
setenv SSWDB /usr/local/sswdb [bourne, in .profile set SSWDB="/usr/local/sswdb”]
Windows:
The calibration database is in C:\sswdb.
In sswidl.bat file do
set SSWBC=C:\sswdb Finding out what’s in SolarSoft
SolarSoft is huge, with many tasks replicated. It is impossible to
know all it can do. How do you find out what’s there?
(1)  Use ‘thought for the day’
IDL> tftd, ‘spectrum’
Up to 50 randomly selected routines/functions with the word
‘spectrum’ in their documentation
(2) Search on name with wildcard characters
IDL> doc_library, ‘*spectrum*’
Documentation headers for all files with ‘spectrum’ in title
(3) Browse the solarsoft documentation
IDL> xdoc
Brings up a widget with all directories listed. Unfortunately
‘search’ button only works if you know the filename exactly
Procedures and functions
SSW routines come in two types – procedures and functions.
A procedure is called by a procedure call statement
A function is called by a function reference and always returns
an explicit result.
;Call procedure ABC with two parameters (A and 12)
IDL> ABC, A, 12 Call function XYZ with one parameter (C/D). The result of XYZ
is stored in variable A.
IDL> A = XYZ(C/D) Some SSW routines (e.g. for RHESSI) use objects, which
combine procedures/functions with the data they operate on.
Parameters and keywords
SSW routines typically have required input/output parameters
and optional keywords. The calling sequence can usually be
found through xdoc. e.g. IDL> xdoc, ‘trace_cat2data’ parameters
keywords
Alternatives:
IDL> doc_library, ‘trace_cat2data’
IDL> doc_library2, ‘trace_cat2data’
Data access
Each instrument or mission has its own data archive. Some
commonly-used ones are:
Hinode
SOHO
RHESSI
TRACE
sdc.uio.no/sdc/
sohowww.nascom.nasa.gov/data/archive/
hesperia.gsfc.nasa.gov/rhessidatacenter/
trace.lmsal.com/trace_cat.html
There are other ways to get data, e.g.
•  Individual instrument home pages
•  Virtual Solar Observatory sdac.virtualsolar.org
•  US solar data analysis centre umbra.nascom.nasa.gov/
•  From within an IDL session (some instruments – see later)
FITS files & File formats
The preferred format for solar data files is FITS (usually
filename.fits) FITS = ‘flexible image transport’
FITS files can always be opened with an IDL fits reader, e.g.
IDL> mreadfits, ‘filename.fits’, data, header
However, most instruments provide their own fits reading
programmes, which makes sure that essential info is read.
You might find other file formats being used, e.g.
.mxf (Multi Extension Fits) which groups fits files together
TRACE hourly files (e.g. tri20070605.0400)
It is necessary to find out from the instrument analysis guides
how to open each kind of file – there is no magic bullet!
FITS files
FITS files contain data and a header structure.
The header structure is where the auxiliary information about
the observation can be found.
IDL> files = find_files('XRT*.fits*’,'$XRT_DATA/
2007/06/05/H0400')
IDL> help, files
FILES
STRING
= Array[37]
IDL> print, files(0)
/Users/lyndsayfletcher/DATA/HINODE/XRT//2007/06/05/
H0400/XRT20070605_041113.3.fits
IDL> mreadfits, files, hdr, data
IDL> help, data
DATA
INT
= Array[512, 512, 37]
IDL> help, hdr
HDR
STRUCT
= -> MS_297445366001 Array[37]
What’s in a FITS header?
FITS headers contain a list of tags. Each instrument has its
own tags, though some are standard. To look at tags, do
IDL> help, hdr(0), /str
** Structure MS_297445366001, 167 tags, length=1204,
data length=1202:
SIMPLE
INT
0
BITPIX
LONG
16
NAXIS
LONG
2
NAXIS1
LONG
512
NAXIS2
LONG
512
DATE
STRING
'2007-06-13T01:14:29.000'
DATE_RF0
STRING
'2007-06-13T01:14:29.000'
SATELLIT
LONG
33
TELESCOP
STRING
'HINODE'
INSTRUME
STRING
'XRT’ IDL> print, hdr(0).date, ‘
‘, hdr(0).telescop
2007-06-13T01:14:29.000
HINODE
Was this manual useful for you? yes no
Thank you for your participation!

* Your assessment is very important for improving the work of artificial intelligence, which forms the content of this project

Download PDF

advertisement