\section{{\bf General Yohkoh Software (Getting Started)}}

Welcome to the analysis of Yohkoh data.  This document is intended to
help you use the Yohkoh software and to understand the Yohkoh databases
and some of the instrument calibration issues.  The Yohkoh software has
been written mostly in IDL, or Interactive Data Language, which is a
licensed software program available from Research Systems, Inc.  In order
to run the Yohkoh analysis software, you must have IDL Version 3.0 or
later installed on your computer or workstation.  The Yohkoh Guide
assumes that the reader has some familiarity with IDL already.  For
specific IDL questions, you are encouraged to consult the IDL User's and
Reference Guides. \index{IDL}

     The Yohkoh software is known to work currently on several Unix-based
platforms (e.g., HP, Sun, Mips, DEC, SGI).  It is also available for VMS
computers, however, we recommend that Unix be selected for analysis of
Yohkoh data if possible.  The installation and upgrade procedures
described in the Reference Guide support only Unix systems. 

     Before beginning, it may be helpful to refer to Chapters 1 and 2 of
the Reference Guide (Volume 2) which briefly describe the Yohkoh instruments
and also provide an introduction to the Yohkoh data and software
organization.  More details about the instruments can be found in the
Instrument Guide (Volume 3).  You will want to make sure the Yohkoh software
is set up on your computer.  Talk to your local manager about
this or follow the installation procedure described in the appendix of
the Reference Guide for Unix-based machines.  The installation
can be accomplished easily by those possessing a moderate amount of
Unix experience.  Next, check that you have a {\tt .yslogin} file on
your home directory.  Then type the following command:
%
\ultrixinputa{source $\sim$/.yslogin}\index{.yslogin}
%
You must type this command at the beginning of each new login session or
see the Yohkoh Reference Guide about how to customize your {\tt .login}
or {\tt .cshrc} file. 

     Next, if you have Yohkoh data files on your disk, you should be able
to start looking at data after typing:
%
\ultrixinputa{idl}
% 
to start the IDL software system.  YODAT (described in the next section)
is the most common way to read Yohkoh data files and display various
information or, in the case of SXT, to display images.  If you have not
yet copied any Yohkoh data files to your computer's disk, you will
probably want begin with sections~\ref{readtapes1} and~\ref{readtapes2} which describe how to read
the Yohkoh data archive tapes. 

\subsection{How to Access the Yohkoh Observing Logs and Event Logs}\index{observing log}

The Yohkoh observing log contains a wealth of information which is 
readily accessible for searches and quick comparisons between instruments.
In the following example the format of the plots may not be 
exactly what you need, but it is important to realize how simple the
PLOTY program was to write since the observing log data files already exist.
There is a lot of potential in the observing logs which is not being tapped
as of yet, but the following sections touch on a few capabilities which
currently exist.

\subsubsection{Performing Searches Using the Observing Log (XSEARCH\_OBS)}\index{observing log}

XSEARCH\_OBS provides graphical front end access to the Yohkoh Observing Log.  
The user can select search criteria and define various options for output
\footnote{Preliminary at the time of publication --- expected working prototype
for SXT searches in Feb, 1994}.
The calling sequence is:
%
\idlinputa{xsearch\_obs}\index{XSEARCH\_OBS}

The following features are anticipated.

\IItem
\item graphical definition of instrument parameters initiate search of observing 
  log (for example, sswhere-derived interface is used for SXT searches).
\item save defined search parameters in a configuration file which can be used for a 
  repeat search on different times or as starting point for future 
  parameter modifications.
\item read in existing search parameter configuration file to set initial (or
  final) parameters -- this permits archiving of useful search definitions
  and promotes repeatability.
\item provide access to low level routines which translate observing log 
  records to archive tape names or MO disk names and data sets and ultimately 
  allow reformatted data extraction.
\end{itemize}

\subsubsection{Displaying a Light Curve Set of all Instruments (PLOTY)}

\insertplot{demo_ploty.eps}{ploty, '15-nov-91 22:30','15-nov-91 23:50' }{demo_ploty}{6.25}{8.25}

PLOTY is a crude method to plot the light curves from all of the Yohkoh
instruments on the same plot and the same time axis.  If you have the
observing log on-line and wish to use it to make the plots, you can
specify the plot times.  It is recommended not to plot more than
approximately 24 hours of data at a time.  An example is:
%
\idlinputa{ploty, '8-may-92 15:00', '8-may-92 18:40'} \index{PLOTY}
\idlinputb{ploty, '8-may-92 15:00', '8-may-92 18:40', /zoom, /big}

Fig.~\ref{demo_ploty} is an example of the plot which can be produced.  
Note that the BCS counting rates drop to zero at around 22:37 because they
become saturated. The
format for the plots of this program might change in the future, but 
the capability to plot data from several instruments with the same
time axes will remain.  

\subsubsection{Displaying a Light Curve Set of all Instruments (OBS\_PLOT)}

TODO Needs text

\subsubsection{\label{obs_log}Listing of the SXT Images and Heliocentric Locations}

There are a variety of routines which will produce listings of the
images and pointing locations of the SXT partial frame images.

The routine PR\_SXTOBS will read the observing log and list every FFI and PFI image
taken for the times requested.  The format of the output is simply the output
of GET\_INFO which is described in detail in the Reference Guide
(PR\_SXTOBS simply reads the observing log and then calls GET\_INFO). The command:
%
\idlinputa{pr\_sxtobs,'15-nov-91 22:00','15-nov-91 22:05',/long}\index{PR\_SXTOBS}
%
will produce the output:

{\scriptsize
\begin{verbatim}
PR_SXTOBS.PRO Run: 20-Dec-1993 21:06:29.00
SXT Observing Log Search from: 15-NOV-91  22:00:00 to 15-NOV-91  22:05:00

   0 15-NOV-91  22:03:40  QT/H  Open /Mg3   Half Norm C  17   338.0   64x 64  100%  S15W11   0%     41.3
   1 15-NOV-91  22:03:48  QT/H  Open /Al.1  Half Norm C  17   338.0   64x 64  100%  S15W11   0%     41.2
   2 15-NOV-91  22:03:56  QT/H  Open /AlMg  Half Norm C  19   668.0   64x 64  100%  S15W11   0%     41.0
   3 15-NOV-91  22:04:04  QT/H  Open /Be119 Half Norm C  27 10678.0   64x 64  100%  S15W11   0%     40.9
   4 15-NOV-91  22:04:18  QT/H  Open /Al12  Half Norm C  27 10678.0   64x 64  100%  S15W11   0%     40.7
   5 15-NOV-91  22:04:32  QT/H  Open /Mg3   Half Norm C  19   668.0   64x 64  100%  S15W11   0%     40.4
   6 15-NOV-91  22:04:36  QT/H  Open /Al.1  Half Norm C  23  2668.0  512x512  100%  Full D   2%     40.4
   7 15-NOV-91  22:04:44  QT/H  Open /Al.1  Half Norm C  17   338.0   64x 64  100%  S15W11   0%     40.2
   8 15-NOV-91  22:04:52  QT/H  Open /AlMg  Half Norm C  19   668.0   64x 64  100%  S15W11   0%     40.1
\end{verbatim} }
\normalsize

The routine SXTPNT\_SUM will read the observing log and give a summary of the
unique PFI pointing for a given period.  It groups the summary listing based on
each unique pointing location over time.  The command:
%
\idlinputa{sxtpnt\_sum, '5-oct-93 13:00', '6-oct-93 1:00'}\index{SXTPNT\_SUM}
%
will produce a file in your home directory with the name ``sxtpnt\_sum.txt''
(unless you specify the output file name with the {\it outfil} keyword option).
The beginning of this file is:

\index{NOAA region number}
{\tiny
\begin{verbatim}
OBS_SUMMARY  Ver 3.0
Program Run: 20-Dec-1993 21:12:40.00
   
      Date          Times          #Img  Mode    Table#    Filter A/B  Res  Exp  C DPE  msec    ImgSize  Loc   PntChange  NOAA
 
----------------------------------------------------------------------------------------------------------------------------------
  5-OCT-93  13:04:24 - 14:58:24    BCS: 441    SXTP: 146    SXTF:  19    W_H: 677     HXT-L:    1 SXS2:   16  S11E18       
     5-OCT-93  13:04:24 - 14:56:50   39  QT/Hi    733/1  = Open /Al.1  Full Norm C  16   238.0  128x128 S11E18  (  0.2) [ 7592]
     5-OCT-93  13:04:42 - 14:57:52   37  QT/Hi    733/1  = Open /Al12  Full Norm C  24  3778.0  128x128 S11E18  (  0.2) [ 7592]
     5-OCT-93  13:05:14 - 14:58:24   36  QT/Hi    733/1  = Open /Al.1  Full Norm C  16   238.0  128x128 S11E18  (  0.2) [ 7592]
     5-OCT-93  13:05:54 - 14:56:18   34  QT/Hi    733/1  = Open /Al12  Full Norm C  24  3778.0  128x128 S11E19  (  0.2) [ 7592]
----------------------------------------------------------------------------------------------------------------------------------
  5-OCT-93  15:16:24 - 15:16:24    BCS:   0    SXTP:   1    SXTF:   0    W_H:   0     HXT-L:    0 SXS2:    0  S13E27       
     5-OCT-93  15:16:24 - 15:16:24    1  QT/Hi    733/1  = Open /Al12  Full Norm C  24  3778.0  128x128 S13E27  (  0.0) [ 7592]
----------------------------------------------------------------------------------------------------------------------------------
  5-OCT-93  15:16:40 - 16:40:56    BCS: 190    SXTP: 133    SXTF:  15    W_H: 606     HXT-L:    1 SXS2:   16  S11E15      *
     5-OCT-93  15:16:40 - 16:40:56   33  QT/Hi    733/1  = Open /Al12  Full Norm C  24  3778.0  128x128 S13E17  (  0.7) [ 7592]
     5-OCT-93  15:16:56 - 16:39:20   35  QT/Hi    733/1  = Open /Al.1  Full Norm C  16   238.0  128x128 S13E17  (  0.7) [ 7592]
     5-OCT-93  15:17:28 - 16:39:52   34  QT/Hi    733/1  = Open /Al12  Full Norm C  26  7548.0  128x128 S13E17  (  0.7) [ 7592]
     5-OCT-93  15:18:00 - 16:40:24   31  QT/Hi    733/1  = Open /Al.1  Full Norm C  16   238.0  128x128 S11E15  (  0.7)
\end{verbatim}
}\normalsize
%
It can be seen that the listing contains information on the number of images of a given filter
for each time span, the heliocentric coordinates, the NOAA active region number(s) if
applicable, the peak flux in HXT-LOW
and SXS2, the GOES flare event level, and a few other things.  A ``*'' at the
end of the summary line says that the time of the peak of the GOES event
is contained within the time span shown.

\subsubsection{Light Curves from BCS, WBS and HXT}
\index{light curves}\index{observing log}

The routine BCS\_24HR\_PLOT (discussed on page~\pageref{bcs_24hr_plot}) 
uses the data in the observing log by default, and
the routines PLOTT\_HDA (discussed on page~\pageref{plott_hda})
and PLOTT\_WDA (discussed on page~\pageref{plott_wda})
use the observing log if the calling sequence
specifies the starting and ending time.  See the description and sample plots
of those routines described Sections~\ref{bcs_24hr_plot}, ~\ref{plott_hda}, and ~\ref{plott_wda}.

\subsubsection{Creating a List of Yohkoh Events (PR\_EVN)}
\index{event log}
\index{EVN, event log}
\index{Yohkoh event log}

PR\_EVN helps you find times for which Yohkoh data are available.  An event is driven
by a change between QUIET and FLARE mode, or when there is a data gap of more 
than 60 seconds.  By typing:
%
\idlinputa{pr\_evn, '23-jun-92'} \index{PR\_EVN}
%
a list of the times that Yohkoh data are available and the number of datasets
available for each instrument is listed for 24 hours starting at 23-jun-92 00:00.
By typing:
%
\idlinputa{pr\_evn, '15-nov-91 20:00', '17-nov-91 15:00', /flare}
%
all times that Yohkoh was in FLARE mode between those times are listed.  By typing:
%
\idlinputa{pr\_evn, '1-jan-92', '9-jan-92', /flare, /counts, mindur=5, outfil='pr\_evn.results'}
%
the FLARE modes for 1992, and since the /COUNTS option was used, the maximum 
counting rate for certain WBS, HXT, and BCS channels are printed instead of the
number of datasets available.  It also prints the GOES classification when
it is available.  The command shown above results in the following listing:

\index{GOES events}
\scriptsize
\begin{verbatim}
PR_EVN.PRO Run on  9-Dec-1993 12:07:26.00
Search Start Time:  1-JAN-92  00:00:00
Search End Time:    8-JAN-92  00:00:00
Minimum event duration:     5.00 minutes

NOTE: "*" means Yohkoh missed the beginning or end of the flare duration
      "+" means Yohkoh has a sub portion of data within the flare duration

     Start         End       Duration   DP           HXT    /         WBS                 /         BCS         / GOES
      (UT)        (UT)         (min)  Mode   Low  Med2 High /   SXS2   HXS   GRS1   RBMSD / Fe26 Fe25 Ca19  S15 /

 1-JAN-92  03:29:21-03:34:21   5.00  Flare     49    9    9 /    121    900    729      1 /  866 9676 5590 7586 / M2.8
 1-JAN-92  22:53:37-23:05:40  12.05  Flare      1    4    9 /    196   4624   7744      4 /  240  396  430 4083 /
 2-JAN-92  21:05:29-21:15:28   9.98  Flare     36    4    9 /     64    625    900      1 /  796 4210 9593 4340 / C9.3
 2-JAN-92  21:36:11-21:56:04  19.88  Flare     16    9   36 /    676  10000   7396      9 /  513 2210 3013 7290 / M1.9
 3-JAN-92  22:02:59-22:15:32  12.55  Flare      4    4   25 /    169   4489   7744     16 / 2083 3790 4573 9610 /
 4-JAN-92  08:48:43-08:58:40   9.95  Flare      4    9   16 /    256  24336   7396   4900 /   70  120  196 1276 /
 4-JAN-92  11:11:29-11:21:24   9.92  Flare     36    1    4 /     64    400    576      0 /  486 3150 2953 7210 /
 4-JAN-92  13:43:13-13:53:12   9.98  Flare     36    9    9 /     64   2809    576     25 /   80  490  883 3783 / C6.4
 5-JAN-92  13:15:33-13:25:14   9.68  Flare     25    4    9 /     64    576    784      0 /  626 4286 3930 6960 /
 5-JAN-92  15:14:55-15:24:20   9.42  Flare    576  961  196 /      4    441    841      0 /    0    0    0    0 /
 6-JAN-92  15:41:46-15:50:36   8.83  Flare    625  961  196 /      4    484    961      0 /    0    0    0    0 /
 6-JAN-92  19:55:06-20:09:39  14.55  Flare      4   16   36 /    400   7569   7225     16 / 3953  963  493 3903 /
 7-JAN-92  04:05:40-04:17:55  12.25  Flare     25    4    4 /     64    441    441      0 /  573 4196 4346 6420 / M1.5
 7-JAN-92  20:21:52-20:31:47   9.92  Flare     16    9   16 /     64   1764   2025     64 / 2116 1596 2000 4690 / C8.9
\end{verbatim}
\normalsize

\subsubsection{Direct Reading of the Observing Log}

A sample standard calling sequence for reading the observing log data files
for all instruments for a 12-hour period starting at 00:00 on 8-May-92 is:
%
\idlinputa{rd\_obs, '8-may-92', '8-may-92 12:00', bcs, sxtf, sxtp, w\_h, fid}\index{RD\_OBS}
%
An example for reading only SXT full frame entries is:
%
\idlinputa{rd\_obs, '1-jan-92', '1-jan-93', bcs, sxtf, /nobcs}
%
Be aware that these datasets can get quite large so the time spans should probably
not exceed 10 days unless you are only accessing SXT full frame entries.  See the
Reference Guide and the documentation header for RD\_OBS for more details.

\subsection{Summary SXT Full-frame image data}

\subsubsection{The Monthly SXT FFI files (SFM)}

XMOVIE\_SFM, DISP\_MONTH, GET\_SFM

\subsubsection{Browsing the Laser Movie (at ISAS, LPARL or MSU)}

A laser disk movie exists at both ISAS and LPARL which contains SXT images
for the whole Yohkoh mission.  These full frame images are all of the SFD
images which are available, which means 50--100 images a day for over two
years so far. It is possible to browse through the video recordings using a
remote control to look for events of a specific type or a specific time.

The routine VIDEO\_MENU will allow a user to access the ``special laser
movie'' disk which has individual movies of particular events.  See the
description in the Reference Guide for more details.



%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection{Accessing the Yohkoh Data}

\subsubsection{\label{yodat_sec}Interactive Access (YODAT)}\index{YODAT}
YODAT will access any data from BCS, HXT, SXT, or WBS.  It will also read 
some FITS files which have been renamed to use the Yohkoh convention. This procedure: \index{FITS files}

\EEnumerate
\item Shows what data are on line
\item Lets you select specific files to read and display
\item Reads the ROADMAP for the selected files
\item If you select data sets to be read, it creates the variables {\it data} and {\it index}
	which you can then manipulate using IDL or other higher-level Yohkoh routines.
\end{enumerate}

This procedure is run by typing (make sure that yodat is in lower case if
you are running on a Unix or Ultrix machine):
%
\idlinputa{.run yodat} \index{YODAT}
%
The prompt that you will receive will look something like this:

\begin{verbatim}
% Compiled module: $MAIN$.
               *******  YODAT V9.2 (7-Jul-93)  *******

It is possible to have YODAT extract every "n"th dataset by setting
the variable QYODAT_NSAMP to 1.  You will be asked one extra question

It is possible to read the Ground Based Observation (GBO) FITS files
by using a command like: MENU g*
          gb_ files are from Big Bear, gk_ are from Kitt Peak
RFITS will be called with /SCALE option if QYODAT_SCALE is set to 1

Enter MENU if you want to use the filenames menu option
Enter SAME if you want to access the same fileID for a different instrument
Enter MANY if you want to use menu option and extract many files
Enter TIME if you want to enter the start/end time to extract
Enter QUIT to abort out of YODAT

Enter file name (or wild cards)
\end{verbatim}
%
The first step is to select the data files to be read.  The name of the file(s)
selected is saved in the variable {\it infil}.  When one or more files are selected, the details of the datasets in
those files is read into the variable {\it roadmap}.  There are several different
techniques for selecting files.

\begin{itemize}
\item You can type the full file name, including the directory if the data
file does not exist in the default directory.  Wild cards are acceptable (e.g., {\bf spr9301*.*}).
\item You can use the MENU option to get a listing of all of the files 
that are on-line (this option uses the output of DATA\_PATHS to get a list \index{DATA\_PATHS}
of the data directories).  For example, if you type {\bf menu spr*}, you will get
a list of all SPR files that are on-line.  Or if you type {\bf menu bda9207*} you
get a list of all BDA files for Jul-92 that are on-line.  You can only 
extract one file with the MENU option so click on the 
one file you wish to read.
\item You can use the MANY option to select several files.  This option is
also menu driven, and is similar to the MENU option but you can select
multiple files.  After you have
selected all the files you want to read, click on QUIT/EXIT.
\item If you have already read a file, and wish to get the data for the same time but from 
a different experiment, you can use the SAME option.  For example, if you
have just read spr911115.2141, and want to get the BDA file for that orbit,
type {\bf same bda}.
\item Once you have selected a file, you can re-run YODAT and simply
hit RETURN and the same file is selected again so you can select
a different set of down-line options.
\item If you type {\bf quit}, then YODAT will be stopped.
\item If you are running YODAT over the network, then it might not be practical
to run options which create an X-window.  You can specify the file and
directory using wild cards.  The list of selected files will then appear
with a number next to each file.  You can then enter the starting and
ending file number to select a set of files.  For example, you 
could type \\ ``/yd*/*/spr930623*'' or ``/yd6/flares/spr91*''.
\end{itemize}

The ``MENU'' and ``MANY'' options search all data directories
which are returned by the function DATA\_PATHS.  At ISAS and LPARL this routine
automatically checks for new data directories that are on-line, in addition to 
some ``hardwired'' directories which it always checks.  It is possible for a
user to add directories to the list which DATA\_PATHS returns by using the 
routine NEW\_DPATH.  In the following example, the user adds the directory
``/yd3/morrison/agu\_paper'' to the list of directories which will be 
checked by YODAT.
%
\idlinputa{new\_dpath, '/yd3/morrison/agu\_paper'}\index{NEW\_DPATH}\index{data directories}\index{customizing your data path}
%
The second step in accessing any data set is to perform a quick review of the data available, and
select the data sets to be read.  The options for selecting the data are 
listed below.

\begin{verbatim}
Enter the number of data sets to extract
   * If you enter 0, all datasets will be extracted
   * If you enter -99, then it uses the datasets specified in variable "SS"
   * If you enter -888, then the file is not read
   * For SXT, enter a negative # (from -1 to -13) to access only that seq#
   * For SXT, enter -777 for sequence menu option
              Enter -776 to use "show_obs3" and select
              Enter -775 to use "plot_fov" and select
              Enter -774 to list the sequence summary
              Enter -773 to use "show_obs4" and select
              Enter -772 to use SSWHERE to select
   * For HXT, enter -666 to plot and select on SUM_L light curve
              Enter -665 to plot and select on SUM_M1 light curve
              Enter -664 to plot and select on SUM_M2 light curve
              Enter -663 to plot and select on SUM_H light curve
   * For WBS, enter -555 to plot and select on SXS1 light curve
              Enter -554 to plot and select on SXS2 light curve
              Enter -553 to plot and select on HXS light curve
   * For BCS, enter -444 to plot and select on S XV light curve
              Enter -443 to plot and select on Ca XIX light curve
              Enter -442 to plot and select on Fe XXV light curve
              Enter -441 to plot and select on FE XXVI light curve
   * For any, enter -333 to extract only flare mode data
\end{verbatim}

If you selected data to be read, then the results are saved in the following variables:

\vspace{0.2in}\begin{tabular}{|l|l|} \hline
{\it infil} & {the input file(s)} \\
{\it index} & {the index structure for datasets extracted} \\
{\it data} & {the data (array or structure) for datasets extracted} \\
{\it roadmap} & {the complete roadmap for all datasets in {\it infil}} \\
{\it dset\_arr} & {the list of dataset numbers selected} \\
{\it info\_array} & {for SXT only, a text array describing each image} \\ \hline
\end{tabular}\vspace{0.2in}

For SXT options `SHOW\_OBS3', `SHOW\_OBS4', and `SSWHERE', 
see the description in the Reference Guide.
The light curve options (all of the $-$400, $-$500, and $-$600 series)
will show a light curve of the selected channel.  YODAT will prompt you
with the instructions at each step.  It is possible to
select the range in time you wish to look at by:
\EEnumerate
\item Click with the left button at the starting time
\item Click with the right button at the ending time
\item Click with the middle button to exit
\end{enumerate}

An example of how one would use the $-$99 option is:
\EEnumerate
\item Run YODAT to select the file and to read the roadmap.
\item Exit out of YODAT with the $-$888 option.
\item Select the data to be extract using some high-level routine or
	simple IDL `where' commands.  Put the results in the variable `ss'.
\item Run YODAT again selecting the same file by just hitting RETURN.
\item Selecting option $-$99.
\end{enumerate}

\subsubsection{Advanced YODAT Options}

It is possible to use the $-$777 option to select SXT data by the sequence
table entry (all images taken with the same filter, resolution and field of view).  
If you wish to abort from this option, click on the title
(the heading of the table).  The most common technique is to just select
one sequence entry, but it is possible to select many entries.  The
procedure is to select option $-$777, and then:

\EEnumerate
\item Click on ``Enable option to select multiple sequences (reset)''
\item Click on all of the sequence entries you wish to extract
\item Click on ``If enabled selecting multiple options, now extract data''
\end{enumerate}

Another option is to use the $-$772 option to call SSWHERE which allows 
the selection of SXT data based on filter, image resolution, DP mode
and rate, exposure duration, and several other options.  See the
SSWHERE description in the Reference Guide for more details.

\subsubsection{Lowlevel Access Routine (READ\_XDA)}

\subsubsection{Most Common BCS Display Routines}

\begin{sloppy}
The BCS can provide detailed light curves and spectra.
After reading the BCS data with \mbox{YODAT}, you may wish to use the following commands:
\end{sloppy}
%
\idlinputA{3.8}{plott\_bda, index}		{;light curve of all 4 chan}\index{PLOTT\_BDA}
\idlinputB{3.8}{plott\_bda, roadmap, psym=10}	{;light curve of all 4 chan}
\idlinputB{3.8}{wbda, index, data}		{;light curves and spectral plots}
\idlinputC{3.8}{plots\_bda, index, data}	{;spectral plot of all 4 chan}
%
\subsubsection{Most Common HXT Display Routines}

Raw HXT data can provide light curves and spectra of the non-theraml emission in flares.
After reading the HXT data with YODAT, you may wish to use the following commands:
%
\idlinputA{3.8}{plott\_hda, index}			{;light curve of all 4 chan}\index{PLOTT\_HDA}
\idlinputC{3.8}{plott\_hda, roadmap, psym=10}		{;light curve of all 4 chan}
%
\subsubsection{Most Common SXT Display Routines}

The SXT provides images of the thermal plasma in flare, active regions, and the quiet sun.
After reading the SXT data with YODAT, you may wish to use the following commands:
%
\idlinputA{3.8}{stepper, data}					{;movie of data}\index{STEPPER}
\idlinputB{3.8}{stepper, data, xsiz=512}			{;movie of data enlarged to 512x512}
\idlinputB{3.8}{stepper, data, info=info\_array}		{;movie of data with times...}
\idlinputB{3.8}{xy\_raster, index, data}			{;raster display of data}\index{XY\_RASTER}
\idlinputB{3.8}{sxt\_prep, index, data, index2, data2, /reg}	{;calibrate data}
\idlinputC{3.8}{show\_obs3, index}				{;time line of data}\index{SHOW\_OBS3}
%
\subsubsection{Most Common WBS Display Routines}

The WBS provides light curves and spectra from soft X-ray to gamma rays.
After reading the WBS data with YODAT, you may wish to use the following commands:
%
\idlinputA{3.8}{plott\_wda, index}		{;light curve of 7 sub-instruments}\index{PLOTT\_WDA}
\idlinputB{3.8}{plott\_wda, roadmap, psym=10}	{;light curve of 7 sub-instruments}
\idlinputC{3.8}{plots\_wda, index, data}	{;simple spectral plots}
%

\subsection{How to Perform Spectral Fitting}
\index{spectral fitting}
\index{fitting spectra}

It is possible to perform spectral fitting on the HXT, WBS and SXT data by
using several routines written by Jim McTiernan.  You can
fit three or more filters, and thermal and non-thermal spectra.
There are programs called SXTHXT\_FSP and SXTHXTBOX\_FSP,
which will fit combined spectra for the two instruments (SXT and HXT).
See the reference manual for details on how to run the program.

\subsection{Selection and Extraction of an Arbitrary Shaped Sub-Image \mbox{(WDEFROI) [*]}}

The WDEFROI function allows the user to select and cut-out an arbitrary 
shaped region-of-interest (ROI) from a displayed image via point and click 
with the mouse.   With WDEFROI one can isolate a small intricately shaped
active region from a larger image for further analysis.  This can be 
particularly useful for reducing the computation time for calculating 
temperatures and emission measures of large data cubes.  WDEFROI is not SXT 
specific, so it can be used on ground-based data or other derived data such 
as temperatures and emission measure.  One can obtain light curves of the 
selected ROIs by passing normalized data and the times of data.

Example call to WDEFROI to obtain a sub-image via the keyword image:
%
\idlinputa{sub\_img = wdefroi(data, /image)}\index{WDEFROI}\index{sub-image extraction}
%
The program starts by bringing up the 1st image and running STEPPER 
to allow the user to pick a working image frame from the variable data for 
selecting ROIs (One can specify the working image frame by using the 
{\it sub=image\_number} keyword and avoid running STEPPER).  Once the working frame 
has been selected (say image 5), the user should exit STEPPER, and a widget 
window will appear entitled WDEFROI.

The top row of buttons of this widget is used to pick the mode of ROI 
selection and to change the color table (via XLOADCT).  Below these buttons 
is the online instruction box which displays useful general information and 
specific information on how to make box, polygon, and contour selections 
with the mouse.  This is followed by some contour controls, namely a slider 
widget which can be used to set the contour level at a specific value.  Then 
there is a row of control buttons: a select button to blacken-out all but 
the selected area of the image; reset button to re-display the original image; 
light curve to display a light curve of the selected area; exit to quit the 
widget and to return to IDL command line.  The final row has a display box 
for the total number of pixels selected by box, polygon, and contour.  

Example call to also plot light curves from normalized data: 
%
\idlinputa{sub\_img = wdefroi(norm\_data, /image, zoom=6, sub=5, /lc, time=index)}
%
Where, {\it norm\_data} is a data cube of small images say 64 by 64 pixels, {\it zoom}
specifies a zoom factor of 6, {\it lc} keyword requests light curve plot, and the
times for the light curve are passed via the {\it time} keyword.

Note: If the input data cube contains full frame images and the area of 
interest is very small it may be best to call WDEFROI twice: 1st to isolate 
the general area from the full context image and a second time with some zoom 
factor to make contouring and extracting the smaller features easier.  

