\documentstyle [twoside,11pt,epsf] {article}
%
%\def\newline{\ifvmode \@nolnerr \else \unskip\nobreak\hfil
%  \penalty -\@M\fi}
%
% use "idlinputa" for the first (or only) IDL listed in a block			(puts space at the top and bottom)
% use "idlinputb" for following lines						(backs up some space, and puts space at bottom)
% use "idlinputc" for last IDL line of a block with a new section following	(backs up some space, no space at bottom - backup)
% use "idlinputd" for single IDL lines with a new section immediately following	(puts space at top, not space at bottom - backup)
%
% use "idlinputbb" for idl continuation lines                                   (puts 1 inch of horizontal space}
%
\newcommand{\guideinputa}[2]{        \vspace{ 0.2in}?::?\noindent #1 ~{\bf #2}\vspace{0.2in}?::?}
\newcommand{\guideinputb}[2]{        \vspace{-0.4in}?::?\noindent #1 ~{\bf #2}\vspace{0.2in}?::?}
\newcommand{\guideinputbb}[2]{       \vspace{-0.4in}?::?\noindent #1 ~{\hspace{1in}\bf #2}\vspace{0.2in}?::?}
\newcommand{\guideinputc}[2]{        \vspace{-0.4in}?::?\noindent #1 ~{\bf #2}\vspace{-0.1in}?::?}
\newcommand{\guideinputcc}[2]{       \vspace{-0.4in}?::?\noindent #1 ~{\hspace{1in}\bf #2}\vspace{-0.1in}?::?}
\newcommand{\guideinputd}[2]{        \vspace{ 0.2in}?::?\noindent #1 ~{\bf #2}\vspace{-0.1in}?::?}
%
% \guideinputA {{IDL$>$} {3} {.run yodat} {;program to read data}}
\newcommand{\guideinputA}[4]{    \vspace{ 0.2in}?::?\noindent\makebox[#2 in][l]{#1 ~{\bf #3}} #4\vspace{0.2in}?::?}
\newcommand{\guideinputB}[4]{    \vspace{-0.4in}?::?\noindent\makebox[#2 in][l]{#1 ~{\bf #3}} #4\vspace{0.2in}?::?}
\newcommand{\guideinputC}[4]{    \vspace{-0.4in}?::?\noindent\makebox[#2 in][l]{#1 ~{\bf #3}} #4\vspace{-0.1in}?::?}
\newcommand{\guideinputD}[4]{    \vspace{ 0.2in}?::?\noindent\makebox[#2 in][l]{#1 ~{\bf #3}} #4\vspace{-0.1in}?::?}
%
\newcommand{\idlinputds}[1]{     \vspace{0.05in}?::?\noindent IDL$>$~{\bf\small #1}}
%
\newcommand{\idlinputa}[1]{\guideinputa{IDL$>$}{#1}  }
\newcommand{\idlinputb}[1]{\guideinputb{IDL$>$}{#1}  }
\newcommand{\idlinputbb}[1]{\guideinputbb{IDL$>$}{#1}  }
\newcommand{\idlinputcc}[1]{\guideinputcc{IDL$>$}{#1}  }
\newcommand{\idlinputc}[1]{\guideinputc{IDL$>$}{#1}  }
\newcommand{\idlinputd}[1]{\guideinputd{IDL$>$}{#1}  }
\newcommand{\idlinputA}[3]{\guideinputA{IDL$>$}{#1}{#2}{#3}  }
\newcommand{\idlinputB}[3]{\guideinputB{IDL$>$}{#1}{#2}{#3}  }
\newcommand{\idlinputC}[3]{\guideinputC{IDL$>$}{#1}{#2}{#3}  }
\newcommand{\idlinputD}[3]{\guideinputD{IDL$>$}{#1}{#2}{#3}  }
%
\newcommand{\ftpinputa}[1]{\guideinputa{FTP$>$}{#1}  }
\newcommand{\ftpinputb}[1]{\guideinputb{FTP$>$}{#1}  }
\newcommand{\ftpinputc}[1]{\guideinputc{FTP$>$}{#1}  }
\newcommand{\ftpinputd}[1]{\guideinputd{FTP$>$}{#1}  }
\newcommand{\ftpinputA}[3]{\guideinputA{FTP$>$}{#1}{#2}{#3}  }
\newcommand{\ftpinputB}[3]{\guideinputB{FTP$>$}{#1}{#2}{#3}  }
\newcommand{\ftpinputC}[3]{\guideinputC{FTP$>$}{#1}{#2}{#3}  }
\newcommand{\ftpinputD}[3]{\guideinputD{FTP$>$}{#1}{#2}{#3}  }
%
\newcommand{\ultrixinputa}[1]{\guideinputa{\%}{#1}  }
\newcommand{\ultrixinputb}[1]{\guideinputb{\%}{#1}  }
\newcommand{\ultrixinputc}[1]{\guideinputc{\%}{#1}  }
\newcommand{\ultrixinputd}[1]{\guideinputd{\%}{#1}  }
\newcommand{\ultrixinputA}[3]{\guideinputA{\%}{#1}{#2}{#3}  }
\newcommand{\ultrixinputB}[3]{\guideinputB{\%}{#1}{#2}{#3}  }
\newcommand{\ultrixinputC}[3]{\guideinputC{\%}{#1}{#2}{#3}  }
\newcommand{\ultrixinputD}[3]{\guideinputD{\%}{#1}{#2}{#3}  }
%
\newcommand{\vmsinputa}[1]{\guideinputa{\$}{#1}  }
\newcommand{\vmsinputb}[1]{\guideinputb{\$}{#1}  }
\newcommand{\vmsinputc}[1]{\guideinputc{\$}{#1}  }
\newcommand{\vmsinputd}[1]{\guideinputd{\$}{#1}  }
\newcommand{\vmsinputA}[3]{\guideinputA{\$}{#1}{#2}{#3}  }
\newcommand{\vmsinputB}[3]{\guideinputB{\$}{#1}{#2}{#3}  }
\newcommand{\vmsinputC}[3]{\guideinputC{\$}{#1}{#2}{#3}  }
\newcommand{\vmsinputD}[3]{\guideinputD{\$}{#1}{#2}{#3}  }
%
%\newcommand{\ftpinput}[1]{        \vspace{0.2in}?::?\noindent FTP$>$~{\bf #1}\vspace{0.2in}?::?}
%\newcommand{\ultrixinput}[1]{     \vspace{0.2in}?::?\noindent \%~{\bf #1}\vspace{0.2in}?::?}
%\newcommand{\vmsinput}[1]{        \vspace{0.2in}?::?\noindent \$~{\bf #1}\vspace{0.2in}?::?}
%\newcommand{\promptinput}[2]{     \vspace{0.2in}?::?\noindent #1~{\bf #2}\vspace{0.2in}?::?}
%
\newcommand{\yohkohtitlepage}[1]{
~
%\nopagenumber
\thispagestyle{empty}
\raggedbottom
\vspace{1in}
\begin{center}
{\Huge\bf Yohkoh Analysis Guide}\\ 
\vspace{0.1in}
{\LARGE\bf #1} \\
\vspace{1in}
{\large
   %\\
%\\
%{\sl Ver 1.02 M. Morrison  8-Sep-92} \\
%{\sl Ver 1.03 M. Morrison 18-Sep-92} \\
%{\sl Ver 1.04 M. Morrison 28-Oct-92} \\
%{\sl Ver 1.05 M. Morrison 30-Oct-92} \\
{\sl Ver 1.06 M. Morrison  6-Nov-92} \\
%\\
%{\sl Ver 1.80 M. Morrison 10-Dec-93} \\
%{\sl Ver 1.90 M. Morrison 20-Dec-93} \\
%{\sl Ver 1.91 M. Morrison 21-Dec-93} \\
%{\sl Ver 1.95 M. Morrison  7-Jan-94} \\
%{\sl Ver 1.96 M. Morrison 11-Jan-94} \\
%{\sl Ver 1.97 M. Morrison 12-Jan-94} \\
%{\sl Ver 1.98 M. Morrison 13-Jan-94} \\
%{\sl Ver 1.99 M. Morrison 20-Jan-94} \\
%{\sl Ver 1.995 M. Morrison 21-Jan-94} \\
%{\sl Ver 1.996 M. Morrison 24-Jan-94} \\
{\sl Ver 2.00 M. Morrison 25-Jan-94} \\
%\\
%\\
%\\
%\\
%\\

   \vfill
   {This Copy Printed: \today} \\
}
\vspace{.4in}
LMSC-P098510
\vspace{1in}
\end{center}
\newpage}
%
%
\newcommand{\IItem}{\begin{itemize}\setlength{\itemsep}{0pt}\setlength{\parsep}{0pt}\setlength{\parskip}{0pt}}
\newcommand{\EEnumerate}{\begin{enumerate}\setlength{\itemsep}{0pt}\setlength{\parsep}{0pt}\setlength{\parskip}{0pt}}
% Insert a PostScript plot made by IDL into a LaTex document:
% For the ArborText program dvips.
%
% This macro creates a captioned figure of the specified size
% and uses the \special command to insert the PostScript.
%
% Usage: \insertplot{file}{caption}{label}{width}{height}
% 	file = name of file containing the PostScript.
% 	caption = caption of figure
%	label = latex \label{} for figure to be used by \ref{} macro.
%	width = width of figure in inches.
%	height = height of figure, in inches.
%
%
%
%		Insert a plot..
% Usage: \insertplot{file}{caption}{label}{width in inches}{height}
%
\newcommand{\insertplot}[5]{%
%    \begin{figure}[h]%
    \begin{figure}[btp]%
                \epsfverbosetrue        % if you want to see dimensions
                \epsfxsize=#4 in        % choose x and y dimensions
                \epsfysize=#5 in        
                \epsffile{#1}           % include file%

                \caption{#2}
		\label{#3}

    \end{figure} }
%
%
%
%
%
%
%\hoffset -1.0cm				% Reduce the standard left margin
\setlength{\oddsidemargin}{0.0cm}
\setlength{\evensidemargin}{0.5cm}
\textwidth 6.25 truein		        % Text width
\setlength{\textheight}{8 truein}       % Text length
\makeindex
\begin{document}
               % the reference book and intro
%\begin{titlepage}
%\title{\bf Yohkoh Software and Database \\ Volume 2 \\ Reference Guide }
%\author{
%\input guide_commonv.tex
%}
%\date{This Copy Printed: \today}
%\maketitle
%\end{titlepage}
\yohkohtitlepage{Volume 2: Reference Guide}

%------------------------------------------------------------------------------

%TODO - Mons - Add LPARL at the bottom of the title page - lockheed star too?
\begin{titlepage}

%\vspace{4in}
~
\vfill

\begin{quotation} \noindent {\em The cover shows an image of the Sun
obtained with the Yohkoh Soft X-ray Telescope on 11 November 1991 using
the thin Al filter.  The intensity range of this image varies by over
100,000 as represented by the black-red-white color scheme.  Solar North
is up and East is to the left.  The brightest areas are solar active
regions where sunspots would be seen in visible light; the darkest
regions are coronal holes where the gas density is extremely low and
from which the solar wind emerges. }
\end{quotation}

\end{titlepage}
\pagestyle{headings}
\cleardoublepage % ------------------------------------------------------------------------------
\pagenumbering{roman}

Some suggested reference books, material, and methods of finding more
information:

\begin{itemize}
\item The ``Red'' Book: ``The Yohkoh (Solar-A) Mission,'' Solar Physics,
	Volume 136, No.1 1991
\item The `Blue' Book: Solar-A (M-3SII-6) Engineering Reference Book
	(written in Japanese)
\item The Yohkoh File Control Document (FCD)
\item The Interactive Data Language (IDL) User's Guide
\item See the .INC files which are in the /ys/gen/soft/rel/ref\_access
	directory for details on the definitions of the IDL data structure
	tags and contents.
\item The official Yohkoh IDL software should have a detailed description of
	the routine in the header of the source file.  It is possible to access
	this header from within IDL by using DOC\_LIBRARY.  A sample call
	is:
\idlinputd{doc\_library,'sxt\_prep'}
\end{itemize}


The Yohkoh Analysis Guide is intended as an introduction and quick
reference to the Yohkoh software, databases and instruments.  This document describes
the organization of the software, format of the data, instrument characteristics, and a
list of the most commonly used programs.  

Version 1 of this guide was compiled from information provided by a small number
of people, starting from earlier guides by Keith Strong and
Alan McAllister.

Version 2 of this guide was compiled from contributions provided from
each Yohkoh instrument team and from Co-I's in Japan, the U.K., and the
U.S{}.  The number of individuals is too large to list here, but we are
thankful for each contribution and suggestion.  The LPARL team would
also like to thank Prof.\ Yoshiaki Ogawara, the Yohkoh Project Manager,
for his kind encouragement during the compilation of this guide.  We are
thankful to Drs.\ Loren Acton, George Doschek, James Klimchuk, and John
Mariska who reviewed the final version and made many helpful comments. 

As noted above, this document was compiled from a large number of sources.
In the case of software, it was not always possible to verify the correctness
of the information contained here.  We would welcome any comments or corrections
which can be sent to the E-mail address given below.  Specific questions
or comments will be re-directed to the appropriate individuals as necessary.

The Yohkoh team plans to make future software and documentation updates.
If you would like to register to receive notification of
significant software or instrument calibration updates, please send
your name, postal address, and E-mail address to the E-mail address
shown below.

If you have general comments, suggestions,
or questions regarding this document or software, please send them to:
\begin{quotation} \noindent {\tt software@isass0.solar.isas.ac.jp}
\end{quotation} 


               % the reference book and intro
\newpage
\tableofcontents

\newpage
\listoffigures

\newpage
\prefacepage

This second release of the Yohkoh Analysis Guide breaks the guide
contents into three volumes.  Volume 1 is the {\bf User's Guide} which gives 
step by step instructions on how to do simple analyses of the Yohkoh
data.  For the beginner, this volume should take the user through
the steps on how to read, display, and analyze data.
Examples of the calling sequences for certain routines are shown
in that volume, but each routine is not described in complete detail.
An appendix section describes how to use the Yohkoh software from a remote node.
Volume 2 is the {\bf Reference Guide}. It contains
a more detailed description of many routines.  It also provides a
brief description of each of the instruments (instrument resolutions and energy ranges
as well as the basic modes in which the instruments can be operated).  
The Reference Guide also describes the Yohkoh
data format, the file naming convention (all of those three letter prefixes),
the software organization and how to customize the Yohkoh setup
Volume 3 is the {\bf Instrument Guide}. It contains information on the
peculiarities of each of the instruments.  It is important to understand
how the data are gathered and how some ``non-solar'' artifacts can be created
in the data.  

\newpage

The conventions used in this manual are:
\begin{itemize}
\item Bold face for examples of what the user should type
\item Program names are capitalized when mentioned in the text, but
are not capitalized in the user input examples
\item Variable names are italicized when mentioned in the text
\item Dates and times are in Universal Time (UT) and have the convention ``dd-mmm-yy''
\item There are several different types of prompts that appear in the examples.
The prompt IDL$>$ is used for when the user has already entered and is running
IDL.  The prompt \% is used to signify Unix commands, and the prompt \$ 
signifies VMS commands.  There are also FTP$>$ prompts for `File Transfer
Protocol.'
\end{itemize}

For example, you would only type {\bf .run yodat} for the following User's Guide
description.  You would not type IDL$>$.  Also, for long example strings, the
string might wrap around to the next line.  The user should use a \$ sign to
continue on the next line when necessary (the example on the page might not be
exactly proper).
%
\idlinputa{.run yodat}
%
Some of the IDL routines are marked with a notation surrounded by [ and ].  
The notations are:

\begin{itemize}
\item [{[IDL]}] for standard IDL procedures and functions
\item [{[IDL-LIB]}] for standard IDL user library procedures and functions
\item [{[IDL-YO]}] for standard IDL user library procedures and functions that
were modified by the Yohkoh team.
\item [{[*]}] for Yohkoh software that is user contributed and might not be
completely bug free or checked out by one of the Yohkoh database and
software managers.  These are also routines which might be renamed at some
point in the future.  We would be interested in any problems or errors, but
might not be able to respond and fix them in a timely manner.   However, please
still send mail to \mbox{\tt software@isass0.solar.isas.ac.jp}.  These routines might
also be removed and/or incorporated into other routines.  Please be careful
when using these routines.
\item [{~}]Routines not marked by any of the above are formal Yohkoh procedures
or functions which are fully supported by the Yohkoh team.  If there are
problems or errors with any of these routines, please send mail to:
\mbox{\tt software@isass0.solar.isas.ac.jp}
\end{itemize}

\cleardoublepage
\pagenumbering{arabic}
\raggedbottom
               % table of contents; preface describing the contents/volumes; conventions

\newpage %------------------------------------------------------------------------
\section{Introduction to the Yohkoh Instruments} 

\subsection{Yohkoh Observing Modes}

There are generally two Data Processor (DP) modes when Yohkoh is taking\index{DP (S/C Data Processor)}
scientific data, FLARE mode and QUIET mode.  Yohkoh uses the WBS HXS and
SXS instruments to monitor solar activity and when a threshold is
passed the spacecraft (S/C) enters FLARE mode.  There are times when Yohkoh is in\index{S/C (spacecraft)}
FLARE mode but there is no flare.

There are three different telemetry rates, but only two are used when
observing the sun.  HIGH rate is 32 Kbits/s (a major frame every 2 s) 
and MEDIUM is 4 Kbits/s (a major frame every 16 s).
When first entering FLARE mode, the DP goes into HIGH rate.  After
10 minutes, it will go into MEDIUM rate if the intensity of the flare
has subsided, but is not below a minimum threshold.

\subsection{Bragg Crystal Spectrometer (BCS)}
\index{BCS instrument description}
\index{instrument description, BCS}
\index{cadence, BCS}

\begin{verbatim}
Instrument:                  Bent Crystal Spectrometers
Spectral lines:              Fe XXVI (1.76 - 1.81 A)    (Chan 1)
                             Fe XXV  (1.83 - 1.90 A)    (Chan 2)
                             Ca XIX  (3.16 - 3.19 A)    (Chan 3)
                             S XV    (5.01 - 5.11 A)    (Chan 4)
Spectral resolution (l/dl):  3000 - 8000
Angular resolution:          Full disk
Best time resolution:        0.125 sec
Typical time resolution:     3.0 sec in FLARE/HI
\end{verbatim}

The BCS has the capability to bin the different channels in a variety 
of ways.  Each binning group is defined by a separate ModeID.
For a given ModeID is it possible to determine how the data original
bins were combined before being telemetered to the ground.

\subsection{Hard X-Ray Telescope (HXT)}
\index{HXT instrument description}
\index{instrument description, HXT}
\index{cadence, HXT}
\index{field of view (FOV), HXT}

\begin{verbatim}
Instrument:                Fourier Synthesis Telescope
Energy bands:              (15 - 100 keV, 4 channels)
                           Low       14 - 23 keV
                           Medium-1  23 - 33 keV
                           Medium-2  33 - 53 keV
                           High      53 - 93 keV
Angular resolution:        ~5 arcsec
Effective area:            1.5 cm2 avg. x 64 elements
Field of View:             35 x 35 arcmin
Best time resolution:      0.5 sec
Typical time resolution:   0.5 sec in FLARE/HI
\end{verbatim}

\subsection{Soft X-Ray Telescope (SXT)}
\index{SXT instrument description}
\index{instrument description, SXT}
\index{cadence, SXT}
\index{field of view (FOV), SXT}

\begin{verbatim}
Instrument:          Glancing incidence mirror/CCD sensor
                     Co-aligned optical telescope using same CCD
Wavelength ranges:   2.5-46 A     no analysis filter (or Noback)
                     2.5-36 A     1265 A Al
                     2.4-32 A     2930 A Al, 2070 A Mg, 562 A Mn, 190 A C
                     2.4-23 A     2.52 micron Mg
                     2.4-13 A     11.6 micron Al
                     2.3-10 A     119 micron Be
                     4600-4800 A  Wide band optical filter
                     4290-4320 A  Narrow band optical filter
Spectral discrimination:   Filters
Angular resolution:        3 arcsec
Field of View:             42 x 42 arcmin
Best time resolution:      0.5 sec
Typical time resolution:   2.0 sec in FLARE, 8.0 sec in QUIET
\end{verbatim}

After the failure of an entrance filter in Nov-92, the
narrow band, wide band optical filters, and Noback X-ray filter became unusable.

\subsubsection{Sequence Tables}
\index{sequence tables, SXT}

SXT uses sequence tables to define the order that the images will be taken.
There are thirteen `slots' which are available to set the parameters.  For each
slot a separate filter, resolution and observing region can be
specified.  The observing region selection is from a table of nine entries.
Each entry specifies a location and the size of the output image in
pixels (this means that the field of view is different depending on the
pixel resolution used).

The sequence is started from the beginning whenever the ``SXT CNT AUTO''
command sequence is issued from the ground or by programmed control, or
if the telemetry rate or mode changes.
Therefore, the sequence does not automatically begin at the top at the
beginning of a new orbit, for example.

\newpage
\begin{verbatim}
LOOP 1 (n1=infinity)
                              Img 1-1   --------------------+
   LOOP 2 (n2= )                                            |
                                 Img 2-1   ------------+    |
                                 Img 2-2               |    |
       LOOP 3 (n3= )                                   |    |
                                    Img 3-1   ----+    |    |
                                    Img 3-2       |    |    |
                                    Img 3-3       |    |    |
                                    Img 3-4   ----+ ---+    |
   LOOP 4 (n4= )                                            |
                                 Img 4-1   ------------+    |
                                 Img 4-2               |    |
        LOOP 5 (n5= )                                  |    |
                                    Img 5-1   ----+    |    |
                                    Img 5-2       |    |    |
                                    Img 5-3       |    |    |
                                    Img 5-4   ----+ ---+ ---+
\end{verbatim}

\subsubsection{Automatic Exposure Control (AEC)}

SXT has automatic exposure control (AEC) available for partial frame images.  The
algorithm works on a per observing region basis and runs separately for each 
``slot'' shown in the sequence above (image 3-3 exposure control is independent
of image 5-3, even if they are for the identical filter and location).  An upper and lower intensity, or Data Number (DN), threshold
is set and the number of pixels above and below that threshold is set.  An allowable number of pixels above and
below is also set, and if the image exceeds this set level, then the exposure duration is
shortened or lengthed, depending on whether it is over exposed or under exposed.
See the ``Red Book'' article for more details on the exposure control.\index{SXT exposure control}\index{AEC, SXT}

\subsubsection{Automatic Region Selection (ARS)}

The automatic region selection (ARS) allows two different selection methods.  ARS-1
takes an exposure of the sun and locates the brightest points and selects the brightest
four locations.  Normally the sequence table simply uses the single brightest active
region.  ARS-2 allows the operator to specify a sub-region of the sun, and the tracking
algorithm will point to the brightest region within that sub-region.  ARS-2 is normally
used to force the pointing to stay on a fixed region, and to correct for solar rotation.
See the ``Red Book'' article for more details on the region selection.\index{SXT region selection}\index{ARS, SXT}

\newpage
\subsection{Wide Band Spectrometer (WBS)}
\index{cadence, WBS}

\begin{verbatim}
Instruments:
           Soft X-ray Spectrometer (SXS)
           Hard X-ray Spectrometer (HXS)
           Gamma-ray Spectrometer (GRS)
           Radiation Belt Monitor (RBM)

           SXS: Gas Proportional Counter (3-30 keV (nominal), 128 channels)
           HXS: NaI scintillation counter (20-657 keV, 32 channels)
           GRS: BGO scintillation counter (0.3-100 MeV, 144 channels)
           RBM-SC: RBM NaI Scintillation Detector (5-300 keV)
           RBM-SD: RBM Si Detector (>20 keV)
Angular resolution:     Full disk
Best time resolution:   0.125 sec
\end{verbatim}

Most of the sub-instruments have pulse height (PH) data and pulse
count (PC) data.  PH is essentially a spectrum with counts as a function
of energy, and PC is the sum of all counts for a given energy range.

The structure for the WBS data has numerous tags.  Some of the data tags
and types of data available are listed below.

SXS has two detectors with a 2-channel PC and 128-channel PH for each detector.  The
energies listed below are nominal values.
\index{energy range, WBS-SXS}
\index{instrument description, WBS-SXS}
\index{WBS-SXS instrument description}

\begin{verbatim}
          sxs_pc11 - SXS-1 Detector, chan 1 (3-15 keV) 
          sxs_pc12 - SXS-1 Detector, chan 2 (15-40 keV)
          sxs_pc21 - SXS-2 Detector, chan 1 (3-15 keV) 
          sxs_pc22 - SXS-2 Detector, chan 2 (15-40 keV)

          sxs_ph1  - SXS-1 Detector, 128-channel PH (3-30 keV)
          sxs_ph2  - SXS-2 Detector, 128-channel PH (3-30 keV*)
\end{verbatim}

HXS has a 2-channel PC and a 32-channel PH.
\index{energy range, WBS-HXS}
\index{instrument description, WBS-HXS}
\index{WBS-HXS instrument description}

\begin{verbatim}
          hxs_pc1  - HXS Detector, chan 1 
                         (20-60 keV for 1-Oct-91 to 9-Jun-92)
                         (25-75 keV for 9-Jun-92 to present)
          hxs_pc2  - HXS Detector, chan 2
                         (65 - 657 keV for 1-Oct-91 to 9-Jun-92)
                         (75 - 830 keV for 9-Jun-92 to present)

          hxs_ph   - HXS Detector, 32-channel PH 
                         (20 - 657 keV for 1-Oct-91 to 9-Jun-92)
                         (25 - 830 keV for 9-Jun-92 to present)
\end{verbatim}

GRS has two detectors with a 6-channel PC and a 128-chan PH (16-channel for the
high words) for each detector.
\index{energy range, WBS-GRS}
\index{instrument description, WBS-GRS}
\index{WBS-GRS instrument description}

\begin{verbatim}
          grs_pc11  -  GRS-1 Detector, chan 1 (0.27 - 1.04 MeV)
          grs_pc12  -  GRS-1 Detector, chan 2 (1.04 - 5.47 MeV)
          grs_pc13  -  GRS-1 Detector, chan 3 (5.47 - 9.3   MeV)
          grs_pc14  -  GRS-1 Detector, chan 4 (9.3  - 13.1  MeV)
          grs_pc15  -  GRS-1 Detector, chan 5 (8 - 30 MeV)
          grs_pc16  -  GRS-1 Detector, chan 6 (30 - 100 MeV)

          grs_phl1  -  GRS-1 Detector, 128-chan (0.3 - 13.6 MeV)
          grs_phh1  -  GRS-1 Detector, 16-chan (8 - 100 MeV)

          grs_pc21  -  GRS-2 Detector, chan 1 (0.3 - 1.24 MeV)
          grs_pc22  -  GRS-2 Detector, chan 2 (1.24 - 5.66 MeV)
          grs_pc23  -  GRS-2 Detector, chan 3 (5.66 - 9.37   MeV)
          grs_pc24  -  GRS-2 Detector, chan 4 (9.37  - 13.6  MeV)
          grs_pc25  -  GRS-2 Detector, chan 5 (8 - 30 MeV)
          grs_pc26  -  GRS-2 Detector, chan 6 (30 - 100 MeV)

          grs_phl2  -  GRS-2 Detector, 128-chan (0.3 - 13.6 MeV)
          grs_phh2  -  GRS-2 Detector, 16-chan (8 - 100 MeV)
\end{verbatim}

RBM has two detectors. RBM-SC has 2-channel PC and 32-channel PH,
and RBM-SD has 1-channel PC.

\begin{verbatim}
          rbm_sc_pc1 - NaI scintillation detector (5-60 keV)
          rbm_sc_pc2 - NaI scintillation detector (60-300 keV)
          rbm_sd_pc  - Si detector (>20 keV)
          rbm_sc_ph  - RBM-SC Detector, 32-chan (5-300 keV)
\end{verbatim}
        
\subsection{Spacecraft Attitude Systems}

The attitude control system uses momentum wheels, magnetic torquers, and control-moment 
gyros as the actuators.  As the attitude sensors, two sun sensors and a star
tracker, as well as geomagnetic sensors, are available for determining the spacecraft
pointing relative to the direction of the sun and to the ecliptic plane, respectfully.
An inertial reference unit comprising four gyros detects changes of attitude with time.

\subsubsection{Inertial Reference Unit (IRU)}\index{Inertial Reference Unit (IRU)}\index{gyros}\index{spacecraft gyros}

Four gyros are present on the Yohkoh spacecraft, one each in X, Y and Z and the fourth
one in a 45 degree skew position.  The IRU values are used by the IDL software to
create the attitude (ATT) database.

In Sep-93, it was decided to switch to the X, Y and skew gyros (instead of
X, Y, and Z) because of the high drift rate of the Y gyro.

\subsubsection{Two Dimensional Fine Sun Sensor (TFSS)}

The two dimensional fine sun sensor had a noise problem shortly after launch and
it's usefulness was greatly reduced.

\subsubsection{HXT Aspect Sensor (HXA)}
\index{HXA aspect sensor}
\index{aspect sensor, HXA}

The HXT aspect sensor (HXA) consists of two 1-dimensional CCD arrays located in 
a cross, 90 degrees to each other.  The cross is rotated approximately 45 degrees
relative to the SXT and HXT coordinate system.  The HXA values are used by the IDL
software which creates the attitude (ATT) database.
There are fiducial marks which can reduce the resolution of the HXA results if the
limb coincides with the fiducial mark.

\subsubsection{Attitude Determination Software (ADS)}

The attitude determination software (ADS) runs on the FACOM mainframe at ISAS and
has been found to have noise problems (probably due to the TFSS).  The ATT IDL
database was created to replace the ADS results, which uses the HXA and IRU
raw data.  The ATT database does copy the ADS roll results into the database.

\newpage %------------------------------------------------------------------------
\section{Introduction to the Yohkoh Data and Software}
\index{software tree}
\index{directories, software}

\subsection{YS, YDB, and YDn Directories}

The Yohkoh data are organized into three general parts.  
\begin{itemize}
\item [YS] The software, 
documentation, and some calibration data files are located in the 
Yohkoh Software (YS) tree.
There is a separate branch for each instrument, and one for general software
which holds software and data that can be used by all instruments.
\item [YDB] The secondary database files are contained in the Yohkoh Database
(YDB) tree.  The secondary database files include S/C attitude information,
observing logs, event logs, detailed calibration files, summary data files,
and several ground-based database files.
\item [YD] The raw reformatted Yohkoh data (YD) are placed in the YD directories.
At ISAS, there are twenty one Yohkoh data directories (/yd0, /yd1, /yd2, .... /yd20).
The standard method for putting data on-line is to create a directory with
the week number, for example /yd10/93\_41a and put all the data for week
93\_41 into that directory (except for the weekly files).
\end{itemize}

\subsection{Yohkoh Software Organization}

It is assumed that you have successfully installed the Yohkoh software on
your system or you are using a machine that has the Yohkoh software.  In
addition to having made the software installation, it is necessary to have
executed the Yohkoh initialization routine (`/ys/gen/script/idl\_setup' or
`.yslogin' for the Unix machines).  If you have not done this yet, 
see the Appendix of the Yohkoh Reference Guide.

The Yohkoh software is organized under one tree.  The top directory is \$ys
for Unix systems, and is the logical YS: for the VMS systems.  Under that
tree are the following branches:

\vspace{0.2in}\begin{tabular}{|l|l|} \hline
{\sl Branch} & {\sl Description} \\ \hline
SITE & {Site specific software} \\
GEN  & {General software and documents that all instruments can use} \\
BCS\_F77  & {BCS FORTRAN specific software and documentation} \\
BCS  & {BCS specific software and documentation} \\
HXT  & {HXT specific software and documentation} \\
HXT\_F77  & {HXT FORTRAN specific software and documentation} \\
SXT  & {SXT specific software and documentation} \\
WBS  & {WBS specific software and documentation} \\
ATEST  & {Newly created or modified software and documentation} \\
UCON  & {User Contributed software and documentation} \\ 
IDLFIX & {Work-arounds for systems using older IDL versions} \\ \hline
\end{tabular}\vspace{0.2in}

Under each of the above instrument directories, there are the following 
directories (for example, `/ys/sxt/doc')

\vspace{0.2in}\begin{tabular}{|l|l|} \hline
{\sl Branch} & {\sl Description} \\ \hline
DOC & {Documentation} \\
RESPONSE & {Instrument calibration and response data files} \\
SOFT & {Software} \\
STATUS & {Instrument status information} \\ \hline
\end{tabular}\vspace{0.2in}

Software that has been thoroughly tested is put into the instrument release 
directory `soft'.\footnote{The previous organization had an `atest', `rel', and `usercontrib' branch
under each `soft' directory.}
Software which has just been written, or software that is modified is put into the
`atest' area for a period of a few weeks.  Certain privileged users have write privilege to 
those directories.  If problems develop with modified
software, it is possible to recover the old version by copying it from the
`soft' directory.   The software developed by general users is placed online under
the `ucon' (user contributed) branch.  Generally each user who is contributing has a directory
of their own.  The directories under the `soft' branch are broken up by function for
the `gen' and instrument branchs, but by person under the `ucon' branch.
If a user cannot remember the name of a function, he/she can do a listing on
the different directories and will probably recognize it.  A list of the
directories that currently exist for the instrument teams is:

% LIST_REL.TEX input starts here -------------------------------

\vspace{0.1in}
\begin{tabular}{|l|l|l|l|l|} \hline
{\sl GEN} & {\sl BCS} & {\sl HXT} & {\sl SXT} & {\sl WBS}  \\ \hline
{dbase} & {bda} & {util} & {register} & {util}  \\
{gbo} & {bsc} & {~} & {sensitivity} & {~}  \\
{jhuapl} & {bsd} & {~} & {util} & {~}  \\
{mo\_disk} & {to\_be\_deleted} & {~} & {widgets} & {~}  \\
{movie} & {util} & {~} & {~} & {~}  \\
{orbit} & {~} & {~} & {~} & {~}  \\
{pointing} & {~} & {~} & {~} & {~}  \\
{ref\_access} & {~} & {~} & {~} & {~}  \\
{reformat} & {~} & {~} & {~} & {~}  \\
{spectra} & {~} & {~} & {~} & {~}  \\
{tape} & {~} & {~} & {~} & {~}  \\
{util} & {~} & {~} & {~} & {~}  \\
{utplot} & {~} & {~} & {~} & {~}  \\ \hline
\end{tabular}\vspace{0.2in}

% LIST_REL.TEX input ends here -------------------------------

\subsection{How to Contribute Software to the Yohkoh Tree}

See the appendix of the Reference Guide.

\newpage 

\setlength{\unitlength}{1mm}

\begin{picture}(150,180)
\thicklines
\large\bf
\put(25,170){SOLAR-A reformatted files}

\put(0,0){\framebox(40,10)}
\put(55,5){\makebox(0,0)[l]{Road Map Section}}
\put(0,10){\framebox(40,25)}
\put(55,22){\makebox(0,0)[l]{Optional Data Section}}

\put(0,35){\framebox(40,15)}
\put(15,40){\makebox(0,0)[l]{Data}}
\put(0,45){\dashbox{.5}(40,0)}
\put(10,47){\makebox(0,0)[l]{Data Index}}

\put(0,50){\dashbox{.5}(0,25)}
\put(40,50){\dashbox{.5}(0,25)}
\put(55,73){\makebox(0,0)[l]{Index and Data Section}}

\put(0,75){\framebox(40,20)}
\put(15,82){\makebox(0,0)[l]{Data}}
\put(0,90){\dashbox{.5}(40,0)}
\put(10,92){\makebox(0,0)[l]{Data Index}}
\put(0,95){\framebox(40,15)}
\put(15,100){\makebox(0,0)[l]{Data}}
\put(0,105){\dashbox{.5}(40,0)}
\put(10,107){\makebox(0,0)[l]{Data Index}}

\put(0,110){\framebox(40,10)}
\put(55,115){\makebox(0,0)[l]{Quasi-Static Index Section}}
\put(0,120){\framebox(40,20)}
\put(55,130){\makebox(0,0)[l]{File Header}}
\put(0,140){\framebox(40,15)}
\put(55,147){\makebox(0,0)[l]{File Info/Pointer Section}}

\put(45,0){\dashbox{.5}(65,0)}
\put(45,10){\dashbox{.5}(65,0)}
\put(45,35){\dashbox{.5}(65,0)}
\put(45,110){\dashbox{.5}(65,0)}
\put(45,120){\dashbox{.5}(65,0)}
\put(45,140){\dashbox{.5}(65,0)}
\put(45,155){\dashbox{.5}(65,0)}

\end{picture}


\subsection{Yohkoh Data File Format}
\index{data files, reformatted}
\index{reformatted data files}
\index{file format, archive data}
\index{format, archive data file}
\index{archive data, format of files}
\index{roadmap}

For a full description of the Yohkoh database and all the different data
structures, see the File Control Document.

Each file is logically divided into the following six sections.  Some
files will not use all the sections described below, but all will
have a Pointer and File Header Section.

\EEnumerate
\item File Information and Pointer Section
\item File Header Section
\item Quasi-Static Index Section
\item Index and Data Section
\item Optional Data Section
\item Road Map Section
\end{enumerate}

The program which reads the file learns from the Pointer Section how
to read the rest of the file and where to go to get certain data.  

The File Header Section provides information on what data are contained in
the file, generally the extent of the time covered by the contents. 

The Quasi-Static Section of the file contains index information that
does not vary during the course of an orbit, or varies slowly.  

The Index and Data section contains `data sets'.  A data set is a single \index{data sets}
image for SXT, single spectrum for BCS, a single major frame of data for
HXT, and two major frames of data for WBS (it takes two major frames for
a complete set of WBS data).  For each data set there is an index which
describes the date and time that the data were taken, the
mode and position of the instrument's peripherals (e.g., filters, HV), and
information on temperature and gain information.
\index{index structure}

The Optional Data Section is only used by the BCS data (BDA) files and the
spacecraft attitude (ADA) files.  The BDA files hold the `DP\_SYNC' information,
which is information that is coming down every major frame.  Since the BCS
spectra are asynchronous to the major frames, it is stored separately.  The
ADA file holds the full 2048 point HXA scans.

The Roadmap Section allows a user to access a brief summary of the contents of 
the file and to perform searches on that summary to select what data should be 
extracted.
\index{roadmap structure}

\subsection{Yohkoh Data File Names}

\subsubsection{Yohkoh Directory Logicals/Environment Variables}
\index{directories, database}
\index{environment variables, database}
\index{database, environment variables}

\begin{sloppy}
There is a set of VMS logicals and Unix environment variables which point to 
the database directories.  By using these logicals in all of the access routines
(along with the routine \mbox{CONCAT\_DIR)} it is possible for software to be directly
portable between VMS and Unix machines.  The following is a list of the logicals 
that exist for the Yohkoh database.
\end{sloppy}

\newpage

% LIST_DIR.TEX input starts --------------------------
\begin{tabular}{|l|l|l|} \hline
{\raggedright DIR\_GEN\_ADS} & {\raggedright DIR\_SXT\_ATABLES} & {\raggedright DIR\_BCS\_ATODAT}  \\
{\raggedright DIR\_GEN\_ATR} & {\raggedright DIR\_SXT\_CAL} & {\raggedright DIR\_BCS\_BALDAT}  \\
{\raggedright DIR\_GEN\_ATT} & {\raggedright DIR\_SXT\_CALIBRATE} & {\raggedright DIR\_BCS\_CAL}  \\
{\raggedright DIR\_GEN\_DATA} & {\raggedright DIR\_SXT\_DOC} & {\raggedright DIR\_BCS\_CALDAT}  \\
{\raggedright DIR\_GEN\_DOC} & {\raggedright DIR\_SXT\_ENGIN} & {\raggedright DIR\_BCS\_CAT}  \\
{\raggedright DIR\_GEN\_EVN} & {\raggedright DIR\_SXT\_SDC} & {\raggedright DIR\_BCS\_DOC}  \\
{\raggedright DIR\_GEN\_FEM} & {\raggedright DIR\_SXT\_SDL} & {\raggedright DIR\_BCS\_EXE}  \\
{\raggedright DIR\_GEN\_GBE} & {\raggedright DIR\_SXT\_SDW} & {\raggedright DIR\_BCS\_LOGS}  \\
{\raggedright DIR\_GEN\_GBL} & {\raggedright DIR\_SXT\_SENSITIVE} & {\raggedright DIR\_BCS\_MICRO}  \\
{\raggedright DIR\_GEN\_GEV} & {\raggedright DIR\_SXT\_SFC} & {\raggedright DIR\_BCS\_SYNSPEC}  \\
{\raggedright DIR\_GEN\_GOL} & {\raggedright DIR\_SXT\_SFM} & { }  \\
{\raggedright DIR\_GEN\_GXT} & {\raggedright DIR\_SXT\_SFS} & {\raggedright DIR\_GBO\_TEMP}  \\
{\raggedright DIR\_GEN\_MO} & {\raggedright DIR\_SXT\_SLD} & {~}  \\
{\raggedright DIR\_GEN\_MOVIE} & {\raggedright DIR\_SXT\_SLS} & {~}  \\
{\raggedright DIR\_GEN\_NAR} & {\raggedright DIR\_SXT\_SOT} & {~}  \\
{\raggedright DIR\_GEN\_NEL} & {\raggedright DIR\_SXT\_SSL} & {~}  \\
{\raggedright DIR\_GEN\_NTS} & {\raggedright DIR\_SXT\_SSX} & {~}  \\
{\raggedright DIR\_GEN\_OBD} & {\raggedright DIR\_SXT\_SXA} & {~}  \\
{\raggedright DIR\_GEN\_OBS} & {\raggedright DIR\_SXT\_SXC} & {~}  \\
{\raggedright DIR\_GEN\_ORBIT} & {\raggedright DIR\_SXT\_SXL} & {~}  \\
{\raggedright DIR\_GEN\_ORBIT\_RAW} & {\raggedright DIR\_SXT\_SXL2} & {~}  \\
{\raggedright DIR\_GEN\_ORBIT\_SOL} & {\raggedright DIR\_SXT\_TABLES} & {~}  \\
{\raggedright DIR\_GEN\_ORBIT\_SW} & { } & {~}  \\
{\raggedright DIR\_GEN\_OSF} & {\raggedright DIR\_WBS\_CAL} & {~}  \\
{\raggedright DIR\_GEN\_OSP} & { } & {~}  \\
{\raggedright DIR\_GEN\_OWH} & {\raggedright DIR\_HXT\_CAL} & {~}  \\
{\raggedright DIR\_GEN\_PAN\_LASER} & {\raggedright DIR\_HXT\_EXE} & {~}  \\
{\raggedright DIR\_GEN\_PNT} & {~} & {~}  \\
{\raggedright DIR\_GEN\_SCRIPT} & {~} & {~}  \\
{\raggedright DIR\_GEN\_SETUP} & {~} & {~}  \\
{\raggedright DIR\_GEN\_SETUPD} & {~} & {~}  \\
{\raggedright DIR\_GEN\_SETUPDBACK} & {~} & {~}  \\
{\raggedright DIR\_GEN\_SPECTRA} & {~} & {~}  \\
{\raggedright DIR\_GEN\_STATUS} & {~} & {~}  \\
{\raggedright DIR\_GEN\_SYNOPTIC} & {~} & {~}  \\
{\raggedright DIR\_GEN\_TAPECOPY} & {~} & {~}  \\
{\raggedright DIR\_GEN\_TBB} & {~} & {~}  \\
{\raggedright DIR\_GEN\_XAD} & {~} & {~}  \\
{\raggedright DIR\_GEN\_XBD} & {~} & {~}  \\ \hline
\end{tabular}\vspace{0.2in}
% LIST_DIR.TEX input ends --------------------------

\subsubsection{Yohkoh Prefixes}
\index{YDB files}\index{Yohkoh file prefixes}\index{prefixes}
\index{file prefixes}\index{secondary database files}\index{SFD images}

% MK_PREFIX_TABLE input file start ------------------------

\begin{tabular}{|l|l|l|} \hline
{\sl Prefix} & {\sl Description} & {\sl File Type}\\ \hline
ADA & {\raggedright S/C Attitude Raw Reformatted Data } & {\raggedright per Orbit}\\
ATR & {\raggedright Raw S/C Attitude Database } & {\raggedright Weekly}\\
ATT & {\raggedright Processed S/C Attitude Database } & {\raggedright Weekly}\\ \hline
BDA & {\raggedright BCS Raw Reformatted Data } & {\raggedright per Orbit }\\
BSD & {\raggedright *OLD* BCS Instrument Calibrated Spectra } & {\raggedright User Specified}\\
BPC & {\raggedright *OLD* BSDCAL Output (parameters) } & {\raggedright User Specified}\\
BTH & {\raggedright *OLD* BSDFIT Output (Fitted Spectra) } & {\raggedright User Specified}\\
BFT & {\raggedright *OLD* BSDFIT Output (parameters) } & {\raggedright User Specified}\\
BSC & {\raggedright *NEW* BCS Instrument Calibrated Spectra } & {\raggedright User Specified}\\
BSA & {\raggedright *NEW* Answer File for BSC Generation } & {\raggedright User Specified}\\
BSF & {\raggedright *NEW* Output from Spectral Fitting } & {\raggedright User Specified}\\ \hline
CBA & {\raggedright S/C Common Basic Raw Reformatted Data } & {\raggedright per Orbit }\\ \hline
EVN & {\raggedright Yohkoh Event Log } & {\raggedright Weekly }\\ \hline
FEM & {\raggedright Yohkoh Orbital Ephemeris } & {\raggedright Weekly }\\ \hline
GEV & {\raggedright GOES Event Log } & {\raggedright Weekly }\\
GXT & {\raggedright GOES One Minute Light Curve Data } & {\raggedright Weekly }\\
G6D & {\raggedright GOES 3 Sec Light Curve for S/C 6 } & {\raggedright Weekly}\\
G7D & {\raggedright GOES 3 Sec Light Curve for S/C 7 } & {\raggedright Weekly}\\
GXD & {\raggedright GOES Derived One Minute Light Curve Data } & {\raggedright Weekly }\\ \hline
GBE & {\raggedright GRO BATSE Event Log } & {\raggedright Mission}\\
GBL & {\raggedright GRO BATSE Light Curves } & {\raggedright Weekly}\\ \hline
G\_x & {\raggedright Ground-Based Observation (GBO) Images (Sites) } & {\raggedright per Image (FITS)}\\
Gx\_& {\raggedright Ground-Based Observation (GBO) Images (Data Type) } & {\raggedright per Image (FITS)}\\ \hline
GBC & {\raggedright GBO Big Bear Large Scale H-alpha PFI FITS Image } & {\raggedright per Image (FITS)}\\
GBH & {\raggedright GBO Big Bear H-alpha FITS Image } & {\raggedright per Image (FITS) }\\
GBK & {\raggedright GBO Big Bear Calcium FITS Image } & {\raggedright per Image (FITS) }\\
GBW & {\raggedright GBO Big Bear White Light FITS Image } & {\raggedright per Image (FITS) }\\ \hline
GCH & {\raggedright GBO Boulder Colorado H-alpha FITS Image } & {\raggedright per Image (FITS) }\\
GGH & {\raggedright GBO GSFC H-alpha FITS Image } & {\raggedright per Image (FITS) }\\
GHH & {\raggedright GBO Holloman H-alpha FITS image } & {\raggedright per Image (FITS) }\\
GLH & {\raggedright GBO Leamonth Australia H-Alpha FITS Image } & {\raggedright per Image (FITS) }\\
GNH & {\raggedright GBO NAOJ Japan H-alpha FITS Image } & {\raggedright per Image (FITS) }\\
GJH & {\raggedright GBO CRL Hiraiso H-alpha FITS Image } & {\raggedright per Image (FITS) }\\ \hline
GKI & {\raggedright GBO Kitt Peak He 10830 FITS Image } & {\raggedright per Image (FITS) }\\
GKM & {\raggedright GBO Kitt Peak Magnetogram FITS Image } & {\raggedright per Image (FITS) }\\ \hline
GNP & {\raggedright GBO Nobeyama Polarized Radio Image (17 GHz) } & {\raggedright per Image (FITS) }\\
GNT & {\raggedright GBO Nobeyama Total Intensity Radio Image (17 GHz) } & {\raggedright per Image (FITS) }\\ \hline
GOL & {\raggedright GBO Observing Log } & {\raggedright Weekly}\\ \hline
\end{tabular}
 
\begin{tabular}{|l|l|l|} \hline
{\sl Prefix} & {\sl Description} & {\sl File Type}\\ \hline
HDA & {\raggedright HXT Raw Reformatted Data } & {\raggedright per Orbit }\\
HXI & {\raggedright HXT Synthesized Image } & {\raggedright User Specified}\\ \hline
MDM & {\raggedright Magneto-Optical (MO) Map } & {\raggedright Mission}\\ \hline
NAR & {\raggedright NOAA Active Region } & {\raggedright Weekly }\\ \hline
NEL & {\raggedright Nobeyama Radio Observatory Event Log } & {\raggedright Mission}\\
NTS & {\raggedright Nobeyama Radio Observatory Time Series } & {\raggedright Weekly}\\ \hline
OBS & {\raggedright *OLD* Yohkoh Observing Log } & {\raggedright Weekly }\\
OBD & {\raggedright BCS Observing Log } & {\raggedright Weekly}\\
OSF & {\raggedright SXT Full Frame Observing Log } & {\raggedright Weekly}\\
OSP & {\raggedright SXT Partial Frame Observing Log } & {\raggedright Weekly}\\
OWH & {\raggedright WBS/HXT Observing Log } & {\raggedright Weekly}\\ \hline
PNT & {\raggedright *OLD* S/C Pointing File } & {\raggedright Weekly }\\ \hline
SDL & {\raggedright SXT Dark Current Log } & {\raggedright Weekly }\\
SDC & {\raggedright SXT Dark Current Images } & {\raggedright Weekly (SDA) }\\
SDW & {\raggedright SXT Dark Current Images for Warm CCD } & {\raggedright Weekly (SDA) }\\
SFD & {\raggedright SXT FFI Desaturated Composite Images } & {\raggedright Weekly (SDA) }\\
SFR & {\raggedright SXT FFI Raw Reformatted Data } & {\raggedright per Orbit (SDA) }\\
SFS & {\raggedright SXT FFI Special Images (diffuser, flood...) } & {\raggedright Weekly (SDA) }\\
SFT & {\raggedright SXT FFI Terminator Images } & {\raggedright Weekly (SDA)}\\
SFW & {\raggedright SXT FFI White Light Images } & {\raggedright Weekly (SDA) }\\
SFC & {\raggedright SXT FFI Calibration (Leak) Image } & {\raggedright per Image (SDA)}\\
SFM & {\raggedright SXT FFI Monthly File (daily SFD image) } & {\raggedright Monthly (SDA)}\\
SLS & {\raggedright SXT Leak Scatter Log } & {\raggedright Weekly}\\
SLD & {\raggedright SXT Leak Dark Current Log } & {\raggedright Weekly}\\
SPR & {\raggedright SXT PFI Raw Reformatted Data } & {\raggedright per Orbit (SDA) }\\
SOT & {\raggedright SXT Optical Telescope Log } & {\raggedright Weekly }\\
SSC & {\raggedright SXT Synoptic Images (centered) } & {\raggedright Weekly (SDA) }\\
SSE & {\raggedright SXT Synoptic Images (east of center) } & {\raggedright Weekly (SDA) }\\
SSW & {\raggedright SXT Synoptic Images (west of center) } & {\raggedright Weekly (SDA) }\\
SSL & {\raggedright SXT Summary Log } & {\raggedright Weekly }\\
SXC & {\raggedright SXT X-Ray Sun Center Log } & {\raggedright Weekly}\\
SXL & {\raggedright SXT X-Ray Histogram Log } & {\raggedright Weekly }\\
SXA & {\raggedright SXT X-Ray Average } & {\raggedright Weekly}\\ \hline
WDA & {\raggedright WBS Raw Reformatted Data } & {\raggedright per Orbit }\\ \hline
XAD & {\raggedright Exabyte ASCII Directory for Archive Tape } & {\raggedright Weekly per Tape }\\
XBD & {\raggedright Exabyte Binary Directory for Archive Tape } & {\raggedright Weekly per Tape }\\ \hline
\end{tabular}
 
\vspace{0.2in}
\index{ADA files}
The ADA file has all of the raw pointing information available from
the S/C. It includes 8 Inertial Reference Unit (IRU) values per major
frame (a MF covers 2 sec in high rate), 4 Geomagnetic Attitude Sensor
(GAS) values per MF, 4 Two-Dimensional Fine Sun Sensor (TFSS) values
per MF, 4 Non-Spin Type Attitude Sensor (NSAS) per MF, Star Tracker
(STT) information, and 2 HXT 2-D Aspect Sensor (HXA) values per MF.
The data should be in one of the YDn data directories.
 
\index{ATR files}
The ATR file (eg: atr92\_26a.01) has one dataset per major frame for
each non-night major frame of data available. Each dataset has the
single IRU, TFSS, and HXA values for that major frame, along with
the DP mode and DP rate. The data are in the \$DIR\_GEN\_ATR directory.
 
\index{ATT files}
The ATT file contains the reduced S/C attitude information. The
sun center position is derived for each non-night major frame
using the IRU and HXA data. The coordinate system used is the
center SXT pixel of the sun. The mainframe ground derived
attitude determination software (ADS) results for the S/C
roll are also written into the ATT file. The data are in the
 \$DIR\_GEN\_ATT directory.
 
\index{BDA files}
The BDA files contain the raw reformatted BCS data.
The data should be in one of the YDn data directories.
 
\index{BSD files}
The BSD file is produced by the F77 program MKBSD. It consists
of spectra extracted from the BDA file, with instrument corrections
applied.
 
\index{BPC files}
BPC is an intermediate file which contains fit information
derived by the F77 program BSDCAL that is used by the F77 program
BSDFIT as a first guess for a comparison with synthetic spectra
 
\index{BTH files}
BTH contains parameters describing the synthetic spectral fit
performed by the F77 program BSDFIT to the observations.
 
\index{BFT files}
BFT contains synthetic spectra created during the fit performed
by the F77 program BSDFIT.
 
\index{BSC files}
The BSC file is produced by the IDL routine MK\_BSC. It consists
of spectra extracted from the BDA file, with instrument
corrections applied.
 
\index{BSA files}
BSA is a control file that can be created when preparing to run
the IDL routine MK\_BSC. The information in this file is contined
within the BSC file after it has been generated.
 
\index{BSF files}
BSF files contain fit information derived by FIT\_BSC when making
synthetic spectra.
 
\index{CBA files}
The CBA file contains a full copy of the Basic Part for every major
frame of the telemetry. The Basic Part is the first 4 columns of the
telemetry minor frame and consists of 1/4 of all of the telemetry. The
relevant instrument data are extracted from this part and put into the
instrument files. The data should be in one of the YDn data directories.
 
\index{EVN files}
The EVN file contains an entry for every time there is a change in DP
mode (Quiet/Flare) or when there is a gap in continuous data of more
than one minute. The entry contain information about how many images
and spectra are available for each instrument during that period, the
peak counts for each channel of the instruments, and the location of
the SXT PFI. The data are in the \$DIR\_GEN\_EVN directory.
 
\index{FEM files}
The FEM file has a dataset for each time the S/C has a night to day
transition. The times of any SAA passages and station contacts are
also saved in these files. The files are created using the orbital
solutions which are derived weekly by NASDA. The data are in the
 \$DIR\_GEN\_FEM directory.
 
\index{GEV files}
The GEV file contains the start, stop and peak times of a flare event,
the GOES classification, the H-alpha importance level, the location in
heliocentric coordinates, the NOAA active region number, and the radio
fluxes. This binary file is created from the SELSIS/NOAA text
event files. The data are in the \$DIR\_GEN\_GEV directory.
 
\index{GXT files}
The GXT file contains the one minute average count rate for the GOES-6
and GOES-7 low and high energy channels. This binary file is created
from the tektronics plot files. The data are in the \$DIR\_GEN\_GXT
directory.
 
\index{G6D files}
G6D files hold the digital raw (unprocessed) three second light curve
data for the GOES-6 spacecraft.
The data are in the \$DIR\_GEN\_G6D directory.
 
\index{G7D files}
G7D files hold the digital raw (unprocessed) three second light curve
data for the GOES-7 spacecraft.
The data are in the \$DIR\_GEN\_G6D directory.
 
\index{GXD files}
GXD file is generated from the G6D and G7D files and has information
similar to the GXT file. ** Not Available (Oct-93) **
 
\index{GBE files}
The GBE file contains information on BATSE flare events.
It contains the start time, peak time, end time, BATSE event
number, peak counting rate, and total counts detected.
There were approximately 3880 events between 1-May-91 and 1-Apr-93
The data are in the \$DIR\_GEN\_GBE directory.
 
\index{GBL files}
The GBL file contains the light curves for BATSE flare events.
There were approximately 3880 events between 1-May-91 and 1-Apr-93
The data are in the \$DIR\_GEN\_GBL directory.
 
\index{GNP files}
The Nobeyama polarized radio images (GNP) are copied daily to
the ISAS Yohkoh database. The images are scaled from REAL data
type into BYTE type to save space. A single image per day is
available after Apr-93.
 
\index{GNT files}
The Nobeyama total intensity radio images (GNT) are copied daily
to the ISAS Yohkoh database. The images are scaled from REAL data
type into BYTE type to save space. A single image per day is
available after Apr-93.
 
\index{GOL files}
The GOL file contains an entry for each GBO image available, with
the date/time of the image, the site, the image type, and a
variety of other information. The data are in the \$DIR\_GEN\_GOL
directory.
 
\index{HDA files}
The HDA files contain the raw reformatted HXT data.
The data should be in one of the YDn data directories.
 
\index{MDM files}
The MDM file contains the information on which raw orbital reformatted
data files are written to which magneto-optical (MO) disk. The MDM
file is saved using SAVGEN. The data are in the \$DIR\_GEN\_MO directory.
 
\index{NAR files}
The NAR file contains the NOAA active region number, the location in
heliocentric coordinates, the longitude of active region, the area of
the active region in millionths, the MacIntosh classification, the
longitude extent in degrees, the number of spots and the magnetic
type. The binary file is is created from the SELSIS/NOAA text region
files. The data are in the \$DIR\_GEN\_NAR directory.
 
\index{NEL files}
The NEL file simply tells the user the hours of each day when the
Nobeyama Radio Observatory was observing. The data are in the
 \$DIR\_GEN\_NEL directory.
 
\index{NTS files}
The NTS file has the time series of correlation coefficients for
the Nobeyama Radio Observatory. The data are in the \$DIR\_GEN\_NTS
directory.
 
\index{OBS files}
The observing log (OBS) for all instruments used to be combined in a
single OBS file. In mid-1993 the entries were broken into separate
files for more efficiency.
 
\index{OBD files}
The BCS observing log (OBD) contains an entry for each BCS spectrum
(no more than one every 4 seconds). The entry is created from the
roadmap and DP sync structures. Information on the instrument modes
and the counting rates are available. Light curves or seaches for
certain observing modes can be performed using this log. The data
are in the \$DIR\_GEN\_OBD directory.
 
\index{OSF files}
The SXT full frame observing log (OSF) contains an entry for each
full frame image taken. The entry is a copy of the roadmap and
contains information on the DP mode, filter user, exposure level,
average and peak DN level, and other information. The data are
in the \$DIR\_GEN\_OSF directory.
 
\index{OSP files}
The SXT parital frame observing log (OSP) contains an entry for each
partial frame image taken. The entry is a copy of the roadmap and
contains information on the DP mode, filter user, exposure level,
average and peak DN level, and other information. The data are in
the \$DIR\_GEN\_OSP directory.
 
\index{OWH files}
The WBS and HXT observing log (OWH) are combined together.
There is an entry for every 2 major frames. The entry is created
from the roadmap structure of each instrument. Information on the
instrument modes, as well as the counting rates are available in
each entry. Light curves or searches for certain observing modes
can be performed using the observing log. The data are in the
 \$DIR\_GEN\_OWH directory.
 
\index{PNT files}
The PNT database was replaced by the ATR and ATT databases in
mid-1993. The ATR database holds the raw spacecraft attitude data
and the ATT database holds the processed attitude information.
 
\index{SDL files}
The SDL file contains the histogram for every dark image which is
taken. From the histograms, the average signal and standard
deviation can be calculated. The DN value and location of the 128
brightest dark spikes is also available for every dark image taken.
These are non-image data. The data are in the \$DIR\_SXT\_SDL directory.
 
\index{SDC files}
The SDC file contains the reference dark images to be used for
background subtraction when the CCD is cooled to -21 C. The data
are in the \$DIR\_SXT\_SDC directory.
 
\index{SDW files}
The SDW file contains the reference dark images to be used for
background subtraction when the CCD is not cooled. A separate
image is saved for every unique temperature. The data are in the
 \$DIR\_SXT\_SDW directory.
 
\index{SFD files}
The SFD files (eg: sfd92\_25a.03) are the SXT full-frame desaturated
images (combination of long and short exposures to eliminate
saturation spikes on the CCD). The two exposures must be taken
less than 10 minutes apart, be complete, and not taken during earth
eclipse. The background is subtracted using the nearest available
suitable dark frame and the exposures and resolutions are normalized.
The data are in the \$DIR\_SXT\_SFD directory.
 
\index{SFR files}
The SFR file is the raw data file which contains the full-frame
images. The final SFR files are a single file per orbit, but
the temporary files can span more than an orbit. The data should be
in one of the YDn data directories.
 
\index{SFS files}
The SFS database contains all images taken in compressed mode using
the diffuser, UV flood, or open filter positions. The data are in
the \$DIR\_SXT\_SFS directory.
 
\index{SFT files}
The SFT file contains all of the sunset images. These are images
taken as the S/C goes behind the earth, and the earth's atmosphere
attenuates all the X-rays, leaving a good calibration image of
the pin hole and light leak caused by the Nov-92 entrance filter
failure.
 
\index{SFW files}
The SFW file contains all complete optical images for the week.
 
\index{SFC files}
The SFC file contains reference calibration images to be used to
correct for the scatter and pin hole leak that occurred in Nov-92.
The data are in the \$DIR\_SXT\_SFC directory.
 
\index{SFM files}
The SFM file contains a single SFD image for every day of the month
centered as close to 12:00 UT as possible. The data are in the
 \$DIR\_SXT\_SFM directory.
 
\index{SLS files}
The SLS file contains information on the scattered light signal as
seen through the narrow band filter, DPE=2, dark image. The database
was created after the Nov-92 entrance filter failure. These are
non-image data. The data are in the \$DIR\_SXT\_SLS directory.
 
\index{SLD files}
The SLD file contains information on the dark current signal level as
seen in the DPE=13 dark images. The database was created after the
Nov-92 entrance filter failure. These are non-image data. The data
are in the \$DIR\_SXT\_SLD directory.
 
\index{SPR files}
The SPR file is the raw data file which contains the
parital-frame images. The final SPR files are a single file per
orbit, but the temporary files can span more than an orbit.
The data should be in one of the YDn data directories.
 
\index{SOT files}
The SOT files contain the information on the location of the center
of the sun on the CCD, as well as the signal level detected, for
every complete optical image available. This database allows the
tracking of the optical telescope degradation. These are non-image
data. The data are in the \$DIR\_SXT\_SOT directory.
 
\index{SSC files}
The SSC files contain a narrow strip extracted from the SFD images
which can be processed to make a synoptic image of the sun.
The weekly files are simply narrow strips, but the carrington
rotation files are assembled synoptic maps. The data are in the
 \$DIR\_SXT\_SSX or \$DIR\_GEN\_SYNOPTIC directory.
 
\index{SSE files}
The SSE files contain a narrow strip extracted from the SFD images
which can be processed to make a synoptic image of the sun.
The weekly files are simply narrow strips, but the carrington
rotation files are assembled synoptic maps. The data are in the
 \$DIR\_SXT\_SSX or \$DIR\_GEN\_SYNOPTIC directory.
 
\index{SSW files}
The SSW files contain a narrow strip extracted from the SFD images
which can be processed to make a synoptic image of the sun.
The weekly files are simply narrow strips, but the carrington
rotation files are assembled synoptic maps. The data are in the
 \$DIR\_SXT\_SSX or \$DIR\_GEN\_SYNOPTIC directory.
 
\index{SSL files}
The SSL file contains information on the minimum, maximum, and
average exposure duration measured for every exposure level for
the week, information on the serial numbers and number of
PFI and FFI images taken in quiet and flare mode. It tracks
the number of exposures through each filter and the total
exposure through each filter. It also has the average and
maximum signal through the WBS-SXS, WBS-RBM, and HXT-Low
channels. It tracks the min, max, and avg temperature for
the 15 SXT temperature sensors. These are non-image data. The
data are in the \$DIR\_SXT\_SSL directory.
 
\index{SXC files}
The SXC file is simliar to the SOT file, but for X-ray images.
It takes each one of the SFD images and uses the routine SXT\_CENTER
to find the center of the sun. These are non-image data. The data
are in the \$DIR\_SXT\_SXC directory.
 
\index{SXL files}
The SXL file contains a histogram for every SFD image taken.
From the histogram, the average signal for the whole sun can be
calculated and the solar flux can be plotted for the whole mission.
These are non-image data. The data are in the \$DIR\_SXT\_SXL directory.
 
\index{SXA files}
The SXA file contains the average flux for 50 vertical bands
from the SFD images. This database can be used to evaluate
the amount of X-ray dose the CCD is exposed to as a function
of postion E-W. These are non-image data. The data are in the
 \$DIR\_SXT\_SXA directory.
 
\index{WDA files}
The WDA files contain the pulse count (PC) as well as the pluse
height (PH) (spectral) data taken by the WBS instruments.
The data should be in one of the YDn data directories.
 
\index{XAD files}
The XAD file contains information about what data are contained
on each Exabyte tape. The file format is ASCII. The data are
in the \$DIR\_GEN\_XAD directory.
 
\index{XBD files}
The XBD file contains information about what data are contained
on each Exabyte tape. The file format is binary. The data are
in the \$DIR\_GEN\_XBD directory.
 
 
% MK_PREFIX_TABLE input file end ------------------------
 
\subsubsection{Yohkoh File IDs}\index{file IDs}\index{file names, IDs}

The orbit file ID's are 11 characters long in the format shown below:

\begin{verbatim}
        YYMMDD.HHMM

        where YY - Year of data
              MM - Month of data
              DD - Day of data
              HH - Hours
              MM - Minutes
\end{verbatim}

\subsubsection{Yohkoh Week IDs}\index{week IDs}\index{file names, week IDs}

The Yohkoh week starts on Sunday and ends on Saturday.  CAUTION: Yohkoh
data taken at 00:01 (one minute after midnight) on Sunday morning is
most likely in a file and tape for the previous week since the orbit
started on Saturday and the first full orbit for Sunday has not started. 
Up to the first 90 minutes of data taken on Sunday could be stored in
the previous week, depending on when the spacecraft day begins. 

The weekly IDs are of the form:

\begin{verbatim}

        YY_WWa.NN

        where YY - Year of data
              WW - Week number of the data (1 to 53)
               a - is fixed (reserved for future use)
              NN - is the program version number which created the file

\end{verbatim}

The following are the dates covered by each of the weeks for 1991--1995:

% MK_WEEKID.TEX input starts here ---------------------

{\small
\begin{tabular}{|l|r|r|r|r|r|} \hline
{\sl Week} & {\sl\centering 1991  } & {\sl\centering 1992  } & {\sl\centering 1993  } & {\sl\centering 1994  } & {\sl\centering 1995  } \\ \hline
  01 & {\tt ~1-Jan ~5-Jan} & {\tt ~1-Jan ~4-Jan} & {\tt ~1-Jan ~2-Jan} & {\tt ~1-Jan ~1-Jan} & {\tt ~1-Jan ~7-Jan}\\
  02 & {\tt ~6-Jan 12-Jan} & {\tt ~5-Jan 11-Jan} & {\tt ~3-Jan ~9-Jan} & {\tt ~2-Jan ~8-Jan} & {\tt ~8-Jan 14-Jan}\\
  03 & {\tt 13-Jan 19-Jan} & {\tt 12-Jan 18-Jan} & {\tt 10-Jan 16-Jan} & {\tt ~9-Jan 15-Jan} & {\tt 15-Jan 21-Jan}\\
  04 & {\tt 20-Jan 26-Jan} & {\tt 19-Jan 25-Jan} & {\tt 17-Jan 23-Jan} & {\tt 16-Jan 22-Jan} & {\tt 22-Jan 28-Jan}\\
  05 & {\tt 27-Jan ~2-Feb} & {\tt 26-Jan ~1-Feb} & {\tt 24-Jan 30-Jan} & {\tt 23-Jan 29-Jan} & {\tt 29-Jan ~4-Feb}\\
  06 & {\tt ~3-Feb ~9-Feb} & {\tt ~2-Feb ~8-Feb} & {\tt 31-Jan ~6-Feb} & {\tt 30-Jan ~5-Feb} & {\tt ~5-Feb 11-Feb}\\
  07 & {\tt 10-Feb 16-Feb} & {\tt ~9-Feb 15-Feb} & {\tt ~7-Feb 13-Feb} & {\tt ~6-Feb 12-Feb} & {\tt 12-Feb 18-Feb}\\
  08 & {\tt 17-Feb 23-Feb} & {\tt 16-Feb 22-Feb} & {\tt 14-Feb 20-Feb} & {\tt 13-Feb 19-Feb} & {\tt 19-Feb 25-Feb}\\
  09 & {\tt 24-Feb ~2-Mar} & {\tt 23-Feb 29-Feb} & {\tt 21-Feb 27-Feb} & {\tt 20-Feb 26-Feb} & {\tt 26-Feb ~4-Mar}\\
  10 & {\tt ~3-Mar ~9-Mar} & {\tt ~1-Mar ~7-Mar} & {\tt 28-Feb ~6-Mar} & {\tt 27-Feb ~5-Mar} & {\tt ~5-Mar 11-Mar}\\
  11 & {\tt 10-Mar 16-Mar} & {\tt ~8-Mar 14-Mar} & {\tt ~7-Mar 13-Mar} & {\tt ~6-Mar 12-Mar} & {\tt 12-Mar 18-Mar}\\
  12 & {\tt 17-Mar 23-Mar} & {\tt 15-Mar 21-Mar} & {\tt 14-Mar 20-Mar} & {\tt 13-Mar 19-Mar} & {\tt 19-Mar 25-Mar}\\
  13 & {\tt 24-Mar 30-Mar} & {\tt 22-Mar 28-Mar} & {\tt 21-Mar 27-Mar} & {\tt 20-Mar 26-Mar} & {\tt 26-Mar ~1-Apr}\\
  14 & {\tt 31-Mar ~6-Apr} & {\tt 29-Mar ~4-Apr} & {\tt 28-Mar ~3-Apr} & {\tt 27-Mar ~2-Apr} & {\tt ~2-Apr ~8-Apr}\\
  15 & {\tt ~7-Apr 13-Apr} & {\tt ~5-Apr 11-Apr} & {\tt ~4-Apr 10-Apr} & {\tt ~3-Apr ~9-Apr} & {\tt ~9-Apr 15-Apr}\\
  16 & {\tt 14-Apr 20-Apr} & {\tt 12-Apr 18-Apr} & {\tt 11-Apr 17-Apr} & {\tt 10-Apr 16-Apr} & {\tt 16-Apr 22-Apr}\\
  17 & {\tt 21-Apr 27-Apr} & {\tt 19-Apr 25-Apr} & {\tt 18-Apr 24-Apr} & {\tt 17-Apr 23-Apr} & {\tt 23-Apr 29-Apr}\\
  18 & {\tt 28-Apr ~4-May} & {\tt 26-Apr ~2-May} & {\tt 25-Apr ~1-May} & {\tt 24-Apr 30-Apr} & {\tt 30-Apr ~6-May}\\
  19 & {\tt ~5-May 11-May} & {\tt ~3-May ~9-May} & {\tt ~2-May ~8-May} & {\tt ~1-May ~7-May} & {\tt ~7-May 13-May}\\
  20 & {\tt 12-May 18-May} & {\tt 10-May 16-May} & {\tt ~9-May 15-May} & {\tt ~8-May 14-May} & {\tt 14-May 20-May}\\
  21 & {\tt 19-May 25-May} & {\tt 17-May 23-May} & {\tt 16-May 22-May} & {\tt 15-May 21-May} & {\tt 21-May 27-May}\\
  22 & {\tt 26-May ~1-Jun} & {\tt 24-May 30-May} & {\tt 23-May 29-May} & {\tt 22-May 28-May} & {\tt 28-May ~3-Jun}\\
  23 & {\tt ~2-Jun ~8-Jun} & {\tt 31-May ~6-Jun} & {\tt 30-May ~5-Jun} & {\tt 29-May ~4-Jun} & {\tt ~4-Jun 10-Jun}\\
  24 & {\tt ~9-Jun 15-Jun} & {\tt ~7-Jun 13-Jun} & {\tt ~6-Jun 12-Jun} & {\tt ~5-Jun 11-Jun} & {\tt 11-Jun 17-Jun}\\
  25 & {\tt 16-Jun 22-Jun} & {\tt 14-Jun 20-Jun} & {\tt 13-Jun 19-Jun} & {\tt 12-Jun 18-Jun} & {\tt 18-Jun 24-Jun}\\
  26 & {\tt 23-Jun 29-Jun} & {\tt 21-Jun 27-Jun} & {\tt 20-Jun 26-Jun} & {\tt 19-Jun 25-Jun} & {\tt 25-Jun ~1-Jul}\\
  27 & {\tt 30-Jun ~6-Jul} & {\tt 28-Jun ~4-Jul} & {\tt 27-Jun ~3-Jul} & {\tt 26-Jun ~2-Jul} & {\tt ~2-Jul ~8-Jul}\\
  28 & {\tt ~7-Jul 13-Jul} & {\tt ~5-Jul 11-Jul} & {\tt ~4-Jul 10-Jul} & {\tt ~3-Jul ~9-Jul} & {\tt ~9-Jul 15-Jul}\\
  29 & {\tt 14-Jul 20-Jul} & {\tt 12-Jul 18-Jul} & {\tt 11-Jul 17-Jul} & {\tt 10-Jul 16-Jul} & {\tt 16-Jul 22-Jul}\\
  30 & {\tt 21-Jul 27-Jul} & {\tt 19-Jul 25-Jul} & {\tt 18-Jul 24-Jul} & {\tt 17-Jul 23-Jul} & {\tt 23-Jul 29-Jul}\\
  31 & {\tt 28-Jul ~3-Aug} & {\tt 26-Jul ~1-Aug} & {\tt 25-Jul 31-Jul} & {\tt 24-Jul 30-Jul} & {\tt 30-Jul ~5-Aug}\\
  32 & {\tt ~4-Aug 10-Aug} & {\tt ~2-Aug ~8-Aug} & {\tt ~1-Aug ~7-Aug} & {\tt 31-Jul ~6-Aug} & {\tt ~6-Aug 12-Aug}\\
  33 & {\tt 11-Aug 17-Aug} & {\tt ~9-Aug 15-Aug} & {\tt ~8-Aug 14-Aug} & {\tt ~7-Aug 13-Aug} & {\tt 13-Aug 19-Aug}\\
  34 & {\tt 18-Aug 24-Aug} & {\tt 16-Aug 22-Aug} & {\tt 15-Aug 21-Aug} & {\tt 14-Aug 20-Aug} & {\tt 20-Aug 26-Aug}\\
  35 & {\tt 25-Aug 31-Aug} & {\tt 23-Aug 29-Aug} & {\tt 22-Aug 28-Aug} & {\tt 21-Aug 27-Aug} & {\tt 27-Aug ~2-Sep}\\
  36 & {\tt ~1-Sep ~7-Sep} & {\tt 30-Aug ~5-Sep} & {\tt 29-Aug ~4-Sep} & {\tt 28-Aug ~3-Sep} & {\tt ~3-Sep ~9-Sep}\\
  37 & {\tt ~8-Sep 14-Sep} & {\tt ~6-Sep 12-Sep} & {\tt ~5-Sep 11-Sep} & {\tt ~4-Sep 10-Sep} & {\tt 10-Sep 16-Sep}\\
  38 & {\tt 15-Sep 21-Sep} & {\tt 13-Sep 19-Sep} & {\tt 12-Sep 18-Sep} & {\tt 11-Sep 17-Sep} & {\tt 17-Sep 23-Sep}\\
  39 & {\tt 22-Sep 28-Sep} & {\tt 20-Sep 26-Sep} & {\tt 19-Sep 25-Sep} & {\tt 18-Sep 24-Sep} & {\tt 24-Sep 30-Sep}\\
  40 & {\tt 29-Sep ~5-Oct} & {\tt 27-Sep ~3-Oct} & {\tt 26-Sep ~2-Oct} & {\tt 25-Sep ~1-Oct} & {\tt ~1-Oct ~7-Oct}\\
  41 & {\tt ~6-Oct 12-Oct} & {\tt ~4-Oct 10-Oct} & {\tt ~3-Oct ~9-Oct} & {\tt ~2-Oct ~8-Oct} & {\tt ~8-Oct 14-Oct}\\
  42 & {\tt 13-Oct 19-Oct} & {\tt 11-Oct 17-Oct} & {\tt 10-Oct 16-Oct} & {\tt ~9-Oct 15-Oct} & {\tt 15-Oct 21-Oct}\\
  43 & {\tt 20-Oct 26-Oct} & {\tt 18-Oct 24-Oct} & {\tt 17-Oct 23-Oct} & {\tt 16-Oct 22-Oct} & {\tt 22-Oct 28-Oct}\\
  44 & {\tt 27-Oct ~2-Nov} & {\tt 25-Oct 31-Oct} & {\tt 24-Oct 30-Oct} & {\tt 23-Oct 29-Oct} & {\tt 29-Oct ~4-Nov}\\ \hline
\end{tabular}
\newpage
\begin{tabular}{|l|r|r|r|r|r|} \hline
{\sl Week} & {\sl\centering 1991  } & {\sl\centering 1992  } & {\sl\centering 1993  } & {\sl\centering 1994  } & {\sl\centering 1995  } \\ \hline
 
  45 & {\tt ~3-Nov ~9-Nov} & {\tt ~1-Nov ~7-Nov} & {\tt 31-Oct ~6-Nov} & {\tt 30-Oct ~5-Nov} & {\tt ~5-Nov 11-Nov}\\
  46 & {\tt 10-Nov 16-Nov} & {\tt ~8-Nov 14-Nov} & {\tt ~7-Nov 13-Nov} & {\tt ~6-Nov 12-Nov} & {\tt 12-Nov 18-Nov}\\
  47 & {\tt 17-Nov 23-Nov} & {\tt 15-Nov 21-Nov} & {\tt 14-Nov 20-Nov} & {\tt 13-Nov 19-Nov} & {\tt 19-Nov 25-Nov}\\
  48 & {\tt 24-Nov 30-Nov} & {\tt 22-Nov 28-Nov} & {\tt 21-Nov 27-Nov} & {\tt 20-Nov 26-Nov} & {\tt 26-Nov ~2-Dec}\\
  49 & {\tt ~1-Dec ~7-Dec} & {\tt 29-Nov ~5-Dec} & {\tt 28-Nov ~4-Dec} & {\tt 27-Nov ~3-Dec} & {\tt ~3-Dec ~9-Dec}\\
  50 & {\tt ~8-Dec 14-Dec} & {\tt ~6-Dec 12-Dec} & {\tt ~5-Dec 11-Dec} & {\tt ~4-Dec 10-Dec} & {\tt 10-Dec 16-Dec}\\
  51 & {\tt 15-Dec 21-Dec} & {\tt 13-Dec 19-Dec} & {\tt 12-Dec 18-Dec} & {\tt 11-Dec 17-Dec} & {\tt 17-Dec 23-Dec}\\
  52 & {\tt 22-Dec 28-Dec} & {\tt 20-Dec 26-Dec} & {\tt 19-Dec 25-Dec} & {\tt 18-Dec 24-Dec} & {\tt 24-Dec 30-Dec}\\
  53 & {\tt 29-Dec 31-Dec} & {\tt 27-Dec 31-Dec} & {\tt 26-Dec 31-Dec} & {\tt 25-Dec 31-Dec} & {\tt 31-Dec 31-Dec}\\ \hline
\end{tabular}
}
\normalsize

% MK_WEEKID.TEX input ends here ---------------------

\subsubsection{Yohkoh Carrington IDs}\index{carrington IDs}

The Carrington IDs are of the form:

\begin{verbatim}
        _crRRRRa.NN

      where cr   - signifies a Carrington Rotation ID
            RRRR - is the rotation number
             a   - is fixed (reserved for future use)
            NN   - is the program version number which created the file
\end{verbatim}
%
\noindent The dates for the Carrington Rotations are defined in the
table.

\begin{figure}[tbp]
\begin{tabular}{|c|r||c|r|} \hline
{\sl Carrington Rotation} & {\sl Starting Date} & {\sl Carrington Rotation} & {\sl Starting Date} \\ \hline
  1846 & {\tt 21-AUG-91}  &   1876 & {\tt 17-NOV-93} \\
  1847 & {\tt 18-SEP-91}  &   1877 & {\tt 14-DEC-93} \\
  1848 & {\tt 15-OCT-91}  &   1878 & {\tt 10-JAN-94} \\
  1849 & {\tt 11-NOV-91}  &   1879 & {\tt ~6-FEB-94} \\
  1850 & {\tt ~8-DEC-91}  &   1880 & {\tt ~6-MAR-94} \\
  1851 & {\tt ~5-JAN-92}  &   1881 & {\tt ~2-APR-94} \\
  1852 & {\tt ~1-FEB-92}  &   1882 & {\tt 29-APR-94} \\
  1853 & {\tt 28-FEB-92}  &   1883 & {\tt 26-MAY-94} \\
  1854 & {\tt 26-MAR-92}  &   1884 & {\tt 23-JUN-94} \\
  1855 & {\tt 23-APR-92}  &   1885 & {\tt 20-JUL-94} \\
  1856 & {\tt 20-MAY-92}  &   1886 & {\tt 16-AUG-94} \\
  1857 & {\tt 16-JUN-92}  &   1887 & {\tt 13-SEP-94} \\
  1858 & {\tt 14-JUL-92}  &   1888 & {\tt 10-OCT-94} \\
  1859 & {\tt 10-AUG-92}  &   1889 & {\tt ~6-NOV-94} \\
  1860 & {\tt ~6-SEP-92}  &   1890 & {\tt ~3-DEC-94} \\
  1861 & {\tt ~3-OCT-92}  &   1891 & {\tt 31-DEC-94} \\
  1862 & {\tt 31-OCT-92}  &   1892 & {\tt 27-JAN-95} \\
  1863 & {\tt 27-NOV-92}  &   1893 & {\tt 23-FEB-95} \\
  1864 & {\tt 24-DEC-92}  &   1894 & {\tt 23-MAR-95} \\
  1865 & {\tt 20-JAN-93}  &   1895 & {\tt 19-APR-95} \\
  1866 & {\tt 17-FEB-93}  &   1896 & {\tt 16-MAY-95} \\
  1867 & {\tt 16-MAR-93}  &   1897 & {\tt 12-JUN-95} \\
  1868 & {\tt 12-APR-93}  &   1898 & {\tt 10-JUL-95} \\
  1869 & {\tt 10-MAY-93}  &   1899 & {\tt ~6-AUG-95} \\
  1870 & {\tt ~6-JUN-93}  &   1900 & {\tt ~2-SEP-95} \\
  1871 & {\tt ~3-JUL-93}  &   1901 & {\tt 29-SEP-95} \\
  1872 & {\tt 30-JUL-93}  &   1902 & {\tt 27-OCT-95} \\
  1873 & {\tt 27-AUG-93}  &   1903 & {\tt 23-NOV-95} \\
  1874 & {\tt 23-SEP-93}  &   1904 & {\tt 20-DEC-95} \\
  1875 & {\tt 20-OCT-93}  &   1905 & {\tt 17-JAN-96} \\ \hline
\end{tabular}
\end{figure}

\subsection{Interactive Data Language (IDL)}
\index{IDL}

Most of the Yohkoh software is written in the programming language IDL of
Research Systems, Inc (RSI).
If certain rules are followed, then the same IDL software can be run on
a wide variety of computers.

\subsubsection{Some Comments about IDL}

In using IDL it is very easy to create too many variables to the point where
the computer memory capacity is exceeded.
It is possible to delete old
variables by using the DELVAR command.  For example, if you wanted to delete
the variable DATA, you would type:
%
\idlinputa{delvar, data} \index{DELVAR}
%
There is a peculiarity about using the IDL routine FINDFILE and using the
Unix symbol $\sim$ for the user's home directory.  FINDFILE does not return any
files when using the command:
%
\idlinputa{ff = findfile('$\sim$/*')} \index{FINDFILE}
%
It is recommended to use the full path (for example `/2p/morrison/*') instead
of $\sim$.

\newpage
It is possible to change the default directory from within IDL by using
the IDL command ``cd''.  Some sample commands are:
%
\idlinputa{cd, '$\sim$'}\index{CD}\index{setting default directory}
\idlinputb{cd, '/yd3'}
%
The following will NOT work since it sets the default for the sub-process
and then exits that process.
%
\idlinputA{1.5}{\$ cd /yd3}{;WILL NOT WORK}

For Unix machines, it is possible to press {\it control-z} to place an
IDL session in the background so that you can do some work from the Unix
system.  When you are ready to go back to the IDL session, type:
%
\ultrixinputa{fg}
%
Be careful to remember that you have an IDL session hidden in the background
since you can waste memory and corrupt the color table settings if you 
have multiple IDL sessions going.

\subsubsection{Programs, Procedures, and Functions}

An IDL main program requires a .RUN command to run, and the code within that
file starts executing after successful compilation.

An IDL procedure is a kind of subroutine and has something like \\
\mbox{\hspace{1.in}{\tt PRO PROCEDURE\_NAME, PARAM1, PARAM2}} \\
at the top of the file.  The variables in the procedure definition can be input
or output.  It is possible to have keywords with a command like \\
\mbox{\hspace{1.in}{\tt PRO PROCEDURE\_NAME, KEY1=KEY1, KEY2=KEY2}} \\
It can be executed with a command like:
%
\idlinputa{procedure\_name, a, b}
\idlinputb{procedure\_name, a, b, key1=c}
%
An IDL function is another kind of subroutine and has something like \\
\mbox{\hspace{1.in}{\tt FUNCTION FUNCTION\_NAME, PARAM1, PARAM2}} \\
at the top of the file.  The primary output is passed to {\it result}
but it is possible to have parameters in the call which can receive output.
It is executed with a command like:
%
\idlinputd{result = function\_name(a,b)}
%

\subsubsection{Running IDL programs}

When running on a Unix system, it is important to use lower case when using
the .RUN command because Unix is case sensitive.  This is not necessary when
doing an `implied' compilation when accessing procedures or functions since
IDL will convert to lower case for you.  You cannot use upper case for a
procedure to do an explicit compilation (.RUN PROCEDURE\_NAME) to recompile 
a procedure.

\newpage %------------------------------------------------------------------------
\section{General Yohkoh Software}

\subsection{Routines for Reading and Saving Data}

\subsubsection{RD\_XDA, RD\_xxx} 
\index{RD\_BDA}
\index{RD\_HDA}
\index{RD\_SDA}
\index{RD\_WDA}
\index{RD\_XDA}

The RD\_xxx routines (RD\_BDA, RD\_HDA, RD\_SDA, RD\_WDA, RD\_XDA) 
allow you to read the reformatted data files.  Each
routine has the same calling sequence, and there is a generic reading routine
called RD\_XDA which will read data for any of the instruments.  After you have
established the input file name(s) ({\it infil}) and which data sets to 
extract ({\it dset\_arr}), you can read the data by a command:
%
\idlinputa{rd\_sda, infil, dset\_arr, index, data}	
\idlinputb{rd\_sda, infil, dset\_arr, index, data, roadmap}	 \index{RD\_SDA}
\idlinputb{rd\_xda, infil, -1, index, /nodata}
%
{\it index} is a structure which describes the data.  There is one index structure
for each dataset.  The roadmap is for all datasets in the files (not just
the selected datasets).  It is possible to read all datasets in the file
by specifying -1 for {\it dset\_arr}.  The {\it /nodata} switch tells the routine
to only read the index and roadmap, not the data.

\subsubsection{RD\_ROADMAP}
\index{roadmap}

RD\_ROADMAP will read the roadmap from a file (or list of files) by typing:
%
\idlinputa{rd\_roadmap,infil,roadmap,ndset} \index{RD\_ROADMAP}
%
where {\it infil} is a string array of file names.  The roadmap
variable is the same as you get from YODAT

\subsubsection{RD\_QS} \index{RD\_QS}

RD\_QS will read the quasi-static portion of a single reformatted file.  A
sample calling sequence is:
%
\idlinputd{rd\_qs, infil, qs}
%
\subsubsection{SAVEGEN and RESTGEN} \index{SAVEGEN}
\index{GENX files, reading/writing}

SAVEGEN is a routine available to save variables of any type (including structures).
Some sample calls are shown below.  If no file name is specified, it will use
`save.genx'.
%
\idlinputa{savegen, var1, var2}	
\idlinputb{savegen, var1, var2, var3, var4, var5, file='flare27oct92'}
%
Use RESTGEN to restore the data.  NOTE: It is recommended to use 
SAV\_SDA, SAV\_BDA, SAV\_BSC, and SAV\_HXI whenever possible for standard
SXT, BCS, and HXI data sets.  

\subsubsection{SAV\_SDA}
\index{SXT archive files, writing}

SDA\_SDA will store an index and data array in an SDA format file.  The
data array can be byte, integer*2, integer*4 or real*4.  The dimensions of
the image do not have to be the original dimensions.  A sample is:
%
\idlinputa{sav\_sda, outfil, index, data}	\index{SAV\_SDA}
\idlinputb{sav\_sda, outfil, index, data, qs}
%
where {\it outfil} is the name of the file you wish to store the data in.  If you
wish to append to an existing file, then you can use the /APPEND switch. For
example:
%
\idlinputa{sav\_sda, outfil, index, data, /append}
%
Use RD\_SDA to restore the data.

\subsubsection{SAV\_BDA and SAV\_BSC}
\index{BCS archive files, writing}

SAV\_BDA and SAV\_BSC work in the same manner as SAV\_SDA but for
raw BDA data or BSC processed data.  Sample calls would be:
%
\idlinputa{sav\_bda, outfil, index, data, qs, dp\_sync} \index{SAV\_BDA} 
\idlinputc{sav\_bsc, outfil, index, data} \index{SAV\_BSC} 
%
\subsubsection{SAV\_HXI}

SAV\_HXI allows you to save HXT synthesized images.  A sample call would be:
%
\idlinputd{sav\_hxi, outfil, index, data} \index{SAV\_HXI} 
%
\subsubsection{SAVE [IDL]}

SAVE is an IDL facility that will save variables, etc.  into a file of
your choice.  To save a variables {\it a}, {\it b}, and {\it c} to the default file 
`idlsave.dat', type:
%
\idlinputa{save, a, b, c} \index{SAVE}
%
To save to the file `junk.save', type:
%
\idlinputa{save, a, b, c, filename='junk.save'}
%
To save all variables, type:
%
\idlinputa{save, /all, filename='junk.save'}
%
CAUTION: When restoring the data, the variable names are restored exactly
as they were saved, so if you saved {\it a, b} and {\it c}, then when you restore that
save set, any existing variables {\it a, b} and {\it c} are deleted when the
restore occurs.  A sample command to restore data is:
%
\idlinputd{restore, 'junk.save'} \index{RESTORE} 
%
\subsubsection{TIFF\_WRITE [IDL-LIB]}
\index{TIFF files, writing}

To write some image data ({\it image}) to a file ({\it outfile}) in TIFF format all
you have to do is type the following for grey scale:
%
\idlinputa{tiff\_write, outfil, image} \index{TIFF\_WRITE}
%
For 256 element (pseudo) color, use:
%
\idlinputa{tiff\_write, outfil, image, red=r, green=g, blue=b} \index{TIFF\_WRITE}
%
where the optional parameters red, green and blue are used to save the
color table characterized by the byte arrays (r, g, b - see TVLCT for
details about obtaining them). 

To make full (24 bit) color TIFF format files see the documentation
for TIFF\_WRITE (i.e. use the DOC\_LIBRARY utility on TIFF\_WRITE).

\subsubsection{MK\_TIFFB}

To make full (24 bit) color TIFF format files to be read on Macintosh
computers use:
%
\idlinputa{mk\_tiffb, outfile, image, r, g, b} \index{MK\_TIFFB}
%
where the required color table is specified by 256 element byte arrays
{\it r, g, b}.  The output TIFF file contains the specified image which has been
flipped vertically for direct display on (most) tiff-readers on the Macintosh
and has a resolution of 100 pixels per inch.  The default output file size
is 774 Kbytes which results from rebinning into image to 508$\times$508 and fits on
the standard double sided Mac floppies (779 Kbytes capacity).  For more
options (such as changing image size which is 508$\times$508 by default, noflip, etc.)
or information on MK\_TIFFB use the DOC\_LIBRARY utility.

\subsubsection{WRT\_FITS [*]}
\index{FITS files, writing}

WRT\_FITS creates a FITS file from an image ({\it data}) by typing: \index{FITS files}
%
\idlinputa{wrt\_fits, outfil, header, data(*,*,n)} \index{WRT\_FITS}
%
where {\it outfil} is the string containing the filename.  {\it header} is optional
input which is the FITS string array ASCII header.  If it is undefined, then
WRT\_FITS will build the minimal header.  The routine RFITS should be used
to read it.  For SXT data, we recommend that you use SXT2FITS which is
described in the next section.

\subsubsection{SXT2FITS}

It is possible to take an SXT data file or an {\it index} and {\it data} that has
already been read in, and write a single FITS file for each image.  The
FITS header has all of the information on the date and time, the filters
used, the exposure duration, the resolution, and the DP mode and rate.  The
following command will create a file for each image in the {\it data} array: \index{FITS files}
%
\idlinputa{sxt2fits, index, data} \index{SXT2FITS}
%
The default file names are SF\_FITSyymmdd.hhmmss and 
SP\_FITSyymmdd.hhmmss for FFI and PFI images, respectively.  If a single output file name is passed
to the SXT2FITS routine, but there are several images to save, then it will
append an image number to the end of the file name.  In the following example,
the input array is 512$\times$512$\times$3, so it will create the files `flare.0001', `flare.0002'
and `flare.0003'.
%
\idlinputa{sxt2fits, index, data, outfil='flare'}
%
It is possible to specify an input file name in which case all images in that
file will have FITS files created.  It is also possible to specify a list
of the images to be saved.  Some examples of these calls are:
%
\idlinputa{sxt2fits, index, data, ss=ss}	
\idlinputb{sxt2fits, infil=infil}	
\idlinputc{sxt2fits, infil=infil, ss=ss}
%

\subsubsection{SAVESYS and RESTSYS}\index{system variables}\index{IDL system variables}\index{SAVESYS}\index{RESTSYS}

SAVESYS and RESTSYS provide a simple method for saving and restoring
the state of IDL system variables.  Use of this routine pair will help
programmers avoid global side effects within routines which change
system variables.  In general, the use of these routines should be done
symmetrically within a given routine as the following example dummy code 
segment illustrates.

\begin{verbatim}
        pro junk,a,b,c	       ; function or procedure definition
        savesys,/aplot         ; *** save plot variables with savesys.pro
        <change !x,!y,!z,!p>   ; code which changes IDL system variables
        restsys,/aplot         ; *** restore plot variables with restsys.pro
        return
        end
\end{verbatim}

Another use of restsys.pro is to restore IDL system variables to the startup
state to recover from routines which corrupted the system variables.
%
\idlinputD{2.5}{restsys, /init, /all    }{ ; restore IDL system variables to startup state}

\subsection{Concatenation of Datasets}

\subsubsection{STR\_CONCAT\_TAGS}
\index{structures, concatenating}
\index{concatenating structures}

It is possible to concatenate two structures of same or similar type
by using STR\_CONCAT\_TAGS.  For example, if you wanted to concatenate
the variable {\it index1} and {\it index2}, the command would be:
%
\idlinputd{index\_out = str\_concat\_tags(index1, index2)} \index{STR\_CONCAT\_TAGS} 
%
\subsubsection{Concatenating Data Arrays}
\index{data arrays, concatenating}
\index{concatenating data arrays}

A sample command for concatenating two 3-D arrays is:
%
\idlinputa{out = [[[in1]],[[in2]]]}
%
If {\it in1} is 100$\times$200$\times$4 and {\it in2} is 100$\times$200$\times$3, then {\it out} would be 100$\times$200$\times$7.
The first two dimensions of {\it in1} and {\it in2} must be identical.  It is possible
to have {\it in2} be 100$\times$200, in which case {\it out} would be 100$\times$200$\times$5.

A sample command for concatenating two 2-D arrays is:
%
\idlinputa{out = [[in1],[in2]]}
%
If {\it in1} was 100$\times$10 and {\it in2} was 100$\times$20, then {\it out} would be 100$\times$30.  In this
case, the first dimension of {\it in1} and {\it in2} must match.

\subsection{Routines for Data Selection}

\subsubsection{TIM2DSET}
\index{time, searching for closest}
\index{data selection, time}

TIM2DSET will take the roadmap and return the dataset number which is
closest to that time.  Examples,
%
\idlinputa{dset = tim2dset(roadmap, input\_times)}	\index{TIM2DSET}
\idlinputc{dset = tim2dset(roadmap, '23-jun-92 6:00')} 
%
\subsubsection{WDEFROI [*]}
\index{light curves, plotting from data cubes}
\index{sub-image extraction}

The WDEFROI function allows the user to select an arbitrarily shaped
region-of-interest (ROI) from a displayed image via the mouse.  
The routine returns either a sub-image or a list of indices to 
the image displayed which defines this sub-image.  If a data 
cube is passed the routine returns either a sub-image data cube
or 2-dimensional list of indices.  NOTE, WDEFROI is not SXT 
specific and thus will also work for ground base images.

Some example calls are:
%
\idlinputa{list = wdefroi( data, zoom=8)}\index{WDEFROI}
\idlinputb{sub\_image = wdefroi( data, zoom=8, /image)}
\idlinputb{list = wdefroi( data, zoom=zoom, /lc, time=time, sub=sub, /logscale)}
%
where,

\vspace{0.2in}\begin{tabular}{lp{10.0cm}}
	INPUT: & { } \\
	data	& {\raggedright Data array for the input image.  If image is 
		a data cube: one needs to specify which image 
		(see the {\it sub} parameter) to display for selecting an ROI.}\\
	{ } & { } \\
\end{tabular}

\begin{tabular}{lp{10.0cm}}
	OPTIONAL INPUT: & { } \\
	zoom	& {\raggedright is the zoom factor used on the displayed image.}\\
	image	& {\raggedright if set will return selected sub-image.}\\
	lc	& {\raggedright if set and a data cube is given, this will allow user 
		to plot light curves of the ROIs.  NOTE: if you pass
		normalized data these light curves will be more
		meaningful.}\\
	time	& {\raggedright time of each image in data cube. This can also be 
		a Yohkoh index data record (e.g. SXT index-data record).}\\
	sub	& {\raggedright is the image index number to use for ROI selection
		if the input data are a data cube.  Note: if you
		do not specify a {\it sub} while using a data cube the
		routine starts STEPPER to allow the user to 
		select an image on-the-fly.}\\
	logscale & {\raggedright if set, will log scale the (decompressed) data for display.}\\
	{ } & { } \\
\end{tabular}

\begin{tabular}{lp{10.0cm}}
	OUTPUT: & { } \\
	sub\_img & {\raggedright  is the returned SUB-image(s) of the selected region
		(when the {\it /image} switch is used).}\\
	list	& {\raggedright is the returned list of selected indices of the 
		input image(s) (default return).}\\
\end{tabular}

(A) PFI Example: An example of selecting a feature from a 64$\times$64 pfi image:
Follow the instructions displayed on the widget.
%
\idlinputa{nimage = wdefroi(data, /image, zoom=8)}
%

(B) FFI Example An example of selecting a small feature from a 512x512 image:
Due to the fact that contouring a large image is a very slow
process do not attempt to contour a 512 $\times$ 512 image directly 
but rather use the ``Box'' and ``select'' features to first isolate
the area of interest before using the ``contour'' feature.  NOTE:
the ``contour'' feature can still be somewhat slow after isolating a 
part of FFI.  Follow the instructions displayed on the widget.
%
\idlinputa{sub\_img = wdefroi(img,/image)	;default zoom is 1}

(C) PFI Data Cube Example: An example of selecting a feature from a cube aligned PFI data set
which has the dimensions of 65x65 by 40 images.  The first line makes a buffer for
the normalized data.  The second line puts the exposure normalized data into {\it dat}.
The last line uses the ``light curve'' option and passes the index information 
for the image times.
%
\idlinputa{dat = fltarr(65,65,40)}
\idlinputb{for i=0,39 do dat(0,0,i) = data(*,*,i)/gt\_expdur(index(i))}
\idlinputb{sub\_img = wdefroi(dat,zoom=7,/image,time=index,/lc)}
%
The function starts the STEPPER routine to allow user to select image.  Once the
user ``quits'' STEPPER the WDEFROI widget will appear.  Select a
``box'' ROI and use the mouse make the selection (use the right mouse
button to finalize the selection).  Use the light curve button to
display a time profile of the total intensity from the selected ROI.
Select ``Exit'' to finalize your selection.  Then run STEPPER on the
newly made SUB-images.	

\subsection{Routines for Making Time Plots}

\subsubsection{UTPLOT}
\index{time plots, making}

UTPLOT plots any quantity on a
time plot with hours, minutes, and seconds given a
corresponding index array by typing:
%
\idlinputa{utplot, roadmap, gt\_total\_cnts(roadmap, 1)}	
\idlinputb{utplot, index, timehist}	\index{UTPLOT}
\idlinputb{utplot, x, y, ref\_time, xrange=xrange}	
\idlinputb{utplot, x, y, ref\_time, timerange=[index(0), index(100)]}	
\idlinputb{utplot, x, y, ref\_time, timerange=['1-jun-91','5-jun-91']}	
\idlinputb{utplot, x, y, ref\_time}
%
Most typical IDL plotting parameters also apply.  You can overplot other
quantities (timehist2, etc.) by using OUTPLOT. 

\subsubsection{OUTPLOT}
OUTPLOT works just like UTPLOT but does not refresh the
screen so one can plot several different quantities on
the same plot (see UTPLOT first).  An example is:
%
\idlinputd{outplot, index, timehist2} \index{OUTPLOT} 
%
\subsubsection{EUTPLOT}
\index{plots with error bars}
\index{time plots with error bars}

EUTPLOT works like UTPLOT but it over plots vertical error bars on
a plot that was previously made with UTPLOT.  Example calls are:
%
\idlinputA{3}{eutplot,x,y,unc,/unc		}{; unc = +/- uncertainties}
\idlinputb{eutplot,x,low,high}\index{EUTPLOT}
%
where {\tt low = y - unc} and {\tt high = y - unc}.

\subsubsection{LCUR\_IMAGE}\index{LCUR\_IMAGE}\label{lcur_image}
\index{light curves, plotting from data cubes}

The procedure LCUR\_IMAGE will allow a user to select a portion of an
image and will display a normalized light curve plot.  The region
can be a simple rectangle or a polygon.  LCUR\_IMAGE can be used on
data other than SXT images as long as the {\it index} input has
.TIME and .DAY fields (see ANYTIM2INTS to build a structure).  
Some sample calling sequences are:
%
\idlinputa{lcur\_image, index, data}\index{LCUR\_IMAGE}
\idlinputb{lcur\_image, index, data, lcur}
\idlinputb{lcur\_image, index, data, lcur, uncert, satpix}
\idlinputb{lcur\_image, index, data, xsiz=512}
\idlinputb{lcur\_image, index, data, xsiz=512, /poly}
\idlinputb{lcur\_image, index, data, xsiz=512, /nonorm, subscript=subscript}
%
The data are binned and exposure normalized.  It is possible to mark multiple
locations and to overlay the light curves.  The keyword option {\it /plot6}
will display the multiple plots in six different sub-windows instead of
overlaying the light curves.  The regions being marked are displayed and
labeled so that light curves for a given region can be matched up.  There
are hardcopy options.  If the user passes in the uncertainty {(\it uncert)}
and the saturation map array {\it satpix}, it will mark the points which
have saturated pixels or large uncertainties.  
The {\it xsiz} option will blow up the image to be 512 pixel wide (and 512
pixels tall if it is square) so that the selection of a region is simple.
There are several other options which are described in the program header.

\subsubsection{PLOTY}
\index{observing log}

PLOTY plots light curves from all the Yohkoh
instruments on the same plot with 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 to plot no 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}
%
If you have identified an instrument file for which you want to see the light
curve for all the other instruments, you can use the following command
(it assumes that the other instrument data files exist on the same 
directory as the input file):
%
\idlinputa{ploty, infil='/yd5/flares/spr911115.2141'}
%
You can read the observing log data, and the use PLOTY with a command
like:
%
\idlinputa{rd\_obs, '8-may-92', '8-may-92 12:00', bcs, sxtf, sxtp, w\_h}	
\idlinputc{ploty, bcs, w\_h, sxtp, w\_h} 
%
\subsubsection{TPROFILES}
\index{light curves, plotting from data cubes}

TPROFILES will plot the light curve for any pixel in a
data cube (data(x,y,t)).  As you drag the cursor around the image, it updates a light 
curve plot automatically.  It differs from LCUR\_IMAGE since it updates
as the cursor moves (not integrating a box), and plots the intensity versus 
image number, not versus date and time. To use it just type:
%
\idlinputa{tprofiles,data} \index{TPROFILES}
%
The routine is mouse driven and will issue instructions for you.

\subsection{Routines for Image Display and Enhancement}

\subsubsection{STEPPER}

\label{stepper}
STEPPER takes a data cube ({\it data}) and allows a user to step
through the images and to display them as a movie.  If the {\it index}
is passed in to stepper (as shown in 2 of the examples below) it is
possible to chose an option to display light curves.
Some sample calls are:
%
\idlinputa{stepper, data} \index{STEPPER}	
\idlinputb{stepper, data, info\_array}	
\idlinputb{stepper, index, data, xsiz=512}
\idlinputb{stepper, index, data, info\_array}	
%
where {\it info\_array} and {\it xsiz} are optional parameters. {\it xsiz} indicates
the size of the displayed image you want (must be an
integer multiple of the the original array). It is a
window driven program.

The use of the STEPPER routine is described in a little more detail in the
User's Guide.

\subsubsection{XSTEPPER}

XSTEPPER is like stepper but is a widget based program, to run it type:
%
\idlinputa{xstepper, data, info\_array} \index{XSTEPPER}
\idlinputb{xstepper, data}
%
It is a widget driven program with self explanatory instructions.  Some
options include the ability to zoom in on a particular region and the
ability to call XLOADCT from within XSTEPPER.

\subsubsection{XMOVIE}

It is possible to load a data cube into a widget to be ``animated'' using
the routine XMOVIE (which is simply an interface for IDL's XINTERANIMATE).\index{XINTERANIMATE}\index{XMOVIE}
The speed which the frames can be displayed is quite fast.
There are some memory restrictions which do not allow large data cubes.
Some sample calls are:
%
\idlinputa{xmovie, data}
\idlinputb{xmovie, data, ss=ss}
\idlinputb{xmovie, data, 4}
%
The second positional parameter is optional and is the rebinning factor.  This
is quite useful when looking at small 64$\times$64 PFI images.

\subsubsection{OCONTOUR}

OCONTOUR allows you to plot a contour on top of an image
in the same way as you use CONTOUR.
%
\idlinputd{ocontour,image}\index{OCONTOUR} 
%
\subsubsection{UP2, UP4, UP8 [*]}

To re-bin and display an image, you can use the UPn routines.  UP2
will rebin the image to be twice as big and then call TVSCL.  UP4
and UP8 increase the size of the image four and eight times respectively.
A sample call would be:
%
\idlinputd{up8, data(*,*,200)} \index{UP8}\index{UP4}\index{UP2} 
%

\subsubsection{RM\_DARKLIMB [*]}

In order to subtract the limb darkening from H$\alpha$ 
or white light pictures you can call:
%
\idlinputa{img\_out = rm\_darklimb(Haimage)}\index{RM\_DARKLIMB}\index{limb darkening}
%
where {\it Haimage} is the name of the H$\alpha$ image with limb
darkening and {\it img\_out} is the new H$\alpha$ image with limb darkening
removed.  RM\_DARKLIMB
does not work if the image is oblate.  The image should then be viewed
with TVSCL (not TV). 

\subsubsection{GBO\_SCALE2 [*]}

GBO\_SCALE2 can be used for aligning SXT images with each other or with 
other images.  GBO\_SCALE2 takes two images, resizes them and lays them
on top of one another by typing:
%
\idlinputa{outimg=GBO\_SCALE2(trgimg, gboimg)}	\index{GBO\_SCALE2}
\idlinputb{outimg=GBO\_SCALE2(sxtimg, gboimg, index1, sxt=1)}	
\idlinputb{outimg=GBO\_SCALE2(sxtimg1, sxtimg2, index1, index2, sxt=2, /mktv)}
%
which will scale the input image {\it gboimg} and center it to
match a target image {\it trgimg}.  If either of these is an SXT image then
it needs to have its index passed as well, and the SXT keyword should be
set to 1 or 2 appropriately, (i.e., for one or two SXT images). 

GBO\_SCALE2 corrects for different vertical and horizontal diameters. 
The MKTV keyword allows you to plot the result directly.
This should work with general sized images. 

\subsubsection{COMPST [*]}

There is a routine called COMPST that interleaves two images and scales
them to each use half the color table. It does no alignment and requires 
that you have or develop appropriate color tables. The calling sequence is 
%
\idlinputa{imageout= compst(image1, image2)} \index{COMPST}
%
It is currently set up to work with 512x512 images.  It is a good idea
to massage 
the images so that they emphasize the intensity ranges
of interest, e.g., for low-intensity features, a decompressed image gives poor
results.  Creative color tables may also be useful. 

\subsection{Standard IDL Image Display Routines}

\subsubsection{TV [IDL]}

The command TV takes a 2-dimensional variable and displays it directly to
the display (you must have x-windows or a image display device).  There is
no scaling performed on the data.  If the data are not byte type, and there
are values over 255, then wrap-around will occur.  It is probably best to
use TVSCL for these datasets.  To display the first image in the variable
{\it data}, type:
%
\idlinputa{tv, data(*,*,0)} \index{TV}
%
To display the ``i''th dataset, type
%
\idlinputd{tv, data(*,*,i)} 
%
\subsubsection{TVSCL [IDL]}

TVSCL will first perform a linear byte scaling, making the smallest value 0
intensity and the largest value 255.  To display image number 11 in the
variable {\it data}, type:
%
\idlinputd{tvscl, data(*,*,11)} \index{TVSCL} 
%
\subsubsection{CONTOUR [IDL]}

You can contour any given image by typing:
%
\idlinputa{contour,image}	\index{CONTOUR}
\idlinputb{contour, data(*,*,0)}	
\idlinputb{contour, image, levels=[l1,l2,l3,...,ln]}
%
where $levels$ defines the contour levels you want to plot.
{\it levels} is an optional parameter which IDL will
choose for you if you omit them. You can overplot a contour on an
image by using OCONTOUR in the same way.

\subsubsection{XLOADCT [IDL-LIB]}

XLOADCT is a widget driven IDL facility that allows you to change color
tables and manipulate them.  To run it type
%
\idlinputd{xloadct} \index{XLOADCT} \index{color tables} 
%
\subsubsection{LOADCT [IDL-LIB]}

LOADCT will load one of the multiple standard IDL color tables.  To load the
red color table, type:
%
\idlinputd{loadct, 3} \index{LOADCT} \index{color tables} 
%
\subsubsection{TVLCT [IDL]}

TVLCT allows a user to load a color table which he has already defined.
After defining the red, green, and blue intensity profiles, type:
%
\idlinputa{tvlct, red, green, blue}\index{TVLCT}\index{color tables}
%
to load the color table.  If you wish to read the color table which is
currently loaded, type:
%
\idlinputd{tvlct, red, green, blue, /get} 
%
\subsubsection{STRETCH [IDL]}
\index{stretching color tables}
\index{color tables, stretching }

The following command can be used to invert the color table
%
\idlinputd{stretch, 255, 0}\index{STRETCH}

\subsubsection{GAMMA\_CT [IDL]}

The gamma factor for the color table can be adjusted directly using
the routine GAMMA\_CT.  A sample call is:
%
\idlinputd{gamma\_ct, 0.6}\index{GAMMA\_CT}

\subsubsection{MOVIE [IDL-YO]}

The MOVIE routine is an IDL routine that displays an image data
cube (x,y,t).  The data should be byte type.  It is run by typing:
%
\idlinputa{movie,data} \index{MOVIE}
%
You can vary the speed of the movie.  No information is printed with the
image, for that see STEPPER and XSTEPPER.  The standard IDL routine was
modified to make !ORDER default to zero which is the proper orientation
for Yohkoh images.

\subsubsection{PALETTE [IDL-LIB]}

PALETTE is an IDL facility that allows you to create a
new color table. To run it just type:
%
\idlinputa{palette}\index{PALETTE}
%
To save the color table use TVLCT by typing
%
\idlinputa{tvlct,r,g,b,/get} \index{TVLCT}
%
This will save the red, green, and blue vectors in {\it r}, {\it g}, and {\it b}.  To
re-load this color table, type:
%
\idlinputd{tvlct,r,g,b} 
%
\subsubsection{PROFILES [IDL]}
PROFILES enables you to obtain a plot of a row or column
of a two dimensional image by typing
%
\idlinputa{profiles,image} \index{PROFILES}
%
you should have image in the format (size and normalization) that you
wish first.  It is a mouse driven program. 

\subsubsection{ZOOM [IDL-LIB]}

ZOOM takes an image that is already being displayed and displays
the zoomed region in a new window.  The user uses the cursor and clicks
with the left button to chose the center of the region to zoom (the
selected region is displayed each time the left button is clicked).  The
middle button allows the zoom factor to be selected using a menu.  The
right button exits the zoom option (the zoom window is deleted upon
exiting ZOOM).  An example would be:
%
\idlinputa{tvscl, data(*,*,5)}	\index{ZOOM}
\idlinputc{zoom}
%

\subsection{Routines for Data and Information Extraction}

\subsubsection{CONROI [*]}
\index{sub-image extraction}

Define a contoured region-of-interest of an image using the image
display system and the cursor/mouse.  This function returns a vector
containing the subscripts of pixels inside the contoured region.  Note
that these are `linear' subscripts, not `X, Y' pairs. 
%
\idlinputa{result = conroi( data(*,*,n) )}	\index{CONROI}
\idlinputc{result = conroi( data(*,*,n), zoom=4)} 
%
\subsubsection{PR\_IMAGE}

PR\_IMAGE is used to get a print out and/or the average
count rate in a given area on an image ({\it data(*,*,n)}) by
typing:
%
\idlinputa{pr\_image, data(*,*,n)}	\index{PR\_IMAGE}
\idlinputb{pr\_image, data(*,*,n), size}
%
where {\it size} is the size of the box to be considered
(default is 9$\times$9).  It is a mouse driven program.

\subsubsection{The Concept Behind the GT Routines}

A series of GT routines was created so that a single piece of information
can be extracted from a structure, whether the structure was a `roadmap'
or an `index' (the data are saved in a different location).  The routines
also allow for conversions to a string mnemonic or to physical units.  
It is possible to get a list of what the different values are by typing a
command like:
%
\idlinputa{print, gt\_filta()}
%
It is also possible to convert the output value to the string mnemonic by using the
{\it /STRING} switch.  For example:
%
\idlinputa{print, gt\_filta(roadmap, /string)}
%
This command only works for the routines which return a coded value.
A list of all of the GT routines currently available are:

% LIST_GT.TEX input starts here -------------------------------

\index{GT\_ routines}
\begin{tabular}{|l|l|l|l|l|} \hline
{\sl GEN} & {\sl BCS} & {\sl HXT} & {\sl SXT} & {\sl WBS}  \\ \hline
{gt\_conv2str} & {gt\_blockid} & {gt\_sum\_h} & {gt\_adoor} & {gt\_grs1}  \\
{gt\_day} & {gt\_bsc\_bincal} & {gt\_sum\_l} & {gt\_center} & {gt\_grs2}  \\
{gt\_dp\_mode} & {gt\_bsc\_chan} & {gt\_sum\_m1} & {gt\_comp} & {gt\_hxs}  \\
{gt\_dp\_rate} & {gt\_bsc\_crate} & {gt\_sum\_m2} & {gt\_corner} & {gt\_rbmsc}  \\
{gt\_hxa} & {gt\_bsc\_flux} & {~} & {gt\_corner\_cmd} & {gt\_rbmsd}  \\
{gt\_iru} & {gt\_bsc\_time} & {~} & {gt\_dpe} & {gt\_sxs1}  \\
{gt\_tfss} & {gt\_bsc\_wave} & {~} & {gt\_entry} & {gt\_sxs2}  \\
{gt\_time} & {gt\_total\_cnts} & {~} & {gt\_expdur} & {~}  \\
{~} & {~} & {~} & {gt\_explat} & {~}  \\
{~} & {~} & {~} & {gt\_expmode} & {~}  \\
{~} & {~} & {~} & {gt\_filta} & {~}  \\
{~} & {~} & {~} & {gt\_filtb} & {~}  \\
{~} & {~} & {~} & {gt\_mbe} & {~}  \\
{~} & {~} & {~} & {gt\_obsregion} & {~}  \\
{~} & {~} & {~} & {gt\_or\_expnum} & {~}  \\
{~} & {~} & {~} & {gt\_percentd} & {~}  \\
{~} & {~} & {~} & {gt\_percentover} & {~}  \\
{~} & {~} & {~} & {gt\_pfi\_ffi} & {~}  \\
{~} & {~} & {~} & {gt\_pix\_size} & {~}  \\
{~} & {~} & {~} & {gt\_res} & {~}  \\
{~} & {~} & {~} & {gt\_seq\_num} & {~}  \\
{~} & {~} & {~} & {gt\_seq\_tab} & {~}  \\
{~} & {~} & {~} & {gt\_shape} & {~}  \\
{~} & {~} & {~} & {gt\_shape\_cmd} & {~}  \\
{~} & {~} & {~} & {gt\_ssl\_explab} & {~}  \\
{~} & {~} & {~} & {gt\_sxt\_axis} & {~}  \\
{~} & {~} & {~} & {gt\_sxt\_cen} & {~}  \\
{~} & {~} & {~} & {gt\_sxt\_roll} & {~}  \\
{~} & {~} & {~} & {gt\_temp\_ccd} & {~}  \\
{~} & {~} & {~} & {gt\_temp\_hk} & {~}  \\ \hline
\end{tabular}\vspace{0.2in}

% LIST_GT.TEX input starts here -------------------------------

\subsubsection{GT\_DP\_RATE}
\index{telemetry rate}
\index{spacecraft telemetry rate}

GT\_DP\_RATE will extract the information on the DP telemetry rate.
The values are shown below.  

\vspace{0.2in}\begin{tabular}{|l|l|} \hline
       1 & {Low  ( 1 Kbits/sec)} \\
       2 & {Med  ( 4 Kbits/sec)} \\
       4 & {High (32 Kbits/sec)} \\ \hline
\end{tabular}\vspace{0.2in}
~\\
%
\idlinputa{dprate = gt\_dp\_rate(index)}	\index{GT\_DP\_RATE}
\idlinputc{dprate = gt\_dp\_rate(roadmap, /string)} 
%
\subsubsection{DPRATE2SEC}

DPRATE2SEC will take a structure (or an integer value 1, 2 or 4 for
low, medium, or high) and return the number of seconds that passes for
a major frame at that telemetry rate.

\vspace{0.2in}\begin{tabular}{|l|l|} \hline
       1 & {  64 sec (Low)} \\
       2 & {  16 sec (Med)} \\
       4 & {   2 sec (High)} \\ \hline
\end{tabular}\vspace{0.2in}
%
\idlinputd{nsec  = dprate2sec(index)}\index{DPRATE2SEC} 
%
\subsubsection{GT\_DP\_MODE}
\index{telemetry mode}
\index{spacecraft telemetry mode}

GT\_DP\_MODE will extract the information on the DP mode.  There are 
several modes, but the most common are:

\vspace{0.2in}\begin{tabular}{|l|l|} \hline
        9 & {  Flare  } \\
       11 & {  BCS-OUT} \\ 
       12 & {  Night  } \\
       13 & {  Quiet  } \\ \hline
\end{tabular}\vspace{0.2in}
~\\
%
\idlinputa{dpmode = gt\_dp\_mode(index)}	\index{GT\_DP\_MODE}
\idlinputc{dpmode = gt\_dp\_mode(roadmap, /string)} 
%

\subsubsection{GET\_INFO}

\label{get_info}
GET\_INFO will take the roadmap or index structure and return a
string describing the main observing mode parameters for each 
dataset. 
%
\idlinputa{info\_array = get\_info(roadmap)} \index{GET\_INFO} 
%
An example for a dataset for SXT data is:

\begin{verbatim}
   0 15-NOV-91  22:42:24  FL/H  NaBan/Open  Full Norm C  16   238.0   64x 64
\end{verbatim}

The ``0'' is the image number in the index or roadmap which was passed to GET\_INFO, ``15-NOV-91  22:42:24''
is the start date and time of the exposure, ``FL/H'' says the DP was in flare mode
in high telemetry rate, ``NaBan/Open'' are the filters, ``Full'' is the
pixel resolution, ``Norm'' says it was a normal exposure (not a dark frame),
``C'' is compressed data, ``16   238.0'' is the DP exposure level (DPE)
and the expected exposure duration in milliseconds, and ``64x 64'' is the
image shape.

An example for a dataset for SXT data when using the /LONG option is:

\scriptsize
\begin{verbatim}
   0 15-NOV-91  22:42:24  FL/H  NaBan/Open  Full Norm C  16   238.0   64x 64  100%  S13W18   0% SAA  2.6
\end{verbatim}
\normalsize

The first 80 columns are the same as above.  The ``100\%'' says that all of the image 
was received from the S/C, ``S13W18''
are the heliocentric coordinates of the PFI, ``0\%'' of the image was saturated,
``SAA'' signifies that it was during an South Atlantic Anomaly (SAA) passage, and
``2.6'' is the number of minutes before spacecraft night.

For HXT,WBS and BCS data, the routine only returns the date, time,
DP mode and DP rate.

\subsection{Routines for Calibration and Analysis}

\subsubsection{FSP\_PROC [*]} \index{spectral fitting}

FSP\_PROC is a general routine for doing spectral fits. {\it detector} is a string 
variable containing the detector name, {\it cfile} is the input file name, the 
format for an input file is given in /ys/ucon/soft/mctiernan/spectral\_data\_format, 
{\it ofile} is an output file name.  {\it tyspec} denotes the type of spectrum you want 
to fit (try doc\_library, 'fsp\_proc' for a complete list). {\it fit\_pars} is the 
structure containing the results.  Optional parameters:
{\it sc\_par} is a structure containing spectrometer channel info, {\it ch\_dta} is a 
structure containing the data for each channel, {\it pfile} is the name for an 
output plot file, {\it sdel} is an array of channels you'd like to delete, 
{\it flux\_corr} is any correction to the overall flux you might want to make, 
{\it nsigmas} tells you how many sigmas above background a ``good'' channel will
be (default is 3.0), {\it noplot} suppresses screen plots.
%
\idlinputd{FSP\_PROC, detector, cfile, ofile, tyspec, fit\_pars} \index{FSP\_PROC}
%
\subsubsection{FSP\_11 [*]} \index{spectral fitting}

FSP\_11 is a general routine for doing spectral fits. {\it inpf} is a strarr 
containing the detector response filenames,  {\it tyspec} denotes the type of 
spectrum you want to fit (try doc\_library, 'fsp\_11' for a complete list). 
Data must be put in the proper fields of the structures {\it fit\_pars, sc\_par }
and $ch\_dta$. $fit\_pars$ is the structure containing the results, $sc\_par$ is a 
structure containing spectrometer channel info, $ch\_dta$ is a structure 
containing the data for each channel.  Optional parameters:
$ofile$ is the name for an output file, $pfile$ is the name for an output plot 
file, $sdel$ is an array of channels you'd like to delete, $flux\_corr$ is any 
correction to the overall flux you might want to make, $nsigmas$ tells you 
how many sigmas above background a ``good'' channel will be (default is 3.0), 
$noplot$ suppresses screen plots.
%
\idlinputd{FSP\_11, detector, inpf, tyspec, fit\_pars, sc\_par, ch\_dta} \index{FSP\_11}
%
\subsection{Routines for Image Alignment}

The routines described here can generally be used on SXT or 
ground-based images.

\subsubsection{SXT\_PREP}

See the description of SXT\_PREP on page~\pageref{sxt_prep} for details on aligning SXT images.

\subsubsection{COAL\_IMAGE}
\index{alignment with ground-based images}
\index{ground-based images, aligning to SXT}


COAL\_IMAGE is a medium level routine to perform the scaling,
alignment, and roll two images so they are co-aligned.  Some sample calls are:
%
\idlinputa{data\_out = coal\_image(data, index\_or\_corn, out\_corn, out\_siz)}\index{COAL\_IMAGE}
\idlinputb{data\_out = coal\_image(data, index, out\_corn, out\_siz, index\_out=index\_out)}
\idlinputb{data\_out = coal\_image(img1, corner1, corner2, out\_siz, mag=pix1/pix2)}
%
where the first parameter is the image which is to be changed so that
it is co-aligned with another image.  The second parameter can be
an SXT index or the pixel address of the lower left corner relative to
the sun center for the input image.  The pixel address
is in units of the input image pixel size.  The third parameter is where
you want to shift the image to, it is a two element array of the lower corner 
value (relative to sun center) for the output array in output pixel units.
{\it out\_siz} is the output size of the image, {\it mag} is the
magnification factor required to convert the image to the same scale as
the other image.  The optional input {\it angle=angle} is available to
correct for a roll difference between the two images.

\subsubsection{FIT\_LIMB}

\begin{sloppy}
FIT\_LIMB will find the center and radius of an image, even images with
a partial limb.
FIT\_LIMB is a modified version of SXT\_CENTER which will also work on
non-SXT images.  For non-SXT images, the pixel size must be known.
The algorithm requires a VERY good initial guess to remove bad limb
points. 
Some sample calls are:
%
\idlinputa{fit\_limb, image, x, y, r, pixel\_size=2.5}\index{FIT\_LIMB}
\idlinputb{fit\_limb, image, x, y, r, pixel\_size=3.97, /interactive}
\idlinputb{fit\_limb, image, x, y, r, pixel\_size=2.5, initial=[434,512,403]}
\idlinputb{fit\_limb, image, x, y, r, index=index}
%
where the input is {\it image} which is the solar image.  The outputs 
$x$ and $y$ are the E/W and N/S position
of the sun and $r$ is the solar radius.  
The $x$ and $y$ locations are in full resolution pixels if it
is an SXT image.  It is possible to return the location in the
summed pixels (half resolution or quarter resolution) by using
the option {\it /summed\_pixels}.
The keyword {\it index=index}
should be used for SXT image, and the keyword {\it pixel\_size} should
be used for non-SXT images.  For non-SXT images, the user should specify
an initial guess using the keyword {\it initial} or the \mbox{\it /interactive}
option which will allow the user to click on the sun center location.
There are other options and output (like the oblateness and the phase of the
2nd harmonic) which is described in more detail in the documentation header.
\end{sloppy}

\subsubsection{DSK\_LOCB [*]}

DSK\_LOCB (disk locator) will find the center
coordinates and disk radius of an optical solar image.  
It currently works on white light, H$\alpha$, and magnetogram images, or
anything with a clearly defined edge.  The images are all treated using
a histogram technique.  (There is an old routine called DSK\_LOC
that uses a derivative technique for white light etc., as they
have a high and noisy background).  
A sample call is:
%
\idlinputa{dsk\_locb, image, horzcnt=x0, vertcnt=y0, horzrad=rx, vertrad=ry} \index{DSK\_LOCB}
%
where the keywords return the values of the radius and disk center. 

A complete list of the optional keywords follows:

\vspace{0.2in}\begin{tabular}{ll}
{\tt horzcnt } & {\raggedright horizontal center, floating point}\\
{\tt vertcnt}  & {\raggedright vertical center, floating point}\\
{\tt horzrad}  & {\raggedright horizontal diameter, floating point}\\
{\tt vertrad}  & {\raggedright vertical diameter, floating point}\\
{\tt eastlimb} & {\raggedright east limb, in pixels}\\
{\tt westlimb} & {\raggedright west limb, in pixels}\\
{\tt npole } &   {\raggedright north pole, in pixels}\\
{\tt spole} &    {\raggedright south pole, in pixels}
\end{tabular}

\subsubsection{FIND\_LIMB}

FIND\_LIMB also finds the location of the center of the optical sun and it's
radius.  A sample calling sequence is:
%
\idlinputa{find\_limb, img, x0, y0, r0} \index{FIND\_LIMB}
%
where {\it img} contains the input image and {\it x0,y0,r0 }
receive the output center
location and diameter of the disk. FIND\_LIMB only works on whole images.  Also see FIT\_LIMB.

\subsection{Accessing Secondary Databases}

\subsubsection{CONTACTS}
\index{station contacts}

CONTACTS will give information on when the ground station contacts are 
for a given day.  The output from the command below is shown.
%
\idlinputa{contacts,'2-jun-92'}\index{CONTACTS}
%
\begin{verbatim}
             Kagoshima Space Center Contacts           Minutes of
                  Starts                   Ends       Day  Ngt  Tot
         JST              (UT)             JST
 2-JUN-92 02:56:14 ( 1-JUN-92 17:56:14)   03:07:14    3.5  7.5 11.0
 2-JUN-92 04:39:59 ( 1-JUN-92 19:39:59)   04:48:59    7.8  1.2  9.0

 2-JUN-92 20:27:14 ( 2-JUN-92 11:27:14)   20:37:14    4.0  6.0 10.0
 2-JUN-92 22:09:14 ( 2-JUN-92 13:09:14)   22:21:14    0.0 12.0 12.0
 2-JUN-92 23:52:29 ( 2-JUN-92 14:52:29)   00:04:14    0.0 11.8 11.8
\end{verbatim}
A blank line is inserted to show that the second set of contacts
is for a different series of contacts (they come in clusters of
five or six per day).  It is possible to get the station contacts times
for DSN stations by using the {\it /CANBERRA, /GOLDSTONE} or {\it
/MADRID} switches.  It is possible to specify an end time and output
files in the following example:
%
\idlinputd{contacts, '1-jun-92', '10-jun-92', outfil='contacts.txt'} 
%
\subsubsection{PR\_FEM}
\index{ephemeris, spacecraft (FEM)}
\index{spacecraft ephemeris (FEM)}
PR\_FEM will print out Yohkoh's day and night events by typing:
%
\idlinputd{pr\_fem, '1-jan'} \index{PR\_FEM}
%
\subsubsection{PR\_EVN}
\index{event log}
\index{EVN, event log}
\index{Yohkoh event log}

PR\_EVN helps you find when there is Yohkoh data 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 are 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 is listed.  By typing:
%
\idlinputa{pr\_evn, '1-jan-92', '1-jan-93', /flare, /counts, mindur=5, outfil='pr\_evn.results'}
%
the FLARE modes for 1992 are listed, and since the /COUNTS option was used, the maximum 
counting rate for certain WBS, HXT, and BCS channels is printed instead of the
number of datasets available.  It also prints the GOES classification when
it is available.  See the User's Guide for a sample output listing.

\subsubsection{PLOT\_EVN}
\index{PLOT\_EVN}

PLOT\_EVN will plot a very basic time line showing when the
station contacts are available, when the SAA passages are, when
the S/C day and nights are, and the periods when there is 
Yohkoh data available.  It shows when there is FLARE and QUIET
data.

%% \subsubsection   {RD\_FEM, RD\_EVN, RD\_GEV, RD\_GXT and RD\_NAR}
\subsubsection{RD\_FEM}
\index{ephemeris, spacecraft (FEM)}
\index{spacecraft ephemeris (FEM)}

To read the FEM, EVN ,GEV or NAR structures, use a command similar to:
%
\idlinputa{rd\_fem, sttim, entim, fem}	\index{RD\_FEM}
\idlinputb{rd\_evn, index(0), index(n-1), evn}	\index{RD\_EVN}
\idlinputb{rd\_nar, '1-nov-91', '2-nov-91', evn}\index{RD\_NAR}\index{RD\_GEV}\index{RD\_GXT}
%
Look at the File Control Document for a description of the structures
which are returned.

\subsubsection{RD\_OBS}
\index{observing log, reading}

A sample standard calling sequence for reading the observing log data files
for all instruments is:
%
\idlinputa{rd\_obs, '8-may-92', '8-may-92 12:00', bcs, sxtf, sxtp, w\_h, fid}\index{RD\_OBS}
%
It is possible to only read SXT full-frame data by using the one of the 
following command:
%
\idlinputa{rd\_obs, '8-may-92', '8-may-92 12:00', bcs, sxtf, sxtp, w\_h, fid, /sxtf}	
\idlinputb{rd\_obs, '8-may-92', '8-may-92 12:00', bcs, sxtf, /sxtf}	
\idlinputb{rd\_obs, '8-may-92', '8-may-92 12:00', bcs, sxtf, /nobcs}
%
To read the WBS data, you can use the command:
%
\idlinputa{rd\_obs, '8-may-92', '8-may-92 12:00', bcs, sxtf, sxtp, w\_h, /w\_h}
%
The observing log output structures are positional and are sorted 
alphabetically.  The observing log files must be in the \$DIR\_GEN\_OBD, 
\$DIR\_GEN\_OSF, \$DIR\_GEN\_OSP, and \$DIR\_GEN\_OWH directories
appropriately.

\subsection{Time Routines and Conventions}
\index{time representations, Yohkoh formats}

There are three time conventions used in the Yohkoh database.

\subsubsection{Internal Representation}
\index{internal time rep, Yohkoh format}
\index{time, internal representation}

The internal representation uses two variables to define the date and
time of an event.  One variable (integer*2) is the number of days since 1-Jan-79 (DS79) and
the other (integer*4) is the number of milliseconds from the start of the day to the event (MSOD). 
Almost all data are saved using this internal representation which uses
a total of 6 bytes. 

The Yohkoh structures use the internal time representation and store the
two values in tags .TIME and .DAY.  The routine GT\_TIME and GT\_DAY will
extract the data in these fields (the routines are needed because the
.TIME and .DAY fields are nested in the .GEN portion of the index structures).

\subsubsection{External Representation}
\index{external time rep, Yohkoh format}
\index{time, external representation}

The external representation uses a 7 element integer array to define the 
time of an event.  This representation uses 14 bytes.

\begin{verbatim}
             (0) = hour 
             (1) = minute
             (2) = second
             (3) = millisec
             (4) = date
             (5) = month
             (6) = year
\end{verbatim}

\subsubsection{String Representation}

The time of an event can also be represented with a string.  The general rules
are:

\IItem
\item The month uses the first three letters of the month (Jan, Feb, Mar...) OR \\
	it can use the month number with the / notation.
\item For the standard convention using the three letters of the month:
	\IItem
	\item The date and year are separated from the month using `-'
	\item The year can come before or after the month (7-Jan-92 or 92-Jan-7)
	\item If the year is not passed, it will use the current year
	\item The year can be two or four digit notation
	\end{itemize}
\item If the month number and / notation is used:
	\IItem
	\item It is assumes YY/MM/DD or DD/MM/YY.  If you
		wish to use MM/DD/YY, then the /MDY switch must be used on
		ANYTIM2INTS, ANYTIM2EX and TIMSTR2EX.
	\item There can be no spaces before or after the /
	\item It must include all three items (date, month, year)
	\item It differentiates between YY/MM/DD and DD/MM/YY by looking
		for the year, which must be greater than 1932 and less
		than 1999.
	\end{itemize}
\item The hour, minutes and seconds are separated by `:'
\item The milliseconds are entered as a fraction of seconds.  For example,
\mbox{`16-Dec-91  02:29:40.819'}
\item There is a space between the date and the time
\item The time can come before or after the date
\end{itemize}

\subsubsection{FMT\_TIM}

The routine FMT\_TIM will take a structure and return a string with the
date and time.  For example, the command:
%
\idlinputa{a = fmt\_tim(roadmap(0))}\index{FMT\_TIM}\index{time}
%
will return the string `16-DEC-91  02:29:40'.  It is
possible to use the /MSEC keyword and get \mbox{`16-DEC-91  02:29:40.819'}
instead.

\subsubsection{FMT\_TIMER}

The routine FMT\_TIMER is like FMT\_TIM, except that FMT\_TIMER is a
procedure which prints the first and last time in the index structure:
%
\idlinputa{fmt\_timer, index}\index{FMT\_TIMER}
{\tt (first, last) = '16-DEC-91  02:29:40', '16-DEC-91  02:29:40'}
%
In this case, the index structure was a scalar, so the first and last
times are the same.  The times can be returned in optional output
variables:
%
\idlinputa{fmt\_timer, index, t1, t2}
%
The {\it t1} and {\it t2} are string variables which can be used in calls to
other routines (such as PLOT\_GOES, for example).


\subsubsection{ANYTIM2INTS}

ANYTIM2INTS takes any of the three representations and returns a 
structure with the internal representation.  The structure has a 
.TIME and a .DAY field.  An example is:
%
\idlinputa{a = anytim2ints('23-jun-92 3:00')}\index{ANYTIM2INTS}\index{time}
%
This routine has an optional keyword input to allow the user to offset
the input time by some number of seconds.  If the input is an array
of times, then the offset can be a scalar value or it can be an array
of offsets which is the same length as the input.  For example,
%
\idlinputa{a = anytim2ints(roadmap, off=60.5)}	
\idlinputb{a = anytim2ints(roadmap, off=off)} 
%
The following command will set up a structure which has 
has the dates of 100 Mondays starting on 7-Jan-91 (since 7-Jan-91 is
a Monday and there are 86400 seconds in a day).  The second example
sets up a 500 element array with times separated by 90 seconds.
%
\idlinputa{dates = anytim2ints('7-jan-91', off=findgen(100)*86400.*7)}
\idlinputc{tt = anytim2ints(!stime, off=findgen(500)*90.)}

\subsubsection{ANYTIM2EX}

ANYTIM2EX takes any of the three representations and returns an
array with the external representation.  If the input is only
one time, then the output is a seven element array.  If it is an array
of `N' elements, then the output is a 7$\times$N array.
%
\idlinputd{b = anytim2ex(roadmap)} \index{ANYTIM2EX} \index{time} 
%
\subsubsection{GT\_DAY}
GT\_DAY is  a function that returns the date from
the index or roadmap structure in a string variable
(other are options available) by typing:
%
\idlinputd{date = gt\_day(index,/string)} \index{GT\_DAY} \index{time} 
%
\subsubsection{GT\_TIME}
GT\_TIME is a function that returns the UT from
the index or roadmap structure in a string variable
(other are options available) by typing:
%
\idlinputd{time = gt\_time(index,/string)} \index{GT\_TIME} \index{time} 
%
\subsubsection{INT2SECARR}
INT2SECARR takes a structure (e.g., roadmap or index)
containing time and will create an array of times (t) in
seconds from some given reference.  If the second parameter is not passed,
then the first time in the input array is used
%
\idlinputa{t = int2secarr(roadmap)}\index{INT2SECARR}\index{time}
%
The example above will produce an array of times with respect to the first time.
%
\idlinputa{t = int2secarr(roadmap, ref\_time)}	
\idlinputc{t = int2secarr(roadmap, '1-sep-91')} 
%

\subsubsection{ANYTIM2DOY}

ANYTIM2DOY takes any of the three representations and returns the
day of year number.
%
\idlinputd{b = anytim2doy(roadmap)} \index{ANYTIM2DOY} \index{time} 
%

\subsubsection{DOY2EX}
\index{day-of-year (DOY)}

DOY2EX takes a day of year and a year and returns the
seven element array containing the date.
%
\idlinputd{daytim = doy2ex(doy, year)}\index{DOY2EX}
%

\subsubsection{EX2DOW}
\index{day-of-week (DOW)}

EX2DOW will take the external representation and return the
day of the week number, 0 for Sunday, 1 for Monday, ...
%
\idlinputd{dow = ex2dow(tarr)}\index{EX2DOW} 
%

\subsubsection{EX2FID}
\index{FID (fileID)}

EX2FID will take the external representation date/time and return a string
with the fileID.
%
\idlinputd{fid = ex2fid(input)} \index{EX2FID} 
%
\subsubsection{TIM2ORBIT}

TIM2ORBIT will take a set of input times and will determine which orbit
and which week the data falls in.  It can also return the number of minutes
into the orbit for an input time.  A sample interactive use of the routine
would be:
%
\idlinputa{tim2orbit,'23-jun-92 6:00',/print} \index{TIM2ORBIT}\index{determining week IDs}\index{week IDs}
%
The item returned for this would be:

\begin{verbatim}
     Input               S/C Day     Night in   FileID    WeekID  D/N    SAA?
   Date     Time        Time  Min Ago  (min)
23-JUN-92  06:00:00   05:13:14 46.77   14.98  920623.0513  92_26  Day
\end{verbatim}

The S/C day started 46.77 minutes earlier, and night will occur in 14.98 minutes
(it is S/C day mode).  The FileID for this time is 920623.0513 and the WeekID
is 92\_26.

Optional Keyword Output Parameters (the number of output elements is the same 
as the input):

\vspace{0.2in}\begin{tabular}{lp{15.0cm}}
{\tt FEM  } & {\raggedright the FEM structure}\\
{\tt FID  } & {\raggedright the FileID for each input time}\\
{\tt WID  } & {\raggedright the WeekID for each input time}\\
{\tt SAA  } & {\raggedright a boolean array, TRUE if in SAA}\\
{\tt SCDAY  } & {\raggedright a boolean array, TRUE if in S/C Day}\\
{\tt TIM2FMS  } & {\raggedright the number of minutes since sunrise}\\
{\tt TIM2NIGHT  } & {\raggedright the number of minutes before sunset}\\
\end{tabular}

\subsubsection{SEL\_TIMRANGE}
Given an array of times, SEL\_TIMRANGE will return the subscripts of the
elements which fall between a set of input times.  The {\it /between}
option should be used when you want all datasets between the start and
stop times, since the default is to return the first entry BEFORE the
start time (this was for historical reasons when accessing the FEM structures).
It is possible to
have a boolean array returned which is the same length as the input.
The array will have a 1 if the input time is in the time range
specified, and a 0 otherwise.  This is useful for using with WHERE 
commands.
%
\idlinputa{ss = sel\_timrange(roadmap, st\_tim, en\_tim)}	\index{SEL\_TIMRANGE}
\idlinputb{ss = sel\_timrange(orbit\_arr, '1-jul-92', '22-jul-92', /between)}	
\idlinputc{ok = sel\_timrange(index, '23-jun-93', '24-jun-93', /boolean)}

\subsubsection{PR\_TIM2WEEK}\index{PR\_TIM2WEEK}
\index{week ID, how to determine}\index{how to determine week ID}

PR\_TIM2WEEK will convert a Yohkoh time into the corresponding week ID
and print a message on the screen.  For example:
%
\idlinputA{3}{pr\_tim2week		}{; Give the current week number}
\idlinputb{pr\_tim2week,'15-nov-91'}
\idlinputb{pr\_tim2week,'15-nov-91',/range}
%
Setting the $/range$ keyword will cause the routine to display the
first and last day of the week.  Short weeks (the first or last
week of the year) are flagged with an asterisk.  PR\_TIM2WEEK
calls ANYTIM2WEEKID to make the conversion.

\subsubsection{PR\_WEEK2TIM}\index{PR\_WEEK2TIM}

PR\_WEEK2TIM will print on the screen the first and last day of a
specified week number (integer) or Yohkoh week ID (string).  For
example:
%
\idlinputA{3}{pr\_week2tim		}{; List current Yohkoh week}
\idlinputb{pr\_week2tim,'91\_46'}
\idlinputB{3}{pr\_week2tim,'91\_46a'	}{; Last letter is optional}
\idlinputB{3}{pr\_week2tim, 4		}{; Week 4 of current year}
\idlinputB{3}{pr\_week2tim, 4, year=93	}{; Week 4 of 1993}
%
Short weeks (the first or last week of the year) are flagged with an
asterisk.  PR\_WEEK2TIM calls WEEKID2EX to make the conversion. 

\subsection{Routines for Windows and Output Devices}

\subsubsection{Making Landscape and Portrait Plots}

The command to have the PostScript plots be in landscape orientation is:
%
\idlinputa{set\_plot,'ps'}	
\idlinputb{device, /land}
%
In order to have the portrait plots take up the full page, there is
an un-official routine called LASER.  The calling sequence is:
%
\idlinputa{set\_plot,'ps'}	
\idlinputc{laser, /portrait}
%
\subsubsection{WDEF}
\index{window, X, how to make}
\index{X-window, how to make}

WDEF creates a window of a set size.  The first example will make a 512$\times$512 window in the
top right hand corner of your screen.  The second example makes a 128$\times$128 window,
and the last example makes a 900$\times$512.
%
\idlinputa{wdef,0}	
\idlinputb{wdef,0,128}	
\idlinputb{wdef,0,900,512} \index{WDEF}
%
Window 1 is in the lower right, 2 is in the upper left, and 3 is in the
lower left (even windows on top, window modulo 4 equaling 0 or 1 is on the
right)

\subsubsection{WSHOW [IDL]}

WSHOW pushes a covered IDL image window to the foreground while
keeping the text window active (this is not necessarily true for cases where the
active window is selected by the location of the cursor). Just type
%
\idlinputd{wshow} \index{WSHOW} 
%
\subsubsection{HARDCOPY}

Dumps the contents of a 'X' screen to a laser printer with either b/w or
color options by simply typing:
%
\idlinputa{hardcopy}	
\idlinputb{hardcopy, /black} \index{HARDCOPY}
%
It is recommended to only use HARDCOPY to get hardcopies for images.
If you want to get a hardcopy of a line plot, then first change the output
device to a PostScript file (idl.ps), re-run the plotting program or plotting 
commands, and then issue the print command.  An example would be:
%
\idlinputa{set\_plot, 'ps'} \index{SET\_PLOT}	
\idlinputb{.run plot\_sot}	
\idlinputb{pprint} \index{PPRINT}	
\idlinputc{set\_plot, 'x'} 
%
\index{laser plots}

\subsubsection{PPRINT}

PPRINT closes and prints an idl.ps file.  An example of how to
use it would be
%
\idlinputA{2.5}{set\_plot,'ps'		}{; opens idl.ps file}	
\idlinputB{2.5}{device, /land		}{; optionally use landscape orientation}	
\idlinputb{.... (your plot commands)}	
\idlinputb{pprint} \index{PPRINT}	
\idlinputb{set\_plot,'x'}
%
This will send the plot to the laser printer.

\subsubsection{SETDISP}
\index{DISPLAY, setting inside IDL}

It is possible to issue the ``setenv DISPLAY'' command from within IDL
by using the routine SETDISP (if the user forgets prior to starting IDL).
A sample call would be:
%
\idlinputd{setdisp, '192.68.162.109:0'}\index{SETDISP}


\subsection{Reading Exabyte Archive Tapes}

See the description of GO\_RDTAP in the User's Guide and the description of
RDTAP on page~\pageref{rdtap} in the appendix of the Reference Guide. \index{GO\_RDTAP}

\newpage %------------------------------------------------------------------------
\section{Spacecraft Attitude and Solar Ephemeris}

\subsection{Routines for Determining Spacecraft Pointing}
\index{pointing, spacecraft}
\index{spacecraft pointing}
\index{ATT database}

\subsubsection{RD\_PNT\_HIST}
\index{pointing history}
\index{history of S/C commanded pointings}
\index{spacecraft pointing, history}

The routine RD\_PNT\_HIST will read the file {\tt \$DIR\_GEN\_STATUS/pointing.history} to
determine all of the spacecraft commanded off-points.  The structure returned has
the .TIME and .DAY when the pointing change has occurred, and the offset (.OFFSET)
for that pointing change.  The S/C pointing bias is taken into account (the pointing
bias has not been changed since 28-Oct-91).\index{pointing bias}
A sample call is:
%
\idlinputa{rd\_pnt\_hist, pntdata}\index{RD\_PNT\_HIST}
%
PR\_PNT\_HIST provides 
a simple method to display a summary of the commanded spacecraft pointing changes.
Sample calls are:
%
\idlinputa{pr\_pnt\_hist}
\idlinputb{pr\_pnt\_hist, outfil='pr\_pnt\_hist.txt'}\index{PR\_PNT\_HIST}
%
The routine SXT\_CMD\_PNT will return the SXT pixel coordinates of the
center of the sun using the spacecraft commanded pointing history database file
(calls to SXT\_CEN with the $/cmd$ switch simply call SXT\_CMD\_PNT).  A sample
call is:
%
\idlinputd{xy = sxt\_cmd\_pnt(index)}\index{SXT\_CMD\_PNT}

\subsubsection{SXT\_CEN}
\index{GET\_SUNCENTER}\index{SXT\_CEN}

The routine SXT\_CEN should be used by all routines that wish to
determine the S/C pointing.  The function will return the pointing
in SXT full resolution pixels for the set of times passed.  The
following logic is used if no switches are used

\IItem
\item Check to see if the ATT database files are available.  The
	processed pointing value has already been calculated and is
	saved in those files.
\item If the ATT step above fails, check to see if the ATR database file exist (or old PNT files).
	If they do, call GET\_SUNCENTER to reduce the raw
	IRU and HXA data stored in the PNT files and return the
	actual S/C pointing.
\item If the ATT and PNT steps fail, then read the commanded S/C file.  This
	result gives the coarse pointing and will not correct for S/C drift.
\end{itemize}

Some sample calls are:
%
\idlinputa{cen = sxt\_cen(times)}
\idlinputb{cen = sxt\_cen(roadmap, /cmd)}
\idlinputb{cen = sxt\_cen(index, roll=roll)}
%
The S/C roll value can optionally be returned with the keyword parameter {\it roll}.
The roll values are only valid if the ATT database is available.  If the {\it /cmd}
option is used, it will use the commanded S/C data file which is much faster than
reading the ATT database files.  See the discussion on
page~\pageref{get_suncenter} for more details on the ATT database.

\subsubsection{GET\_ROLL}
\index{spacecraft roll}
\index{roll, spacecraft}

The spacecraft is generally aligned to solar north, although it oscillates
around slightly.  The actual S/C roll value is determined from the
star tracker and is stored in the ATT database file.  There is also a one 
degree offset between the spacecraft and the SXT CCD-north.  The orientation
of the offset is shown in Fig.~\ref{fighelproll1}.

\insertplot{fig_help_roll1.idlps}{Roll Angle Offset for the SXT}{fighelproll1}{6.25}{3.5}

The sign convention of the roll value which is returned by GET\_ROLL is
shown in Fig. ~\ref{fighelproll2}.

\insertplot{fig_help_roll2.idlps}{Sign Convention for the SXT Roll Angle}{fighelproll2}{6.25}{3.5}

Figs.~\ref{fighelproll1} and~\ref{fighelproll2} can be displayed on the screen by
using the IDL routine HELP\_ROLL.  \index{HELP\_ROLL}

Some sample calls to GET\_ROLL are (it only accesses the date and time in {\it index}):
%
\idlinputa{roll = get\_roll(index)}\index{GET\_ROLL}
\idlinputb{print, get\_roll('23-jun-93 1:00')}
\idlinputb{print, get\_roll('23-jun-93 1:00', /predict)}
%
The {\it /predict} option tells it to not access the ATT database but to use the
predicted roll based on seasonal variations.  This value can be very incorrect
for certain times.  The {\it /notsxt} option will return the S/C roll value
without the SXT offset, and {\it /sxt\_offset} will just return the fixed
offset value between S/C north and SXT north.  The routine SXT\_CEN calls
GET\_ROLL automatically and you can get the roll using the keyword {\it roll}
with SXT\_CEN.

\subsubsection{HXA\_SUNCENTER}
\index{HXA aspect sensor}

Calculate the suncenter position (in SXT pixel coordinates) from
the HXA info in the ATR (or PNT) files.  Tries to reconstruct hidden limbs.
%
\idlinputa{sunc = hxa\_suncenter(atr)}	\index{HXA\_SUNCENTER}
\idlinputb{sunc = hxa\_suncenter(index=index)}
%
If the input {\it atr} or {\it index} have N elements, then the
result will be a floating array of 4xN elements.  {\it sunc(0,*)}
is the SXT column number in `IDL coordinates'\footnote{See the Appendix of the 
Instrument Guide for a discussion of SXT pixel coordinates}, {\it sunc(1,*)} 
is the SXT line number, {\it sunc(2,*)}
is the milliseconds of day for the input time, and {\it sunc(3,*)}
is the days since 1-Jan-79 number for the input time.

\subsection{Routines to Convert Coordinate Systems}

\subsubsection{Definition of the Coordinate Systems ``P'', ``A'', ``H'' and ``C''}
\index{coordinate systems ``P'', ``A'', ``H'' and ``C''}

There are three common coordinate systems which can be used when analyzing
the Yohkoh data. 

\begin{itemize}
\item [P] signifies ``pixel''.  This is the full resolution IDL pixel
address
\footnote{See the Appendix of the Instrument Guide for a discussion of SXT pixel coordinates}
when using SXT images.  This means that (0,0) is in the lower left
corner of the image, which is the south-east corner.  The upper right 
corner is (1023, 1023).  The coordinates are rectangular.
\item [A] is a rectangular coordinate system relative to sun center as viewed from the earth
in units of arcseconds.  A point on the farthest edge on the east limb
will have the value (-900, 0).
The B-angle is not taken into consideration, so a (0,0) value will not
be on the equator unless the B-angle is zero.  
\item [H] signifies the heliocentric coordinates.  The solar B-angle is
taken into consideration when calculating this value.  These coordinates
are spherical.
\item [C] signifies the Carrington longitude
\item [HS] signifies a string representation of heliocentric coordinates
(``N12W23'' for example)
\item [HXT] signifies the HXT pixel address in 126 arcsec units.
\end{itemize}

The first three of these conventions have a two element array for each point
described.  If there are N points, then the array will be 2xN.  The
values stored in (0,*) are the position in the east/west direction
(longitude for heliocentric coordinates), with east being negative.  The
values in (1,*) are in the north/south direction (longitude for
heliocentric coordinates), with south being negative. 

\subsubsection{CONV\_P2A and CONV\_A2P}

When converting between pixel value and angle the following steps are
taken.

\EEnumerate
\item Determine the pixel address for the center of the sun.  SXT\_CEN
is used to derive this value.  It will read the ATT database by default,
but can use the commanded value if the /CMD option is used on the
call to CONV\_P2A.
\item Determine the roll.  SXT\_CEN returns this value too.
\item Perform the simple math to convert from absolute pixels to an
angle relative to the sun center.
\end{enumerate}

\insertplot{fig_conv_p2a.idlps}{Corrections Performed by CONV\_P2A}{figconvp2a}{6.25}{3.5}

Some sample calls are:
%
\idlinputa{ang = conv\_p2a(pix, date)}\index{CONV\_P2A}
\idlinputb{ang = conv\_p2a(pix, date, /cmd)}
\idlinputb{pix = conv\_a2p(ang, date, /cmd)}\index{CONV\_A2P}
%
The date is required in order to determine the location of the sun on the CCD and
the roll angle.  The S/C roll angle and S/C pointing is taken into consideration, but
the solar B-angle is not taken into account.

\subsubsection{CONV\_A2H and CONV\_H2A}
\index{coordinates, heliocentric}
\index{heliocentric coordinates}

The routines CONV\_A2H and CONV\_H2A convert between ``angle'' and heliocentric coordinates.
The solar B-angle is taken into consideration when converting back and forth.  The
algorithm for converting between an angle position and heliocentric is
rather straight forward.  There are some problems when the position 
selected is off of the limb.  In this case, a projection is attempted.
It is possible to get the heliocentric coordinate in a string format
similar to ``N12W23'' by using the {\it /string} option.  The input
of CONV\_H2A can be a string array with a similar format (``N12W23'').
Some sample calls are:
%
\idlinputa{hel = conv\_a2h(ang, date)}\index{CONV\_H2A}
\idlinputb{hel = conv\_a2h(ang, date, /cmd)}\index{CONV\_A2H}
\idlinputc{ang = conv\_h2a(hel, date, /cmd)}
%

\subsubsection{CONV\_P2H and CONV\_H2P}

The CONV\_P2H routine simply calls CONV\_P2A first, and passes the
results to CONV\_A2H to end up with heliocentric coordinates.  CONV\_H2A
works in the opposite manner.  See those routines for an idea
of the keyword options.  The heliocentric coordinate input can be
a string type, in which case CONV\_HS2H is called first. \index{CONV\_P2H}\index{CONV\_H2P}

\subsubsection{CONV\_P2HXT and CONV\_HXT2P}
\index{coordinates, HXT}
\index{HXT coordinates}

The routines CONV\_P2HXT and CONV\_HXT2P allow for the conversion between SXT pixel addresses and
the HXT pixel addresses. \index{CONV\_P2HXT}\index{CONV\_HXT2P}

\subsubsection{CONV\_P2C and CONV\_C2P}
\index{coordinates, Carrington}
\index{Carrington coordinates}

The routines CONV\_P2C and CONV\_C2P allow for the conversion between SXT pixel
address and the Carrington rotation and longitude. \index{CONV\_P2C}\index{CONV\_C2P}

\subsubsection{CONV\_H2HS and CONV\_HS2H}

The routines CONV\_H2HS and CONV\_HS2H convert between the string notation of heliocentric
coordinates (``N12W23'') and the integer format. \index{CONV\_H2HS}\index{CONV\_HS2H}

\subsection{Routines for Ephemeris Information}

\subsubsection{GET\_RB0P}
\index{ephemeris, solar}
\index{solar ephemeris}

For a given date and time, GET\_RB0P returns the
solar radius, solar B-angle, and p angle for that time.
This routine used to be called PB0R, but GET\_RB0P can handle
any of the three standard time formats. \index{PB0R}
%
\idlinputa{rb0p = get\_rb0p('15-nov-91')}	\index{GET\_RB0P}
\idlinputb{rb0p = get\_rb0p(index)}
%
If N input times are passed in, then the output is 3xN where
{\it rb0p(0)} is (R) solar radius in arcseconds measured outside earth's atmosphere, 
{\it rb0p(1)} is (B-angle) heliographic latitude of the central point of the
solar disk, and
{\it rb0p(2)} is (P) position angle of the northern extremity of the axis
of the sun's rotation, measured eastward from the
geographic north point of the solar disk.

\subsubsection{DIFF\_ROT}
\index{differential rotation}
\index{solar differential rotation}

DIFF\_ROT Computes the differential rotation of the sun
%
\idlinputa{dlong = diff\_rot(ddays,latitude)}\index{DIFF\_ROT}
%
\vspace{0.3in}\begin{tabular}{ll}
     dlong & {\raggedright  change in longitude in DEGREES (output)}\\
     ddays & {\raggedright  number of days to rotate}\\
     latitude & {\raggedright  latitude in DEGREES}\\
     /allen & {\raggedright  use values from Allen, Astrophysical Quantities (DEFAULT)}\\
     /howard & {\raggedright  use values for small magnetic features from Howard et al.}\\
     /sidereal & {\raggedright  use sidereal rotation rate (DEFAULT)}\\
     /synodic & {\raggedright  use synodic rotation rate}\\
\end{tabular}

\subsection{Routines to Access the Yohkoh Attitude Database}

\subsubsection{RD\_PNT}\index{RD\_PNT}

The PNT database was broken up into two parts in mid-1993.  See
RD\_ATR and RD\_ATT.  The PNT database is no longer used.

\subsubsection{RD\_ATR and RD\_ATT}
\index{ATT database}

The RD\_ATR routine allows a user to read the raw S/C pointing information
which is stored in secondary database files.  The
ATR files have the IRU, HXA, and TFSS information for every major
frame.  The RD\_ATT routine allows a user to read the processed S/C pointing
information.  Sample calls would be:
%
\idlinputa{rd\_atr, sttim, entim, atr}	\index{RD\_ATR}
\idlinputb{rd\_att, sttim, entim, att}	\index{RD\_ATT}
\idlinputb{rd\_atr, '1-nov-91', '3-nov-91', atr} 
%
The ATR structure that is returned has the following tags:

\vspace{0.2in}\begin{tabular}{lp{15.0cm}}
{\tt .TIME} 	& {\raggedright  The major frame time for the data}\\
{\tt .DAY} 	& {\raggedright  The major frame day for the data}\\
{\tt .DP\_MODE}	& {\raggedright  The S/C DP mode (see GT\_DP\_MODE)}\\
{\tt .DP\_RATE}	& {\raggedright  The S/C telemetry rate (see GT\_DP\_RATE)}\\
{\tt .IRU} 	& {\raggedright  A three element array with the raw IRU X,Y,Z values}\\
{\tt .TFSS} 	& {\raggedright  A two element array with the raw TFSS values}\\
{\tt .HXA} 	& {\raggedright  A four element array with the addresses of the \\
				limbs as detected by the HXA}\\
\end{tabular}

The ATT database is derived from the HXA and IRU data using the routine IRUHXA2SXT \index{IRUHXA2SXT}
which was written by Jean-Pierre Wuelser.\label{get_suncenter}
The ATT structure that is returned has the following tags:

\vspace{0.2in}\begin{tabular}{lp{15.0cm}}
{\tt .TIME} 	& {\raggedright  The major frame time for the data}\\
{\tt .DAY} 	& {\raggedright  The major frame day for the data}\\
{\tt .DP\_MODE}	& {\raggedright  The S/C DP mode (see GT\_DP\_MODE)}\\
{\tt .DP\_RATE}	& {\raggedright  The S/C telemetry rate (see GT\_DP\_RATE)}\\
{\tt .PNT} 	& {\raggedright  A three element array with the derived center for the sun in \\
				 SXT full resolution pixels. \\ 
				 (0) = E/W (East has smaller values) in 1/100 SXT FR pixel units. \\
				 (1) = N/S (South has smaller values) in 1/100 SXT FR pixel units. \\
				 (2) = Roll in 0.1 arcsecond units - Negative values are S/C rotating \\
					counter-clockwise relative to solar north }\\
{\tt .STATUS1} 	& {\raggedright  Indicates the reliability of each sun center position.\\
				1: plain S/C commanded value used, no dejittering with IRU.\\
				2: S/C commanded value dejittered with IRU.\\
				4: HXA value dejittered with IRU.  Standard result, good.\\
				Note: S/C commanded values can be several pixels off.}\\
{\tt .STATUS2} 	& {\raggedright  - Reserved}\\
{\tt .ADS} 	& {\raggedright  - If set, then the S/C roll value from the ADS database was \\
				inserted into the structure}\\
\end{tabular}


\subsubsection{GET\_ATT}

For a given set of input times, GET\_ATT will read the relevant
ATT records (if 100 input times are passed in, then 100 ATT records
are returned).  This routine is useful when trying to access ATT
data that covers a set of times over a long time span.
A sample call would be:
%
\idlinputd{get\_att, index, att}\index{GET\_ATT} 
%
\subsubsection{GT\_HXA}

GT\_HXA will extract the HXA data from a ATR structure or
from an ADA data structure.  Some sample calls are:
%
\idlinputa{hxa = gt\_hxa(atr)}	\index{GT\_HXA}
\idlinputb{sxtcen = gt\_hxa(atr\_data, /sxtpix)}	
\idlinputb{sxtcen = gt\_hxa(atr\_data, /sxtpix, /x)}	
\idlinputb{hxacen = gt\_hxa(atr\_data, /hxacen)}	
\idlinputb{hxacen = gt\_hxa(atr\_data, /hxacen, /y)}	
\idlinputb{x1 = gt\_hxa(atr\_data, 0)}	
\idlinputb{x2 = gt\_hxa(atr\_data, 1)}	
\idlinputb{y1 = gt\_hxa(ada\_data, 2)}
%
The {\it hxa} result would be 4xN where there are four addresses
for HXA limbs.
The {\it /x} or {\it /y} switches will result in a
single address being returned, and the {\it /sxtpix} will return
the results in SXT pixel coordinates.

\subsubsection{GT\_IRU}

It is possible to extract the IRU information from the ATR or ADA
structures using GT\_IRU.  The output is in arcseconds.  It
is also possible to have the drift in the IRU removed for short
time periods by using the /RESID switch (it fits a line to the drift
and subtracts that drift).  Sample calls are:
%
\idlinputa{iru = gt\_iru(atr)}	\index{GT\_IRU}
\idlinputb{iru = gt\_iru(atr, /resid)}	
\idlinputb{iru = gt\_iru(ada)}	
\idlinputc{iru = gt\_iru(ada, index, /resid)}
%

\newpage %------------------------------------------------------------------------
\section{Bragg Crystal Spectrometer (BCS)}

\subsection{Routines for Data Selection}
\index{data selection, BCS}
\subsubsection{LIST\_BDA}

A sample call would be:
%
\idlinputa{list\_bda, roadmap, start, nrec, ss=ss}\index{LIST\_BDA}
%
where {\it roadmap} is the input.

\subsubsection{SELECT\_BDA}

\begin{sloppy}
Use SELECT\_BDA to plot the roadmap light curve of a selected channel
and  select  the  time  period  of  interest using the cursors.  (Note:
there is an option to read the data in with \mbox{SELECT\_BDA} if required).
A sample call would be:
\end{sloppy}
%
\idlinputa{.run select\_bda}\index{SELECT\_BDA}
%
where {\it roadmap} is the input.

\subsection{Routines for Making Time Plots}

\subsubsection{BCS\_24HR\_PLOT}

If  you  interested  only  in whether  the  BCS   has   seen   anything,   use
BCS\_24HR\_PLOT.  This works using only roadmap data and allows intervals
to de selected by date (all files covering this data are  then  used).   By
default,  channel  3  (Ca XIX) is plotted.  Note:  YODAT does NOT need to
have been run before BCS\_24HR\_PLOT.  In its default mode, BCS\_24HR\_PLOT uses the 
observing log files.  Samples are:
%
\idlinputa{bcs\_24hr\_plot, '15-nov-91'}	\index{BCS\_24HR\_PLOT}
\idlinputc{bcs\_24hr\_plot, '15-nov-91', chan=4} 
%
\subsubsection{PLOTT\_BDA}

PLOTT\_BDA will make a light curve plot using either the index or
roadmap.  The second `T' signifies that it is a time plotting routine.
Four plots are made on the page, one for each channel.  Some sample calls are:
%
\idlinputa{plott\_bda, index}	\index{PLOTT\_BDA}
\idlinputb{plott\_bda, roadmap}	
\idlinputc{plott\_bda, roadmap(100:200), psym=10} 
%
\subsubsection{LCBDA [*]}

LCBDA will make a light curve plot using either the index or
roadmap.  It is almost identical to PLOTT\_BDA except that you can
specify a channel and only get that channel plotted.  Some sample calls are:
%
\idlinputa{lcbda, index}	\index{LCBDA}
\idlinputc{lcbda, roadmap, chan=1} 
%

\subsection{Routines for Making Spectral Plots}

\subsubsection{PLOTS\_BDA}

PLOTS\_BDA allows for the spectra for all four channels to be plotted 
to one page.  A sample calling sequence is:
%
\idlinputd{plots\_bda, index, data}\index{PLOTS\_BDA} 
%
\subsubsection{PLOTBDA  }

The light curve and spectra from the BDA file may be plotted using PLOTBDA.
This is an interactive program and it will read its own data.
%
\idlinputd{.run plotbda}\index{PLOTBDA} 
%
\subsubsection{BCS\_MULTI  }

Many spectra may be plotted on a page with BCS\_MULTI.
%
\idlinputa{bcs\_multi, index, data}	\index{BCS\_MULTI}
\idlinputc{bcs\_multi, index, data, chan=1} 
%
\subsubsection{BCS\_CONT  }

The evolution of  spectra  against  time  can  be  displayed  as
a contour map using the routine BCS\_CONT.  Note:  The time axis of BCS\_CONT is uniform, but
those of DISP\_BDA and GS are not.
%
\idlinputa{bcs\_cont, index, data}	\index{BCS\_CONT}
\idlinputc{bcs\_cont, index, data, chan=1} 
%
\subsection{Routines for 2-D Spectral Display}

\subsubsection{DISP\_BDA  }

The evolution of  spectra  against  time  can  be  displayed  as a pseudo-image 
using the routine DISP\_BDA.  Note:  The time axis of DISP\_BDA is not uniform.
%
\idlinputd{disp\_bda, index, data}\index{DISP\_BDA} 
%

\subsubsection{BCS\_SPMOVIE  }

After selecting a time interval, a movie of  the  changing  spectra  for  a
given  channel  may  be  displayed by BCS\_SPMOVIE.  Note:  This program
will only run on an X-windows workstation.
%
\idlinputa{bcs\_spmovie, index, data}	\index{BCS\_SPMOVIE}
\idlinputc{bcs\_spmovie, index, data, chan=1} 
%
\subsubsection{GS   [*]}

If you are interested in more detail of what spectra the BCS has  observed,
use  GS  ---  this  routine  must be run after the data has been read in with
YODAT.  There is an upper limit on how much data can be handled at  a  time 
(about 900 spectra), and some selection of the required time interval may be
needed using the methods described above, but for the per-orbit files, this
limit may not be a problem.  The advantage of GS is that you can get a good
idea of what has been seen in the spectra --- a particularly useful  tool  if
you are trawling for data.
Warning:  The time axis on the greyscale plot is not uniform!
%
\idlinputa{.run gs}\index{GS}
%
All the routines that run from GS require that spectra  be  selected  first
using the cursor routine.
%
\idlinputd{.run gs\_cur}\index{GS\_CUR}

\subsection{Routines for Data and Information Extraction}

\subsubsection{EXT\_BCSCHAN  }

The spectra for a single channel may be extracted with EXT\_BCSCHAN
%
\idlinputd{data\_out = ext\_bcschan(index, data, chan)}\index{EXT\_BCSCHAN} 
%
\subsubsection{LIST\_BDA}

If you are interested in what modes the BCS  was  executing,  or  what  the
count rate  in  a particular channel has observed at a particular time, this
can be determined by using LIST\_BDA.  By default the count rate for  channel
3 (Ca XIX) is given in the listing.  Sample calls are:
%
\idlinputa{list\_bda, roadmap, start, nrec}\index{LIST\_BDA}	
\idlinputb{list\_bda, roadmap, start, nrec, chan=4}
%
where {\it roadmap} is the input.

\subsubsection{GT\_TOTAL\_CNTS}

GT\_TOTAL\_CNTS extracts the information from the TOTAL\_CNTS field which used
the actual spectra to calculate the total number of counts.  The routine also
normalizes so that it returns counts/sec.  In the first example below, all
four channels are returned, so the output is 4xN.  In the second example,
only channel 1 is extracted.  It is possible to get a string defining the
channel selected by using the {\it title} keyword option.
%
\idlinputa{x = gt\_total\_cnts(roadmap)}	\index{GT\_TOTAL\_CNTS}
\idlinputb{x = gt\_total\_cnts(roadmap,1)}	
\idlinputc{x = gt\_total\_cnts(index,2,title=title)} 
%
\subsubsection{GT\_BLOCKID}

GT\_BLOCKID returns information on how the BCS data were blocked.
%
\idlinputa{x = gt\_blockid(roadmap)}\index{GT\_BLOCKID}
%
\vspace{0.2in}\begin{tabular}{|l|l|} \hline
        0 & { Normal Queue Data Block } \\
        1 & { Fast Queue Data Block } \\
        2 & { Micro Dump Block (fixed extraction) } \\
        3 & { Cal Data Block (fixed extraction) } \\
        4 & { Queue data where the modeID in the header is not recognized } \\
        5 & { Normal or fast queue data which have fill data (garbage)  } \\ \hline
\end{tabular}

\subsection{Routines for Calibration and Analysis}

\subsubsection{BCS\_DECOMP}

The BCS data are normally compressed from a 12-bit word to an 8-bit word.
BCS\_DECOMP takes the compressed data array ({\it data}) and creates a floating point
array ({\it ndat}) of the decompressed numbers by typing:
%
\idlinputd{ndat = bcs\_decomp(data)} \index{BCS\_DECOMP} 
%
\subsubsection{BCS\_NORM}

BCS\_NORM normalizes data recorded by the BCS for integration time, and extracts the
Fast Queue data if present.  A sample call is:
%
\idlinputd{dspec = bcs\_norm(index, data)}\index{BCS\_NORM} 
%
\subsubsection{SUM\_BDA}

All spectra with mode ID {\it modeid} will be summed by SUM\_BDA with the following command:
%
\idlinputd{data\_out = sum\_bda(index, data, modeid, nsum)}\index{SUM\_BDA} 
%
\subsubsection{PLOT\_REF [*]}

Overplot several spectra to show evolution of blue wing and line width.
%
\idlinputd{plot\_ref, index, data, channel, dset\_arr} \index{PLOT\_REF} 
%
\subsubsection{BCS\_DTFAC}
The dead-time correction factors can be calculated with BCS\_DTFAC:
%
\idlinputd{dd = bcs\_dtfac(index,dp\_sync,type,stime,etime)}\index{BCS\_DTFAC}
%
\subsubsection{BCS\_POINT}
The position of a source on the solar disk may be determined from  the  bin
number  of  the  resonance  line with BCS\_POINT.  If the epoch is provided,
this routine will also return the heliocentric latitude:
%
\idlinputd{dd = bcs\_point(wbin [,chan=n [,date=date, etc.]])}\index{BCS\_POINT}
%
\subsubsection{BCS\_SYNTHETIC}
\index{BCS synthetic spectra}
\index{synthetic spectra, BCS}
\index{spectra, synthetic, BCS}

BCS\_SYNTHETIC is a simple main program to compute BCS synthetic spectra in 
flux units.  The program will prompt the user for the BCS channel number 
(1,2,3,4 = Fe XXVI, Fe XXV, Ca XIX, S XV), the electron temperature (MK) 
and the Doppler temperature (MK).  To run the program type:
%
\idlinputa{.run bcs\_synthetic}\index{BCS\_SYNTHETIC}
%
The program calls the procedure BCS\_SPEC to perform the spectral 
calculations.  It defaults to a wavelength coverage which is appropriate 
for mid-latitude observations.  The BCS\_SPEC defaults for atomic code, 
ionization balance and abundance will be used.  The computation is made for
an emission measure of EM = 10$^{50}$ cm$^{-3}$.

\subsubsection{BCS\_SPEC}

BCS\_SPEC is a procedure to compute a BCS synthetic spectrum in flux units.  
Sample calling sequences are:
%
\idlinputa{flux = bcs\_spec(Chan,Te6)  ; Use Td6=Te6 and default wavelengths} \index{BCS\_SPEC}
\idlinputb{flux = bcs\_spec(Chan,Te6,Td6,Wave,Waveo=Waveo,Ainfo=Ainfo,Vel=Vel)}
%
where the inputs are {\it Chan} (the BCS channel number of a BSC structure), {\it Te6} 
and {\it Td6} (electron and ``Doppler'' temperatures in MK), and {\it Wave} is a vector of 
the edges of the BCS wavelength bins.  Returned will be {\it flux} (assuming 
EM = 10$^{50}$ cm$^{-3}$), {\it Waveo} (wavelengths at the centers of the bins), and 
{\it Ainfo} (a structure variable containing information about the calculated 
spectrum).  {\it Vel} is an optional input keyword to specify the bulk velocity in km/s.  
More information is available in the documentation header.
BCS\_SPEC is called by BCS\_SYNTHETIC and FIT\_BSC.  \index{FIT\_BSC}

Three routines control the defaults for the atomic data used in the calculation.  
These are GET\_ELEMABUN (abundances), GET\_IONBAL (ionization balance) and 
GET\_ATOMIC (the atomic data for the line calculation).

\subsection{BSC Routines}
\index{BSC (BCS Spectrally Calibrated)}

\subsubsection{HELP\_BSC}

To get quick on-line help for various BSC procedures and functions,
type:
%
\idlinputd{help\_bsc}\index{HELP\_BSC}
%
\subsubsection{MK\_BSC}
\index{BSC files, creating}
\index{calibrated spectra, BSC}

MK\_BSC makes BSC\_INDEX and BSC\_DATA structures from the BDA INDEX and DATA.
These structures contain instrumentally corrected BCS data for selected
channels and accumulation times. A typical run would look like:
%
\idlinputa{mk\_bsc,index,data,bsc\_index,bsc\_data,dp\_sync=dp\_sync}\index{MK\_BSC}
%
To analyze BCS data, you would begin by using YODAT to read the BDA
data file for the dates and times you are interested in. Yodat will return
a BDA index structure INDEX, a BDA data array DATA, and a structure DP\_SYNC
which contains the DP synchronous data needed for deadtime corrections.

MK\_BSC will prompt for various inputs such as start and stop times, channels to
process, integration times, and which corrections (deadtime, crystal curvature,
flux calibration) to apply. The DP\_SYNC keyword is optional, but must be
entered the first time if deadtime corrections are required. Subsequent calls
to MK\_BSC will use the last values of DP\_SYNC data passed via this keyword.

The following keywords are also accepted:

\vspace{0.2in}\begin{tabular}{ll}
{\tt /LAST   } & {\raggedright  -- run using the information stored in the latest BSC\_INDEX.}\\
{\tt /DEF    } & {\raggedright  -- run using the default settings. }\\
{\tt /WID    } & {\raggedright  -- run via a widget interface.}\\
{\tt /BSA    } & {\raggedright  -- run to make BSA index only (do not make BSC\_DATA).}\\
{\tt /SAVE   } & {\raggedright  -- save BSC (or BSA) index (and data) in a file.}\\
{\tt         } & {\raggedright    (The file will be named BSCyymmdd.hhmm, based on the time of the }\\
{\tt         } & {\raggedright     first data interval).}\\
{\tt /VERBOSE} & {\raggedright  -- echo extra information about SAA/NIGHT or MODEID/BLOCKID }\\
{\tt BDAFILE } & {\raggedright  -- input BDAFILE to read.}\\
\end{tabular}\vspace{0.1in}

The instrumentally corrected data will be output to a new set of structures
BSC\_INDEX and BSC\_DATA. The data in BSC\_DATA are stored as 256 element floating
point arrays in fields with the following definitions: 

\vspace{0.2in}\begin{tabular}{ll}
{\tt .COUNTS  } & {\raggedright  -- accumulated counts (per detector bin) }\\
{\tt .BIN     } & {\raggedright  -- physical detector position}\\
{\tt .ERROR   } & {\raggedright  -- spectral uncertainties (in counts) }\\
{\tt .WAVE    } & {\raggedright  -- nominal wavelength array (\AA) }\\
{\tt .FLUX    } & {\raggedright  -- flux-calibrated data (ph cm$^{-2}$ s$^{-1}$ \AA$^{-1)}$}\\
{\tt .WAVE\_FIT} & {\raggedright  -- wavelength array for the fitted spectra (\AA)}\\
{\tt .FLUX\_FIT} & {\raggedright  -- fitted spectra}\\
\end{tabular}\vspace{0.1in}

Not all the above fields will be present. The fields that are present
will depend on the corrections requested in MK\_BSC. The actual data
in each field array will occupy the first 0:NBINS-1 locations, 
where NBINS is the number of actual detector bins containing
valid data. The value of NBINS is stored in BSC\_INDEX.BSC.NBINS.

\subsubsection{SEL\_BSC}

SEL\_BSC extracts wavelength and flux fields from BSC\_DATA.
%
\idlinputa{sel\_bsc,bsc\_index,bsc\_data,new\_index,new\_data,wave,flux,eflux}\index{SEL\_BSC}
%
The selected index and data structures are returned in NEW\_INDEX and NEW\_DATA.
The wavelength, flux, and uncertainties in the flux are returned in the arrays
WAVE, FLUX, and EFLUX.

The following keywords are also accepted:

\vspace{0.2in}\begin{tabular}{ll}
{\tt CHAN (in)    } & {\raggedright - BCS channel (def is all)}\\
{\tt TSTART (in)  } & {\raggedright - start time to extract (UTPLOT format)}\\
{\tt TEND (in)    } & {\raggedright - end time to extract}\\
{\tt BIN  (out)   } & {\raggedright - Physical detector positions}\\
{\tt COUNTS (out) } & {\raggedright - observed counts (per bin) in the accumulation interval}\\
{\tt SS   (out)   } & {\raggedright - indices matching requested channel}\\
{\tt FWAVE (out)  } & {\raggedright - fitted wavelength array}\\
{\tt FIT (out)    } & {\raggedright - fitted spectrum array}\\
{\tt SFIT (out)   } & {\raggedright - fitted second component array}\\
\end{tabular}

\subsubsection{LIST\_BSC}

LIST\_BSC lists times, total counts, and accumulation times of BSC spectra.
%
\idlinputa{list\_bsc,bsc\_index,chan}\index{LIST\_BSC}
%
where CHAN is the desired channel to list.

\subsubsection{SAV\_BSC}

To save BSC index and data to a BSC file, use:
%
\idlinputa{sav\_bsc,'bsc\_file\_name',bsc\_index,bsc\_data}
%
Note that MK\_BSC will also save the data if the {\it /FILE} switch is set.

\subsubsection{RD\_BSC}
\index{BSC data, reading}

To read a BSC file, use:
%
\idlinputa{rd\_bsc,'bsc\_file\_name',ss,bsc\_index,bsc\_data}\index{RD\_BSC}
%
This procedure will return the BSC index and data structures. SS is a
vector with indices of a particular subset of data within the BSC file. For
example, using SS=INDGEN(10) will extract the first 10 data sets from the
BSC file.  To extract ALL the data sets, use $SS=-1$.

\subsubsection{BSC2BSD}

To convert a BSC file to a BSD file, use:
% 
\idlinputa{bsc2bsd,'bsc\_file\_name','bsd\_file\_name'}\index{BSC2BSD}
%
The BSD file name is optional, and will be created from the
BSC file name if not supplied.

\subsubsection{MAP\_BSC}

MAP\_BSC plots a pseudo-map of BSC spectra by stacking successive
spectra.
%
\idlinputa{map\_bsc,bsc\_index,bsc\_data}\index{MAP\_BSC}
%
The following keywords are accepted:


\vspace{0.2in}\begin{tabular}{ll}
{\tt CHAN    } & {\raggedright BCS channel to plot.}\\
{\tt XSPACE  } & {\raggedright the value by which to shift successive spectra in the x-direction.}\\
{\tt         } & {\raggedright [def=0]}\\
{\tt YSPACE  } & {\raggedright the value by which to shift successive spectra in the y-direction.}\\
{\tt         } & {\raggedright [def=0] }\\
{\tt TSTART  } & {\raggedright the time of the first spectrum to plot (with date optional).}\\
{\tt         } & {\raggedright [sample format,TSTART='9:32', def = first spectrum in BSC\_DATA]}\\
{\tt TEND    } & {\raggedright the time of the last spectrum to plot.}\\
{\tt         } & {\raggedright [def = last spectrum in BSC\_DATA]}\\
\end{tabular}

\subsubsection{LC\_BSC}

LC\_BSC plots light curves of selected spectral regions.
%
\idlinputa{lc\_bsc, bsc\_index, bsc\_data,  t, y, chan=chan,/flux}\index{LC\_BSC}
%
This program first plots a spectrum at the peak of the flare. The user can
select a spectral region with the cursor. The light curve derived from the sum
of wavelength points within this region is returned in the array $Y$. The time (UT)
is returned in $T$. If the BSC data are flux calibrated, then using the {\it FLUX}
keyword will return the light curve in units of photons cm$^{-2}$ s$^{-1}$.
The optional keyword {\it over} will overplot successive light curves.

\subsubsection{WBDA}

WBDA provides a simple widget interface that allows browsing of BDA files.
It is invoked by:
%
\idlinputa{wbda}\index{WBDA}
%
The program will provide a set of menus from which BDA files can be selected
either by date, filename, or directory location. WBDA will plot light curves and
spectra for a specific channel, accumulate spectra for selected  integration
times, and apply dead-time, curvature, and flux corrections. The BDA INDEX and
DATA variables produced by YODAT can be also input directly to WBDA:
%
\idlinputd{wbda,index,data}
%
\subsubsection{GT\_BSC\_BINCAL}
\index{calibration data, BCS}

This function returns a structure containing miscellaneous calibration
information for specified BCS channels:
For example, for channel 1,
%
\idlinputa{bincal=gt\_bsc\_bincal(1)}\index{GT\_BSC\_BINCAL}
%
will return the following structure:

\vspace{0.2in}\begin{tabular}{ll}
{            .CHAN         } & {\raggedright     - channel number}\\
{            .NBINS        } & {\raggedright     - number of bins per channel}\\
{            .MODEID       } & {\raggedright     - mode id}\\
{            .WAVE         } & {\raggedright     - nominal wavelength array (\AA)}\\
{            .PHYSPOS      } & {\raggedright     - physical detector position array}\\
{            .FLUXFAC      } & {\raggedright     - conversion factor array for counts/bin to photons/cm/\AA}\\
{            .SENSIT       } & {\raggedright     - mean sensitivity array for grouped bins}\\
{            .DBIN         } & {\raggedright     - detector bin width}\\
{            .W0           } & {\raggedright     - start wavelength of spectrum}\\
{            .DW           } & {\raggedright     - dispersion (angstrom/bin)}\\
{            .BINARC       } & {\raggedright     - conversion factor for arcmin to bin (bins/arcmin)}\\
{            .GAUSSW       } & {\raggedright     - FWHM Gaussian detector width (\AA)}\\
{            .RWID         } & {\raggedright     - FWHM rocking width (\AA)}\\
{            .EFAREA       } & {\raggedright     - effective area (cm$^2$)}\\
{            .NSTART       } & {\raggedright     - first valid bin}\\
{            .NEND         } & {\raggedright     - last valid bin }\\
{            .VERSION      } & {\raggedright     - version number of BCS calibration file used}\\
\end{tabular}

\subsubsection{FIT\_BSC}
\index{spectral fitting, BCS}

FIT\_BSC fits synthetic spectra to observed spectra in BSC\_DATA:
%
\idlinputa{fit\_bsc,bsc\_index,bsc\_data,fit\_index,fit\_data,chan=chan}
%
In the above call, the fitted results are returned in the new structures
FIT\_INDEX and FIT\_DATA for the channel specified by the keyword CHAN. 
If CHAN is not specified, then all channels will be fit (not recommended).

The FIT\_DATA structure contains two additional fields:

\vspace{0.2in}\begin{tabular}{lp{10.0cm}}
        .FLUX\_FIT & {\raggedright a 256-element floating point array containing 
			the fitted model spectrum matching the observed 
			spectrum in the .FLUX field} \\
        .WAVE\_FIT & {\raggedright a 256-element floating point array containing 
			computed wavelengths of the fitted model spectrum 
			in .FLUX\_FIT. } \\
        .FLUX\_FIT2 & {\raggedright a 256-element floating point array containing 
                      the fitted model spectrum corresponding to 
                      a secondary velocity shifted spectrum in the .FLUX field }

\end{tabular}

The FIT\_INDEX structure contains an additional .FIT field that contains
important fit information (parameters fit, number of iterations, chi squared,
etc).

FIT\_BSC accepts the following optional keywords:

\vspace{0.2in}\begin{tabular}{lp{12.0cm}}
{\tt         SS       } & {\raggedright  index selection vector or scalar 
			(e.g. SS=[45,46] to fit only spectra 45 and 46)}\\
{\tt         TSTART   } & {\raggedright  UT string (e.g. '9:45'). Only spectra at or 
			after TSTART will be fit. }\\
{\tt         TEND     } & {\raggedright  Only spectra at or before TEND will be fit.} \\
{\tt         LRANGE   } & {\raggedright  2-element wavelength vector range (\AA) within which to 
			limit line fitting [Default is entire range]}\\
{\tt         CRANGE   } & {\raggedright  2-element wavelength vector range (\AA) within which to 
			limit continuum fitting [Default is entire range]}\\
{\tt         TE6      } & {\raggedright  input starting guess for electron temperature (MK) 
			~ [Default is to use internal values] }\\
{\tt          TD6     } & {\raggedright  input starting guess for resonance line Doppler 
			broadening (MK) [Default is to infer from observed width] }\\
\end{tabular}

\begin{tabular}{lp{12.0cm}}
{\tt          ATTEMPT } & {\raggedright  level of fit attempt \\
\EEnumerate
\item solve only for primary emission measure (EM50) 
and line to continuum normalization factor (CNORM). 
Electron temperature and (TE6) and total Doppler 
broadening (TD6) fixed. 
\item solve for TE6, TD6, EM50, CNORM. 
\item solve for primary+secondary shifted component.
\end{enumerate}} \\
{\tt         /BLUE    } & {\raggedright equivalent to attempt=3} \\
{\tt         /NEWGUES } & {\raggedright set to NOT use results of previous fit as starting 
			input for fit to next spectrum} \\
{\tt         /PLOT    } & {\raggedright  set to plot progress of fits} \\
{\tt         /VERB    } & {\raggedright set for more information about fitting progress} \\
{\tt         /LAST    } & {\raggedright  set to use last converged parameters as starting 
			guess for fitting next spectrum. }\\
\end{tabular}

For example, to fit a Ca XIX spectrum at UT='09:04' use:
%
\idlinputa{fit\_bsc,index,data,findex,fdata,chan=3,tstart='09:04'}
%
To fit a blueshifted secondary component:
%
\idlinputd{fit\_bsc,index,data,findex,fdata,chan=3,tstart='09:04',/blue} \index{FIT\_BSC}

\subsubsection{BCS\_BROAD}
\index{velocity, BCS}\index{BCS\_BROAD}\index{determining velocities, BCS}

The relation between BCS line broadening and
velocity can be computed with BCS\_BROAD.  Some example calling sequences are:
%
\idlinputA{4.1}{Td6 = bcs\_broad(Chan,TDoppw=TDoppw)     }{; Return temperature in (MK)}
\idlinputB{4.1}{Vel = bcs\_broad(Chan,Td6=Td6,/vel)      }{; Return velocity (km/s)}
\idlinputB{4.1}{TDoppw = bcs\_broad(Chan,Td6=Td6,/Gauss) }{; Return Doppler FWHM (Ang)}
%
where $TD6$ is the equivalent Doppler Temperature (MK) and $CHAN$ is the
BCS channel number.  The parameter $TDOPPW$ does not include the
contribution due to the crystal (Lorentz) broadening, but is included
by BCS\_BROAD when it makes its calculations, based on the value of
$CHAN$.  There are several additional options available and there is a
keyword to return the crystal rocking curve width.  Most conversions
between BCS line width and velocity or between line width and
temperature can probably be accomplished using this routine. 

\subsubsection{PLOT\_BSC}
\index{BSC data, plotting}

The results of MK\_BSC and FIT\_BSC can be examined with PLOT\_BSC.
%
\idlinputa{plot\_bsc,bsc\_index,bsc\_data}\index{PLOT\_BSC}
%
PLOT\_BSC will plot light curves and spectra for user selected channels
and times, as well as fitted spectra from FIT\_BSC.

Optional keywords:

\vspace{0.2in}\begin{tabular}{ll}
{\tt CHAN  } & {\raggedright - channel to plot}\\
{\tt SS    } & {\raggedright - selected indicies of spectra to plot (default is all)}\\
{\tt /NOWID} & {\raggedright - to not use widget mode (def is widgets, if more than 1 spectrum)}\\
\end{tabular}\vspace{0.1in}

The following keywords apply only when /NOWID is set:

\vspace{0.2in}\begin{tabular}{ll}
{\tt /EBAR} & {\raggedright - oplot spectral uncertainties}\\
{\tt /HC  } & {\raggedright - make a hard copy (single spectrum only)}\\
{\tt /PS  } & {\raggedright - make a PostScript file (single spectrum)}\\
\end{tabular}\vspace{0.1in}

The following keywords apply only when /NOWID is set, and BSC\_INDEX and DATA
contain fitted spectra:

\vspace{0.2in}\begin{tabular}{ll}
{\tt /BLUE } & {\raggedright - to oplot second blueshift component (if fitted by FIT\_BSC)}\\
{\tt /VUNIT} & {\raggedright - to print fitted Doppler widths in km/s units (default is MK)}\\
{\tt /NOFIT} & {\raggedright - inhibit oplot of fitted spectra (default is oplot fit)}\\
{\tt /NOOBS} & {\raggedright - inhibit plot of observed spectra (default is plot obs)}\\
\end{tabular}

\subsubsection{FIT\_BSC\_PLOT}

FIT\_BSC\_PLOT produces time series plot results from FIT\_BSC{}.  The
routine will plot total counts, electron temperature, emission measure,
and turbulent velocity as a function of time.  Example calling
statements are:
%
\idlinputa{fit\_bsc\_plot,bsc\_index}\index{FIT\_BSC\_PLOT}
\idlinputb{fit\_bsc\_plot,bsc\_index,tstart=tstart}
\idlinputB{3}{fit\_bsc\_plot,bsc\_index,/hc         }{ ; Produce hardcopy output}
%
Consult the document header for additional options.

\subsubsection{MK\_FIT\_BSC\_EPS}\index{MK\_FIT\_BSC\_EPS}

MK\_FIT\_BSC\_EPS will produce a BCS spectrum in portrait mode.  It optionally
will specify the output file to be an EPS (encapsulated PostScript file). Some
sample calls are given below:
%
\idlinputA{4}{mk\_fit\_bsc\_eps, index, data, /hc        }{; Send plot to the printer}
\idlinputB{4}{mk\_fit\_bsc\_eps, index, data, /ps        }{; Make file but don't print}
\idlinputB{4}{mk\_fit\_bsc\_eps, index, data, /eps       }{; Create an EPS file}
\idlinputB{4}{mk\_fit\_bsc\_eps, index, data, /noatomic  }{; Suppress atomic code label}
%
MK\_FIT\_BSC\_EPS sets up the parameters to call BCS\_SPEC\_PLOT correctly.

The default X and Y size is about right for an A4 page.  The optional {\it
xoffs=xoffs} and {\it yoffs=yoffs} enable the user to position the plot
at the desired location on the page. 

\newpage %------------------------------------------------------------------------
\section{Hard X-Ray Telescope (HXT)}

\subsection{Routines for Making Time Plots}
\subsubsection{PLOTT\_HDA }

PLOTT\_HDA will make a light curve plot of all four channels using either the index or
roadmap.  The second `T' signifies that it is a time plotting routine.
Four plots are made on the page, one for each channel.  Some sample calls are:
%
\idlinputa{plott\_hda, index}	\index{PLOTT\_HDA}
\idlinputb{plott\_hda, roadmap}	
\idlinputc{plott\_hda, roadmap(100:200), psym=10} 
%
\subsection{Routines for 2-D Spectral Display}
\subsubsection{DISP\_HDA  }

The evolution of  sensor intensity against  time  can  be  displayed as a pseudo-image
using the routine DISP\_HDA.  Note:  The time axis of DISP\_HDA is not uniform.
%
\idlinputd{disp\_hda, index, data}\index{DISP\_HDA} 
%
\subsection{Routines for Data and Information Extraction}
%%\subsubsection{GT\_SUM\_L, GT\_SUM\_M1, GT\_SUM\_M2, GT\_SUM\_H}
\subsubsection{GT\_SUM\_L}

These routines will extract the average counts/sec of all 64 sensors.  
The input can be roadmap, index, or observing log and it will
get the proper structure tag and decompress it properly to 
return counts/sec/sensor.
It is possible to get a string defining the
channel selected by using the {\it title} keyword option.
%
\idlinputa{y = gt\_sum\_l(roadmap)}	\index{GT\_SUM\_L}\index{GT\_SUM\_M1}\index{GT\_SUM\_M2}\index{GT\_SUM\_H}
\idlinputc{y = gt\_sum\_l(w\_h, title=title)} 
%
\subsubsection{GET\_INFO}

See the description in the ``General Yohkoh Software'' chapter on
page~\pageref{get_info}.

\subsection{Routines for Calibration and Analysis}

\subsubsection{HXT\_QLOOK}
\index{quick look, HXT images}
\index{synthesizing HXT images}
\index{image synthesis}
\index{HXT images}


HXT\_QLOOK makes a series of HXT quick-look images (i.e. a quick-look movie).
This program is much faster than the MEM code, but should be used only
for quick-look movies.  It is very useful for verifying positions etc. before
running a long MEM job.
%
\idlinputa{hxt\_qlook, index, data, movie, hxi\_index}\index{HXT\_QLOOK}
\idlinputb{hxt\_qlook, index, data, movie, hxi\_index, patterns}

\vspace{0.2in}\begin{tabular}{lp{15.0cm}}
     index & {\raggedright HXT index from an HDA file}\\
     data & {\raggedright   HXT data from an HDA file}\\
     patterns & {\raggedright the sub-collimator modulation patterns.  Computed if not\\
                supplied.  The computation is slow, so if you plan to make\\
                a series of movies, use patterns to receive the computed \\
                patterns the first time you call HXT\_QLOOK and then use\\
                patterns to pass the modulation patterns back to the routine\\
                on subsequent calls to HXT\_QLOOK.  You must recompute the \\
                modulation patterns whenever you use a different pointing.}\\

     movie & {\raggedright  a data cube of the HXT images (output)}\\
     hxi\_index & {\raggedright  an index describing various parameters of the images.  The\\
                 time in the index is the start of the accumulation period\\
                 (output).}\\

     /new\_mod\_patterns & {\raggedright  Force a new computation of the modulation patterns,\\
                         even if the patterns parameter is set.  Normally, if\\
                         patterns is set, the modulation patterns are not\\
                         computed.  You must recompute the modulation \\
                         patterns whenever you use a different pointing.}\\
     /show\_images & {\raggedright  show each image as it is computed}\\
     /quiet & {\raggedright  don't print any diagnostics}\\
     /verbose & {\raggedright  print lots of diagnostics}\\
     smooth & {\raggedright  smoothing parameter which determines how much the inverse \\
              computation of the image is smoothed.  Default = 0.1.}\\
\end{tabular}

\subsubsection{HXTPRO}\index{HXTPRO}

See the User's Guide for a description of this program.

\subsubsection{HXT\_IMG}\index{HXT\_IMG}

See the User's Guide for a description of this program.

\subsubsection{GET\_HXT\_POS}
\index{HXT flare location}
\index{flare location, HXT}

The routine GET\_HXT\_POS will return the HXT address of the flare location.
It will perform the following checks in this order
until it finds a match.

\EEnumerate
\item Read the \$DIR\_HXT\_CAL/hxt\_flare\_pos.txt file to see if the time is in that list
\item Use the GOES heliocentric location to determine the address
\item Use an SXT image index to define the address
\item Pass in heliocentric coordinates and convert them
\item Ask for user to specify HXT address directly
\end{enumerate}

Sample calls are:
%
\idlinputa{xy0 = get\_hxt\_pos('15-Nov-91 22:37')} \index{GET\_HXT\_POS}
\idlinputb{xy0 = get\_hxt\_pos(index(20), helio='N32W23')}
\idlinputb{xy0 = get\_hxt\_pos(index(20), status=status)}
%
The optional keywords {\it /get\_sxt, /get\_goes} and {\it helio} will
force the calculation of the function to use that technique.  The
keyword option {\it /nouser} should be used when running in batch mode as it
will inhibit asking the user for input.  The {\it status} output is
a $-1$ if no match has been found, 1 for HXT flare list, 2 for SXT image,
3 for GOES event list, 4 for heliocentric coordinate passed in, and
5 for user input.

\subsubsection{HXT\_FSP and HXTBOX\_FSP [*]} \index{spectral fitting}
\index{spectral fitting, HXT}

HXT\_FSP is the same as HXS\_FSP, but for HXT spectra.  See HXS\_FSP for a
better description.   Index and data come from an hda file.
%
\idlinputa{HXT\_FSP, index, data, fit\_pars} \index{HXT\_FSP}
%
HXTBOX\_FSP fits spectra to a given box, chosen by LCUR\_IMAGE, for a set of 
HXT images in the HXI structure; index and data come from and hxi file 
of deconvolved images.
%
\idlinputa{HXTBOX\_FSP, index, data, fit\_pars}   \index{HXTBOX\_FSP}
%
\subsubsection{SXTHXT\_FSP and SXTHXTBOX\_FSP[*]} \index{spectral fitting}

SXTHXT\_FSP fits combination SXT and HXT spectra, no spatial resolution! $index$ and 
$data$ are uncompressed SXT images, $hindex$ and $hdata$ are uncompressed HXT data, from 
an HDA file.
%
\idlinputa{SXTHXT\_FSP, index, data, hindex, hdata, fit\_pars} \index{SXTHXT\_FSP}
%
SXTHXTBOX\_FSP fits SXT-HXT spectra for a box chosen using LCUR\_IMAGE.  $hindex$ must be 
the HXI structure, and $hdata$ are HXT images. You should be sure of alignment 
beforehand.
%
\idlinputd{SXTHXTBOX\_FSP, index, data, hindex, hdata, fit\_pars} \index{SXTHXTBOX\_FSP}
%
\subsubsection{HXT\_DECOMP}

HXT\_DECOMP will decompress the HXT data.  A sample call is
%
\idlinputd{odata = hxt\_decomp(data)}\index{HXT\_DECOMP}

\newpage %------------------------------------------------------------------------
\section{Soft X-Ray Telescope (SXT)}

\subsection{Routines for Data Selection}
\index{data selection, SXT}

\subsubsection{SSWHERE}
\index{filter selection}

SSWHERE is a widget-driven program that creates an array of subscripts ({\it ss}) that fulfill a set of
criteria that you define to select SXT images.  For example to make an {\it ss}
array for YODAT where you want to select images from a data
set represented by roadmap, you merely type:
%
\idlinputa{ss=sswhere(roadmap)} \index{SSWHERE}
%
SSWHERE works on both the roadmap and index structures.  Available selection
criteria are:

\IItem
\item completeness of the image
\item SXT mode (normal/dark image/calibration)
\item pixel resolution
\item compression mode
\item filters
\item exposure DPE
\item DP mode
\item field of view location (see lower buttons)
\item time period (see lower buttons)
\end{itemize}

If you get a ``No matching Data'' response, check that you have selected all possible options.

\subsubsection{SHOW\_OBS3  }

SHOW\_OBS3 plots a time line summary of the SXT images that are in
the index or roadmap.  In addition to plotting a tick for each image
available, it shows the DP mode, DP rate, where the S/C days
are, and where SAA passages occur.  Some sample calls to SHOW\_OBS3 are:
%
\idlinputa{show\_obs3, roadmap}	\index{SHOW\_OBS3}
\idlinputb{show\_obs3, index}
%
It is possible to select images using SHOW\_OBS3 by clicking on
diagonally opposite corners of a box surrounding the images you wish
to select.  The calling sequence for that is:
%
\idlinputa{show\_obs3, roadmap, sel, ss}
%
where {\it sel} is a returned logical array the same length as roadmap, and is set 
true for all dsets selected, and {\it ss} is the returned subscripts of the selected
datasets.  A few examples on how to use the {\it sel} variable are:
%
\idlinputa{ss = where(sel)}	
\idlinputc{ss = where(sel and (gt\_dp\_mode(roadmap) eq 9))} 
%
\subsubsection{SHOW\_OBS4  }

The calling sequence of SHOW\_OBS4 is the same as SHOW\_OBS3, except there
are a few additional options in SHOW\_OBS4.  Run SHOW\_OBS4 with one of
the following commands:
%
\idlinputa{show\_obs4, roadmap}	\index{SHOW\_OBS4}
\idlinputb{show\_obs4, index}
%
It is possible to click on a time range for a closer look by:
\EEnumerate
\item Clicking with the left button at the start time
\item Clicking with the right button at the end time
\item Clicking with the left button on the box in the lower right
\item If you wish to exit, click with the middle button somewhere on the plot
\end{enumerate}

It is possible to select several regions using the following steps.
\EEnumerate
\item Click with the right button on the box in the lower left (Select Option).
      A square box should appear on the screen.
\item Click and hold the left button on the lower left corner of the box and
     drag the box to the lower left corner of the region you want to select, 
     then release.
\item Click and hold the middle button on the upper right corner of the box
    and stretch the box to encompass the images you want to select.
\item Repeat steps 2 and 3 until you have positioned the box where you
      want it.
\item Click on the right button to exit the selection option when you have 
     successfully positioned the box.
\item Now you can exit SHOW\_OBS4 by clicking on the middle button, or you can
     select another set of images by running steps 1 through 5 again.
\end{enumerate}

\subsubsection{PLOT\_FOV}

It is possible to make a simple display of the sun and to overlay the
box showing the field of view size and location by using PLOT\_FOV.
The index, roadmap or observing log entry can be used with this
routine.  A sample call is:
%
\idlinputd{plot\_fov, index, /box}\index{PLOT\_FOV}
%
\subsection{Routines for Making Time Plots}

\subsubsection{LCUR\_IMAGE}

See the description in the ``General Yohkoh Software'' chapter on
page~\pageref{lcur_image} or the description in the User's Guide.

\subsection{Routines for Image Display and Enhancement}

\subsubsection{STEPPER}

See the description in the ``General Yohkoh Software'' chapter on
page~\pageref{stepper} or the description in the User's Guide.


\subsubsection{XY\_RASTER}

XY\_RASTER makes a mosaic of several images and prints the times in the corner 
of each image.  Sample calls are:
%
\idlinputa{xy\_raster, index, data}\index{XY\_RASTER}
\idlinputb{xy\_raster, index, data, factor}
%
where {\it factor} is the rebin factor (a value of 1 will perform no
rebinning).  If there are too many images, the program will display 
the number of images which will fit on a page, and will prompt the
user for when to move to the next page.  The keyword {\it /notimes} will
inhibit the time labels, {\it /noscale} will inhibit image scaling (it will
use TV instead of TV\_SCL), {\it /individual\_scale} will scale each image
individually.

\subsubsection{DISP\_MONTH}

The routine DISP\_MONTH will display a month of SXT images in a 
calendar form (assuming you have the SFM database on-line).  A sample
call is:
%
\idlinputd{disp\_month, 'oct-93'}\index{DISP\_MONTH}

\subsubsection{UNSHARP\_MASK}
\index{image enhancement}

UNSHARP\_MASK is a basic image enhancement routine which uses the unsharp mask method.  The calling sequence is:
%
\idlinputa{dataout=unsharp\_mask(index, data)} \index{UNSHARP\_MASK}
%
where {\it data} and {\it dataout} are 2D arrays, and {\it index} is the index
entry that corresponds to {\it data}.  If no keywords are given the
defaults are used.  \index{ENHANCER}

Optional Keyword Parameters:

\vspace{0.2in}\begin{tabular}{lp{15.0cm}}
{\tt smooth  } & {\raggedright Size of smoothing box, integer.}\\
{\tt lowdelt}  & {\raggedright Lower $\delta$ cutoff, a percentage of minimum, decimal 0.xx.}\\
{\tt updelt  } & {\raggedright Upper $\delta$ cutoff, a percentage of maximum, decimal 0.xx.}\\
{\tt lowint }  & {\raggedright Saturation cutoff, don't add back when signal is BELOW\\
a given percentage of the saturation value, decimal 0.xx.}\\
{\tt upint }   & {\raggedright Saturation cutoff, don't add back when signal is ABOVE\\
a given percentage of the saturation value, decimal 0.xx.}\\
{\tt deltcoef} & {\raggedright Multiplier for $\delta$ field,  float x.x.}
\end{tabular}\vspace{0.2in}

The keyword parameters allow you to customize the enhancer, though they
are all assigned default values if omitted in the call.  These
defaults depend on the images resolution, and may be changed as we gain 
experience.

\subsubsection{DE\_SPIKER}

The DE\_SPIKER function returns a cleaned image by removing spikes at a
specified input level.  The technique used is to difference a smoothed image
and the input image and find all pixels that deviate 
by more than a given threshold.
%
\idlinputa{clean\_img = de\_spiker(image, thresh)}\index{DE\_SPIKER}\index{spikes, SXT}\index{image spikes, SXT}
\idlinputb{clean\_img = de\_spiker(image, thresh, /neg)}
\idlinputb{clean\_img = de\_spiker(image, thresh, indices=indices)}
%
where, {\it image} is the input data array, {\it thresh} is the specified spike amplitude to
remove.  Optional input/output parameter {\it indices} contains the indices of
spikes at the level specified, and optional input switch {\it /neg} requests that
``dark holes'' be removed.

\subsubsection{SXT\_GRID  }

Draws heliocentric grid over an image.  It reads the ATT file to get
information on the spacecraft pointing, and also calls GET\_RB0P to get
the solar radius.  A sample call could be:
%
\idlinputa{tvscl, data(*,*,0)}	\index{SXT\_GRID}
\idlinputb{sxt\_grid, index(0)} 
%
The keyword option {\it /read} will allow the user to move the
cursor around the image and to display the heliocentric coordinates.
If {\it /angle} is used with {\it /read}, then the value displayed
is the angle relative to the sun center, which is useful to be used
with SXT\_PREP.

\subsection{Routines for Data and Information Extraction}
%
\subsubsection{GET\_INFO}

See the description in the ``General Yohkoh Software'' chapter on
page~\pageref{get_info}


\subsubsection{EXT\_SUBSET [*] }
EXT\_SUBSET extracts a subset (in x and y) of a data cube
and creates a new data and index array ({\it data\_out} and
{\it index\_out}) by typing:
%
\idlinputa{ext\_subset,index\_in,data\_in,index\_out,data\_out} \index{EXT\_SUBSET}
%
It is a mouse driven program.

\subsubsection{GT\_FILTA}
GT\_FILTA uses an index or roadmap structure  to determine the setting of the A filter:
%
\idlinputa{a = gt\_filta(index)} \index{GT\_FILTA}
%
The filter setting will be returned as an integer (1-6) where

\vspace{0.2in}\begin{tabular}{|l|l|l|l|} \hline
        1 &  Open 			& Op  	& Op \\
        2 &  Optical - narrow band 	& NaBan	& NB \\
        3 &  Quartz defocusing lens 	& Quart	& Qz \\
        4 &  Diffuser 			& Diffu	& Df \\
        5 &  Optical - Wide band 	& WdBan	& WB \\
        6 &  8\% neutral density X-ray filter & NuDen & ND \\ \hline
\end{tabular}\vspace{0.2in}

\noindent The last two columns show what GT\_FILTA returns when using the {\it /string} and {\it /short}
options.  The routine GET\_INFO uses the {\it /string} option.
It is possible to get a string type description of the filters used by
typing:
%
\idlinputa{b = gt\_filta(roadmap, /string)} \index{GT\_FILTB}
%
You can get a listing of these at any time by typing the following:
%
\idlinputd{print,gt\_filta()} 
%
\subsubsection{GT\_FILTB}

GT\_FILTB works exactly like GT\_FILTA but works for the X-ray filters

\vspace{0.2in}\begin{tabular}{|l|l|l|l|} \hline
        1 & Open 			 & Open		& Op \\
        2 & Thin Aluminum (1265 \AA) 	 & Al.1		& A1 \\
        3 & Dagwood Sandwich 		 & AlMg		& AM \\
        4 & Beryllium (119 $\mu$m)	 & Be119	& Be \\
        5 & Thick Aluminum (11.5 $\mu$m) & Al12		& A2 \\
        6 & Magnesium (2.5 $\mu$m)	 & Mg3		& Mg \\ \hline
\end{tabular}\vspace{0.2in}

\noindent The last two columns show what GT\_FILTB returns when using the {\it /string} and {\it /short}
options.  The routine GET\_INFO uses the {\it /string} option.

\subsubsection{GT\_PFI\_FFI}
\index{GT\_PFI\_FFI}
GT\_PFR\_FFI extracts the information on whether the image is a partial frame image (PFI)
or a full frame image (FFI).  Even values are PFI, odd values are FFI 
in general.

\vspace{0.2in}\begin{tabular}{|l|l|} \hline
	0 & {PFI} \\
        1 & {FFI} \\
        2 & {PFI Observing Region} \\
	3 & {FFI Patrol Image} \\ \hline
\end{tabular}\vspace{0.2in}

\noindent The {\it /ffi} keyword option can be used, and it will 
return a 1 if the image is an FFI and return
a 0 if it is a PFI (PFI strip or observing region).
The {\it /true\_ffi} keyword option will
return a 1 if the image is an FFI and return
a 0 if it is a PFI (PFI strip or observing region).
The {\it /true\_ffi} option will also check if it is an FFI strip
or if it is a PFI which was extracted from an FFI.

\subsubsection{GT\_RES}
GT\_RES extracts what resolution each SXT image was taken at by typing:
%
\idlinputa{res = gt\_res(roadmap)} \index{GT\_RES}
%
It outputs the resolution as a integer where:

\vspace{0.2in}\begin{tabular}{|l|l|} \hline
        0 & { full resolution } \\
        1 & { half resolution } \\
        2 & { quarter resolution } \\ \hline
\end{tabular}\vspace{0.2in}

\noindent It is possible to get a string type description of the resolution by
typing:
%
\idlinputd{res = gt\_res(roadmap, /string)} 
%
\subsubsection{GT\_COMP}
GT\_COMP extracts what compression was used for each SXT image was taken at by typing:
%
\idlinputa{comp = gt\_comp(roadmap)} \index{GT\_COMP}
%
It outputs the compression as a integer where:

\vspace{0.2in}\begin{tabular}{|l|l|} \hline
        0 & { Compressed (see routine SXT\_DECOMP) } \\
        1 & { Low 8 bits (of 12 bits) } \\
        2 & { High 8 bits (of 12 bits) } \\ \hline
\end{tabular}

\subsubsection{GT\_DPE}
\index{exposure levels, SXT}
\index{SXT exposure levels}
\index{DP exposure (DPE) level}

GT\_DPE extracts what DP exposure (DPE) level was used.  The DPE is a function
of the shutter exposure level (MBE) and the neutral density filter use.
It is possible to return the effective exposure duration in milliseconds by using the {\it /conv}
switch).
%
\idlinputa{dpe = gt\_dpe(index)}	\index{GT\_DPE}
\idlinputb{msec = gt\_dpe(roadmap, /conv)} 
%
The effective exposure for each of the DPE values are shown in the following
table.  For DPE values above 22, the effective exposure is

\begin{verbatim}
                exposure = (DPE-21) * 0.25 seconds
\end{verbatim}

% MK_DPE_LIST.TEX input starts here ---------------------------------------
\begin{tabular}{|r|r|r|r||r|r|r|r|} \hline
DPE & {\raggedright Effective} & MBE & Mask & DPE & {\raggedright Effective} & MBE & Mask \\
     & {\raggedright Exposure} &     &      &     & {\raggedright Exposure} &     &       \\ \hline
  0 &    0.08 msec &   0 & with ND &  19 &  668.00 msec &  12 &  \phantom{with} \\
  1 &    0.23 \phantom{msec} &   1 & with ND &  20 &  948.00 \phantom{msec} &  13 &  \phantom{with} \\
  2 &    0.96 \phantom{msec} &   0 &  \phantom{with} &  21 &    1.338 sec \phantom{m} &  14 &  \phantom{with} \\
  3 &    1.37 \phantom{msec} &   2 & with ND &  22 &    1.888 \phantom{msec} &  15 &  \phantom{with} \\
  4 &    2.88 \phantom{msec} &   1 &  \phantom{with} &  23 &    2.668 \phantom{msec} &  16 &  \phantom{with} \\
  5 &    3.06 \phantom{msec} &   4 & with ND &  24 &    3.778 \phantom{msec} &  17 &  \phantom{with} \\
  6 &    4.67 \phantom{msec} &   5 & with ND &  25 &    5.338 \phantom{msec} &  18 &  \phantom{with} \\
  7 &    6.28 \phantom{msec} &   6 & with ND &  26 &    7.548 \phantom{msec} &  19 &  \phantom{with} \\
  8 &    9.50 \phantom{msec} &   7 & with ND &  27 &   10.678 \phantom{msec} &  20 &  \phantom{with} \\
  9 &   17.00 \phantom{msec} &   2 &  \phantom{with} &  28 &   15.108 \phantom{msec} &  21 &  \phantom{with} \\
 10 &   28.00 \phantom{msec} &   3 &  \phantom{with} &  29 &   21.358 \phantom{msec} &  22 &  \phantom{with} \\
 11 &   38.00 \phantom{msec} &   4 &  \phantom{with} &  30 &   30.208 \phantom{msec} &  23 &  \phantom{with} \\
 12 &   58.00 \phantom{msec} &   5 &  \phantom{with} &  31 &   42.718 \phantom{msec} &  24 &  \phantom{with} \\
 13 &   78.00 \phantom{msec} &   6 &  \phantom{with} &  32 &   60.418 \phantom{msec} &  25 &  \phantom{with} \\
 14 &  118.00 \phantom{msec} &   7 &  \phantom{with} &  33 &   85.438 \phantom{msec} &  26 &  \phantom{with} \\
 15 &  168.00 \phantom{msec} &   8 &  \phantom{with} &  34 &  120.828 \phantom{msec} &  27 &  \phantom{with} \\
 16 &  238.00 \phantom{msec} &   9 &  \phantom{with} &  35 &  170.878 \phantom{msec} &  28 &  \phantom{with} \\
 17 &  338.00 \phantom{msec} &  10 &  \phantom{with} &  36 &  241.668 \phantom{msec} &  29 &  \phantom{with} \\
 18 &  468.00 \phantom{msec} &  11 &  \phantom{with} & & & & \\ \hline
\end{tabular}
% MK_DPE_LIST.TEX input ends here ---------------------------------------

\subsubsection{GT\_MBE}
\index{mail box exposure (MBE) level}
GT\_MBE extracts what mail box exposure (MBE) level was used.  This is the
actual shutter exposure level commanded.  It is possible to convert
to commanded shutter duration in milliseconds by using the {\it /conv}
switch).
%
\idlinputa{mbe = gt\_mbe(index)}	\index{GT\_MBE}
\idlinputc{shutdur = gt\_mbe(roadmap, /conv)} 
%
\subsubsection{GT\_EXPDUR}
GT\_EXPDUR will calculate the effective exposure duration
(not the commanded DPE)  of a series of images given an
index structure to work with.  You can get  an array of
exposures (exps) in msec by typing one of the following.  In
the second example, it returns the shutter duration (which is
also the CCD integration period).  For dark images the value
returned is the number of milliseconds the CCD integrated for
which is in multiples of 8 msec (8 msec is the minimum for
dark current images).
%
\idlinputa{expos = gt\_expdur(index)}	\index{GT\_EXPDUR}
\idlinputc{expos = gt\_expdur(index, /shut\_dur)} 
%
\subsubsection{GT\_EXPLAT}

GT\_EXPLAT will calculate the latency time between the 
time which is stored in the index and the actual time the
integration started.  The value returned is in milliseconds
and is typically between 50 and 100.
%
\idlinputd{explat = gt\_explat(index)}	\index{GT\_EXPLAT}
%
\subsubsection{GT\_EXPMODE}
GT\_EXPMODE routine returns the exposure mode.  The values it can return are:

\vspace{0.2in}\begin{tabular}{|l|l|} \hline
        0 & { Normal shuttered exposure } \\
        1 & { Dark image (shutter stays closed) } \\
        2 & { Calibration image (shutter open during readout) } \\ \hline
\end{tabular}\vspace{0.2in}
~\\
%
\idlinputd{expmode = gt\_expmode(index)}\index{GT\_EXPMODE} 
%
\subsubsection{GT\_CORNER}

GT\_CORNER will return the full resolution IDL (FRE) coordinates of
the center of the pixel in the lower left hand corner.
%
\idlinputa{corners = gt\_corner(roadmap)}\index{GT\_CORNER}
\idlinputc{x0 = gt\_corner(index, /x)}

\subsubsection{GT\_CENTER}

The output from GT\_CENTER can be the location of the center of
the field of view in (a) full resolution IDL (FRE) pixels, (b) heliocentric
coordinates, (c) the angle E/W and N/S from the center of the sun 
in arcseconds, or (d) the HXT equivalent pixel coordinates.  
The default is to read the ATT S/C pointing database for
the true de-jittered S/C pointing.  It is possible to use the commanded
S/C pointing information by using the /CMD option, which is much faster
and only of slightly reduced accuracy.
%
\idlinputa{pix = gt\_center(index)}	\index{GT\_CENTER}
\idlinputb{helio = gt\_center(index, /helio)}	
\idlinputb{helio = gt\_center(index, /helio, /cmd)}	
\idlinputb{ang = gt\_center(roadmap)}
%
where {\it ang(0,*)} is arcseconds east/west with east being 
negative and {\it ang(1,*)} is arcseconds north/south with
north being positive.  {\it helio} is in degrees, and {\it pix} is
in full resolution pixels.  It is possible to get the heliocentric
coordinates in a string of the form ``N12W23'' by using the /STRING
option.

\subsubsection{GT\_SXT\_AXIS}
\index{optical axis, SXT}
\index{X-ray axis, SXT}

The optical axis of the X-ray telescope has been determined from
pre-launch measurements of the effective area as a function of off-axis
angle.  The analysis is described more fully in SXT Calibration Note 36
(R.  Fuller, Jan-94).  The relative offset between the X-ray optical
axis and the optical axis in the Wide band or Narrow band filters was
determined by Tom Metcalf (22-Oct-92).  The combined results are
summarized below:

\begin{verbatim}
                      Optical Axis (CCD Full-Res Pixels)
                             x             y

      X-ray                 515           633
      Narrow Band (NaBan)   514.64        634.47
      Wide Band   (WdBan)   515.24        634.26
\end{verbatim}

The values can be quickly acquired on line using GT\_SXT\_AXIS{}.  The next
three lines will reproduce the values in the table above. Note that the
routine also accepts an index or roadmap data structure and that the filter
will be determined from the SXT structure.
%
\idlinputA{3}{print,gt\_sxt\_axis(0)	 	}{; 0=X-ray}\index{GT\_SXT\_AXIS}
\idlinputB{3}{print,gt\_sxt\_axis(1)	}{; 1=NaBan}
\idlinputB{3}{print,gt\_sxt\_axis(2)	}{; 2=WdBan}
\idlinputB{3}{print,gt\_sxt\_axis(1,/rel)  }{; NaBan relative to X-ray}
%
The sign convention can be understood if you remember that the NaBan image is
Northeast of the X-ray image.
\medskip

The X-ray optical axis has a somewhat large uncertainty, since the effective
area function is broad near the center of the field of view of the telescope.
The relative precision between the optical and X-ray axes has been determined
to better than 0.4 Full-Res pixels (see the Instrument Guide).

The {\it /rel\_xray} keyword option can be used to return the relative offset
to the X-ray axis.

\subsubsection{GT\_PIX\_SIZE}
\index{pixel size, SXT}

The angular size of the SXT full-resolution pixel was determined from
pre-launch focal length measurements to be 2.45280 arc sec for the X-ray
telescope.  Half- and quarter-resolution images are twice and four times
this value, respectively.  A routine to provide this number is
GT\_PIX\_SIZE which is called as:
%
\idlinputa{print,gt\_pix\_size()}
\idlinputb{print,gt\_pix\_size(index)	}\index{GT\_PIX\_SIZE}
%
If the SXT index or roadmap is passed in, the routine will return the
appropriate pixel size in arc sec for the resolution of the data.  The
pixel size of the optical images is thought to be within 1\%\ of the
X-ray pixel size. 

\subsubsection{GT\_TEMP\_CCD}
\index{CCD temperature}
\index{temperature, CCD}

GT\_TEMP\_CCD returns the temperature of the CCD in degrees Celsius.
%
\idlinputd{temp = gt\_temp\_ccd(index)}\index{GT\_TEMP\_CCD} 
%
\subsubsection{GT\_TEMP\_HK  }
\index{temperature, housekeeping, SXT}

GT\_TEMP\_HK returns the temperature measured by the platinum resistance
thermometer (PRT) on the spacecraft and SXT instrument.  There are
16 temperatures saved in the SXT index.
%
\idlinputd{temp = gt\_temp\_hk(index, 0, title=title)}\index{GT\_TEMP\_HK} 
%
\subsubsection{SXTPNT\_SUM}

The routine SXTPNT\_SUM will read the observing log and give a summary of the
unique PFI pointing for a given time period.  It groups the summary listing based on
each unique pointing location over time.   See the User's Guide for a sample listing.
For the command:
%
\idlinputa{sxtpnt\_sum, '5-oct-93 13:00', '6-oct-93 1:00'}\index{SXTPNT\_SUM}
%
it 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).

\subsubsection{PR\_SXTOBS}

The routine PR\_SXTOBS will read the observing log and list each and 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.  See the User's Guide
for a sample listing.  The keyword {\it /long} changes the formatting and information
displayed.
%
\idlinputa{pr\_sxtobs,'15-nov-91 22:00','15-nov-91 22:05'}\index{PR\_SXTOBS}
\idlinputc{pr\_sxtobs,'15-nov-91 22:00','15-nov-91 22:05',/long}
%

\subsubsection{PFI\_LOC}
\index{PFI pointing coordinates}
\index{pointing coordinates, SXT-PFI}

PFI\_LOC will display the SXT PFI location.  There are two modes which
can be used when calling PFI\_LOC.  If the first parameter is a 
date and time string, it will read the observing log and make a simple plot showing the
location relative to the sun's limbs.  If the first parameter is an
SXT index, then it assumes that you have displayed this full frame image,
and it reads the observing log and puts a box on the image where the
PFI is located.  Some sample calls are:
%
\idlinputa{pfi\_loc, '23-jun-93 1:00'}\index{PFI\_LOC}
\idlinputb{pfi\_loc, timstr, hours=2}\index{PFI\_LOC}
\idlinputb{pfi\_loc, index}
\idlinputb{pfi\_loc, index, pfi\_struct=sxtp}
\idlinputb{pfi\_loc, index, '6-nov-93 3:30'}
\idlinputb{pfi\_loc, index, '6-nov-93 3:30', /hour}
%
It is possible to use the {\it hours} keyword option to specify the
number of hours plus and minus the full frame time for which you wish to
have PFI locations displayed.  The {\it pfi\_struct} option exists so
that you can pass a PFI roadmap or index structure directly to the
PFI\_LOC to be displayed over the image.  If a second positional parameter
is passed, the routine will get the PFI locations for that time and
overlay them on the image.

When using STEPPER, the ``o'' option will call PFI\_LOC automatically
for you, taking into account any rebinning which has been performed on the
image. 

\subsection{Routines for Calibration and Analysis}

\subsubsection{SXT\_PREP}\label{sxt_prep}
\index{alignment, SXT images}

SXT\_PREP can perform a wide variety of the standard processing required to
use SXT data.  The User's Guide has a description of the capabilities and some
of the fundamentals, and it should be read before reading this section.

The input specifying which images to process can be either an {\it index} and
{\it data}, or it can be the filenames {\it infil} and dataset numbers {\it dset\_arr}.
Some sample calling sequences are:
%
\idlinputa{sxt\_prep, input1, input2, index\_out, data\_out}\index{SXT\_PREP}
\idlinputb{sxt\_prep, index, data, index\_out, data\_out}
\idlinputb{sxt\_prep, infil, dset\_arr, index\_out, data\_out, \$}
\idlinputbb{              helio=[-9.8,-20.3], date\_helio='14-JUN-92  02:37:41'}
\idlinputb{sxt\_prep, index, data, index\_out, data\_out, /helio, ref\_image=10}
\idlinputb{sxt\_prep, index, data, index\_out, data\_out, ref\_image=spr\_index(0)}
\idlinputb{sxt\_prep, index, data, index\_out, data\_out, /roll}

A description of some of the keywords follows:

\vspace{0.2in}\begin{tabular}{lp{12.0cm}}
{ }		& {\raggedright -------------------- Calibration Parameters --------------------} \\
nocorrections	& {\raggedright If set, then LEAK\_SUB, and therefore DARK\_SUB, are not called.} \\
dc\_scalar	& {\raggedright If set, then a simple scalar value is used for dark current 
		subtraction. Default is to take the image closest in exposure.}\\
dc\_interpolate	& {\raggedright If set, then perform interpolation on the dark frame
		images to get a better background subtraction.  Default is to
		take the image closest in exposure.}\\
upper\_only	& {\raggedright If set, only flag +1 pixels above (in a column) the
		saturated area (not the $-1$ pixels) [see call to SXT\_SATPIX].}\\
sfd\_corr	& {\raggedright If set, then the input image is an SFD image.  Use the
		SFD decompression, perform the registration, and recompress
		using the SFD compression.}\\
\end{tabular}

\vspace{0.2in}\begin{tabular}{lp{12.0cm}}
{ }		& {\raggedright -------------------- Alignment Parameters --------------------}\\
register	& {\raggedright If set, then perform the registration and correct only for
		the S/C jitter.  Using the HELIO or SUNCOORD options selects this option also.}\\
ref\_image	& {\raggedright A single roadmap or index structure which will be used 
		to define the sun or heliocentric coordinates for alignment.  
		It can be the image number (subscript) of the images being
		extracted which should be used (not the absolute dataset 
		number within the images listed in "infil") }\\
helio		& {\raggedright the reference latitude and longitude for the alignment.
		This should be the position of the active region at some 
		time, preferably near the time it crossed closest to the 
		center of the disk.  \\
			helio(0) = longitude E/W (E is negative) \\
			helio(1) = latitude N/S (S is negative) \\
		It can be a non-zero scalar value if REF\_IMAGE is passed in.
		In this case, the heliocentric coordinates are derived
		from REF\_IMAGE.}\\
\end{tabular}

\vspace{0.2in}\begin{tabular}{lp{12.0cm}}
date\_helio	& {\raggedright the reference date/time for the heliocentric input.} \\
suncoord	& {\raggedright The coordinates of the center of the portion to extract
		   in angular arcseconds relative to sun center. \\
			suncoord(0) = E--W coordinate (E is negative) \\
			suncoord(1) = N--S coordinate (S is negative) }\\
ccdcoord	& {\raggedright The FRE (full resolution CCD pixel equivalent) of the
		center of the portion to extract.}\\
outres		& {\raggedright The resolution of the output image (0=FR, 1=HR, 2=QR).
		If not set, then convert all to full res.  Only relevant if
		registering the images.}\\
outsize		& {\raggedright The dimension of the output image [\#col, \#lin].
		If it is a scalar value, it will make the \#lin = \#col.
		If not set, it will make it the largest size of the input
		field of views.  If PFI and FFI are mixed, it will take
		the largest PFI.}\\
\end{tabular}

\vspace{0.2in}\begin{tabular}{lp{12.0cm}}
fill\_gap	& {\raggedright A gap can exist between two PFI strips for a single
		   observing region because of a change in S/C pointing.
		   If this variable is set, then the gap between the PFI
		   strips is filled by interpolating the lines above and below.}\\
roll\_do		& {\raggedright If set, then perform the corrections for the roll offset.}\\
normalize	& {\raggedright If set, perform exposure normalization.}\\
\end{tabular}

\vspace{0.2in}\begin{tabular}{lp{12.0cm}}
{ }		& {\raggedright -------------------- Miscellaneous Parameters ----------} \\
force\_read	& {\raggedright If set, read all datasets at once even if input was 
		  specified with INFIL/DSET.  This is available because doing 
		  LEAK\_SUB on all images at once if the input is PFI is more 
		  efficient.}\\
outfil		& {\raggedright If specified, the data will not be passed back in INDEX\_OUT and
		  DATA\_OUT.  Instead, it will be saved in an SDA file with the
		  name specified by this parameter. 
		  If ``uncert" and ``satpix" are included in the procedure call,
		  they will be saved with the same file name with a ``\_unc"
		  and a ``\_sat" appended to the file name.}\\
\end{tabular}\vspace{0.2in}

SXT\_PREP always stores the actual pixel address of the portion extracted and used.
The .HIS.SUN\_CENTER value stored in the index is always the actual pixel address
where the sun center fell on the CCD for that time.  When a registration is performed,
the CORNER\_SAV value will not be set to the same value, even though it is a registered
cube.  This is because the registration is RELATIVE TO SUN CENTER, and that is changing.
Plotting the corner minus the sun center WILL result in a flat plot with all values
identical.

\subsubsection{XSXT\_PREP}

XSXT\_PREP was under development as this volume was being written.  See
the User's Guide for a overview of the capabilities of XSXT\_PREP. \index{XSXT\_PREP}

\subsubsection{SXT\_DECOMP}
\index{data decompression, SXT}

The SXT data are normally compressed from a 12-bit word to an 8-bit word
via a pseudo-square-root compression algorithm.  SXT\_DECOMP takes the
compressed data array ({\it data}) and creates an integer array ({\it ndat}) of the
decompressed numbers by typing:
%
\idlinputd{ndat = sxt\_decomp(data)} \index{SXT\_DECOMP}
%

\subsubsection{SXT\_COMP}
\index{data compression, SXT}

It is possible to re-compress the data. The
routine SXT\_COMP will compress integer data which is in the range
between 0 and 4095 into byte data using the SXT compression 
algorithm.
%
\idlinputd{bdat = sxt\_comp(data)} \index{SXT\_COMP}
%
\subsubsection{RESTORE\_LOW8}
\index{low-8 bit SXT data}

RESTORE\_LOW8 will combine a compressed image with a low 8-bit image to restore
the full 12 bits of resolution.  The images need to be taken relatively
close in time (less than hours apart), and it must be for the same
PFI location.  A sample call is
%
\idlinputa{out = restore\_low8(low8, comp)}\index{RESTORE\_LOW8}
%
where {\it low8} is the SXT image taken with the low 8 bits, and
{\it comp} is the comparable compressed image (ideally, acquired
at nearly the same time).

\subsubsection{SFD\_COMP}\index{SFD images}

The SFD (SXT Full-frame Desaturated) images use a logarithmic compression
in order to save the data as byte type.  SXT\_COMP compresses the
data into byte type.  The compression algorithm
assumes that the data input is in DN/sec/HR pixel and the values
range between 0 and $10^6$.
%
\idlinputd{data\_out = sfd\_comp(data\_in)} \index{SFD\_COMP} 
%
\subsubsection{SFD\_DECOMP}\index{SFD images}

The SFD (SXT Full-frame Desaturated) images use a logarithmic compression
in order to save the data as byte type.  The decompression algorithm
is data\_out = $10.^{(data\_in/255.*6)}$.  The routine SFD\_DECOMP will
do this decompression for you.  Beware: the output are floating type numbers 
and therefore, require four times as much memory.
%
\idlinputd{data\_out = sfd\_decomp(data\_in)} \index{SFD\_DECOMP} 
%
\subsubsection{EXP\_NORM} 

EXP\_NORM 
\footnote{If this code is used as a template, we recommend
that the calling sequence be {\it index,data} for all routines}
takes a data array and produces an exposure and summation mode
normalized floating point array.  Note the floating array takes four times
more room so don't use too big an array to start with.  You need to give
it an index array -- make sure that the two correspond exactly or else
the results will be meaningless.  To run it, type:
%
\idlinputa{ndat = exp\_norm(data,index)} \index{EXP\_NORM}
\idlinputb{ndat = exp\_norm(data,index,0)}
%
To do this it follows the following steps:
\IItem
\item decompresses the data array
\item subtracts background
\item divides by the exposure time
\item divides by the number of pixels binned
\end{itemize}

\subsubsection{SXT\_COMPOSITE}
\index{desaturated SXT images (SFD)}
\index{composite SXT images}

SXT\_COMPOSITE combines two or three SXT images with different exposures into
a ``composite'' image.  The longest exposure is used as the basis for the
final exposure.  SXT\_COMPOSITE uses the results of SXT\_SATPIX to
identify the locations of saturated pixels and replaces them with
equivalent pixels from the shorter exposure images, scaled for the long
exposure image.  This routine uses the algorithm that is used to produce
the ``sfd'' images in the standard SXT movie.  Example calls are:
%
\idlinputa{cimg = sxt\_composite(index,data)}\index{SXT\_COMPOSITE}
\idlinputb{cimg = sxt\_composite(index,data,satpix=satpix)}
\idlinputb{cimg = sxt\_composite(index,data,dc\_data,sx=[1,2,3],sd=[0,2,1])}
%
By default, SXT\_COMPOSITE will do dark and leak frame subtraction if
{\it data} is byte-type.  The user may optionally specify the dark-frame images
in {\it dc\_data} and will default to $data-dc\_data$ unless the explicit
X-ray and Dark-frame indices are given in $sx$ and $sd$, respectively.

Note that the replaced pixels are box-car smoothed with a smoothing
window of 5 pixels.
 
\subsubsection{MK\_SFD}\index{SFD images}

MK\_SFD creates a desaturated set of images
from a series of long and short exposures by typing:
%
\idlinputa{mk\_sfd,infil,outfil,filpref} \index{MK\_SFD}
%
where $infil$ is a string array of one or more SFR filenames (and
locations), $outfil$ is the string array containing the name of directory
where you want the file to be created, and $filpref$ is a string array
which contains the three letter file prefix name (usually SFD).  The
desaturated image is compressed such that:

\begin{verbatim}
                      0 =         1 dn/sec/5 arcsec pixel
                    255 = 1,000,000 dn/sec/5 arcsec pixel
\end{verbatim}
Use the routine SFD\_DECOMP to restore the data from compressed bytes
to real numbers.

\subsubsection{DARK\_SUB}
\index{dark frame subtraction, SXT}
\index{background, SXT}

It is possible to have the dark current removed from PFI and FFI images
by using the following command:
%
\idlinputa{data\_out = dark\_sub(index,data)} \index{DARK\_SUB} 
%
The routine can interpolate between two reference images to simulate the
input exposure duration by using the {\it /interpolate} option.  It will call
the routine GET\_DC\_IMAGE to get the proper image and take the
subsection for the PFI cases.  The SDC data files for the time period
being calibrated must be in the directory \$DIR\_SXT\_SDC. 

The {\it /interpolate} option can be turned on and run automatically
every time DARK\_SUB is run by setting the environment variable
{\tt ys\_dark\_interp}.  An example of how to turn this on and off
is:
%
\ultrixinputA{3}{setenv ys\_dark\_interp 1}{\# will enable automatic interplation}
\ultrixinputB{3}{unsetenv ys\_dark\_interp }{\# will disable automatic interplation}
%
LEAK\_SUB calls DARK\_SUB if the input data is BYTE type, so normally a user does not need to call DARK\_SUB
directly.

\subsubsection{GET\_DC\_IMAGE}

These routines get an appropriate dark frame ({\it dcdata}) and its
index ({\it dcindex}) to match the images you are working with. 
The routines find the full-frame dark image that is closest in
time and exposure level.  The routine can interpolate between two
reference images to simulate the input exposure duration by using the
/INTERPOLATE option.  It can be called with the index for a single image
by typing:
%
\idlinputa{get\_dc\_image, index(3), dcindex, dcdata} \index{GET\_DC\_IMAGE}
%
where {\it index(3)} is the index of the image you are working with, or you can
pass a list array of indicies by typing:
%
\idlinputa{get\_dc\_image, index, dcindex, dcdata, imap}
%
For this case, {\it imap} is the same length as {\it index} and tells you which
image to use in {\it dcdata} for the corresponding index.  For example,
if {\it index} is 10 elements long, and {\it imap(8)=3}, then you should use
{\it dcdata(*,*,3)} for the image that goes with {\it index(8)}.

It is possible to extract the dark frames manually using a command
similar to the following example:
%
\idlinputa{get\_dc\_image, xxx,dc\_index, dc\_data, times='1-sep-92 1:00', res=0, dpe=15}
%
The SDC data files for the time period being calibrated must be in the
directory \$DIR\_SXT\_SDC (and the SDW data files must be in
\$DIR\_SXT\_SDW when calibrating images which were taken when the TEC is
off). 

\subsubsection{LEAK\_SUB}
\index{leak frame subtraction, SXT}
\index{straylight, SXT}
\index{background, SXT}

On 13-Nov-92, there was an entrance filter failure which caused visible
light to contaminate the X-ray images.
It is possible to have the leak image removed from PFI and FFI images
by using the following command:
%
\idlinputa{data\_out = leak\_sub(index,data)} \index{LEAK\_SUB} 
%
The routine will call DARK\_SUB if it comes in as byte type.  The
technique at the time of writing this guide was to find the sunset
leak image which matched the following criteria
\IItem
\item The same X-ray analysis filter.
\item Using the ND filter if the input X-ray image used the ND filter.
\item The nominal S/C pointing must be the same (there is one set of
	images between 13-Nov-92 and 19-Aug-93, and another set for
	images taken after 19-Aug-93)
\end{itemize}

The small changes in S/C pointing were not being accounted for as of
Jan-94, even though there is a relatively strong dependence on
pointing drift.  Future modifications to LEAK\_SUB might take this 
factor into account.

The leak image files must be in the directory \$DIR\_SXT\_SFC.

\subsubsection{INTERP\_IMG}

To linearly interpolate two images to a specified time type:
%
\idlinputa{interp\_img, index1, img1, index2, data2, time, index\_out, img\_out}	\index{INTERP\_IMG}
\idlinputb{interp\_img, idx(10),img(*,*,10),idx(12),img(*,*,12), time, nidx, nimg}
%
where the two input images to be interpolated are specified by the paired
variables {\it index} and {\it img}.  The input
interpolation variable {\it time} can be in any Yohkoh standard time format.
The returned parameters {\it index\_out} and {\it img\_out}
refer to the interpolated {\it index} information and the interpolated image
{\it data} respectively.

\subsubsection{SXT\_FSP and SXTBOX\_FSP [*]} \index{spectral fitting}

SXT\_FSP is the same as HXS\_FSP, but for SXT spectra, you now have the option to fit 
temperatures and emission measures using more than two filters.
%
\idlinputa{SXT\_FSP, index, data, fit\_pars} \index{SXT\_FSP}
%
SXTBOX\_FSP fits spectra to a given box, chosen by LCUR\_IMAGE, for a set of 
SXT images. 
%
\idlinputa{SXTBOX\_FSP, index, data, fit\_pars [, sc\_par, ch\_dta, sdel=sdel, \$}
\idlinputcc{		outfile=outfile, pfile=pfile, same\_bx=same\_bx, boxq=boxq]}

\subsubsection{SXTHXT\_FSP and SXTHXTBOX\_FSP [*]} \index{spectral fitting}

See the description under in the HXT chapter.

\subsubsection{SXT\_TEEM}
\index{temperatures, SXT}
\index{determining temperatures, SXT}

SXT\_TEEM enables you to derive a
temperature map (Te) from two filters taken of the same region.  Some sample
calls are:
%
\idlinputa{sxt\_teem,index1,data1,index2,data2,Te}\index{SXT\_TEEM}
\idlinputb{sxt\_teem,index1,data1,index2,data2,Te,EM,dTe,dEM,subs=subs}
\idlinputb{sxt\_teem,index1,data1,index2,data2,Te,EM,dTe,dEM,\$}
\idlinputbb{     sat1=sat1,sat2=sat2,unc1=unc1,unc2=unc2}
\idlinputb{sxt\_teem,index1,data1,index2,data2,Te,EM,dTe,dEM,\$}
\idlinputbb{     sat1=sat1,sat2=sat2,unc1=unc1,unc2=unc2,/average}
%
{\it index1,data1} should contain data for a single SXT filter.  {\it index2,data2}
   should contain data for a single SXT filter which is different from that
   contained in {\it index1} and {\it data1}.

 The input data should be decompressed and background subtracted.  If index
   is a vector, then the data arrays should be 3-d arrays (cubes).

   Normally, SXT\_TEEM will get the proper exposure times from the index.
   However, if you have renormalized the data in a non-standard manner, then use 
   the {\it t1=t1} and {\it t2=t2} keyword to over-ride the value in index.
t1 = Integration time in msec.
If Image1 is a cube, then t1 must be a vector and whose 
length = n\_elements(Image1(0,0,*))

The keyword option {\it sum = sum}
calls SXT\_SUMXY to rebin the data.
The input image must be a 2-d or 3-d array
{\it sum} must be an integral fraction of the number of X and Y elements.
If either of the two preceding conditions is not met, summing is not done.

If {\it data1} is a cube, {\it Te} will be computed for each image by default.
If {\it subs=subs} is present, {\it subs} should contain the indices of image
pairs to analyze.

The keyword option {\it thresh1=thresh1, thresh2=thresh2}
sets the level above which data are considered for processing.
The level is set on the background subtracted, rebinned data values.
If {\it sum=2}, then you must increase the value of {\it thresh1} by a factor
of 4 to have the same effect.

\subsubsection{SXT\_ERG\_PER\_DN}

SXT\_ERG\_PER\_DN returns the log of the radiative energy per DN
assuming a coronal spectral model with temperature, $T_e$.  The units
of the result are $\log_{10}$(erg/DN), where DN is assumed to be the
decompressed and background subtracted value that is read out of the CCD
camera.  Example calling statements are:
%
\idlinputa{log10\_erg\_dn = sxt\_erg\_per\_dn(log10\_Te,filter)}\index{SXT\_ERG\_PER\_DN}
\idlinputb{log10\_erg\_dn = sxt\_erg\_per\_dn(log10\_Te,filter,date='1-dec-92')}
%
and $log10\_Te$ and $filter$ are input variables which may be vectors.  $log10\_Te$ is
the log of the electron temperature (K), of the solar plasma and $filter$
is the SXT filter number.  For example, to compute $\log10$(erg/DN) for all filters
over the range of temperatures between $\log10(T_e)$ between 5.5 and 8.0 use the
following calling sequence:
%
\idlinputA{3}{Te = 5.5 + findgen(26)*.1         }{ ; Generate a temperature vector}
\idlinputb{log10\_erg\_dn = sxt\_erg\_per\_dn(Te,indgen(6)+1)}
%
The purpose of the $date$ keyword option is to allow the post-November
1992 SXT response functions to be used.  This can be invoked by specifying
any date later than ``14-Nov-92'', the day after a hole in the entrance
filter appeared, and caused the SXT response function to change.

\subsubsection{SXT\_VIGNETTE}\index{vignette}

The SXT vignette function was determined from pre-launch calibration data obtained
at White Sands Missile Range (WSMR) and was further refined using flight data.
The vignette function is approximated by two non-concentric cones.  The
routine SXT\_VIGNETTE computes the SXT vignette function for a given SXT
image as described in the scalar SXT $index$ as follows:
%
\idlinputA{3}{vignette = sxt\_vignette(index)}{        ; SXT Index should be a scalar}
\idlinputb{vignette = sxt\_vignette(array)}
\idlinputb{vignette = sxt\_vignette(index,energy)}\index{SXT\_VIGNETTE}
%
If $array$ is given then $array = [x0,y0,Nx,Ny,Mode]$ and $Mode =$ 0, 1, or
2, for full, half and quarter resolution.  The second argument, $energy$
will specify whether to use the low-energy results (derived from C-K and
Al-K test data) or the high-energy results (derived from Ag-L test data).
SXT\_VIGNETTE is called by SXT\_OFF\_AXIS to correct SXT images.  A quick
summary is available by typing:
%
\idlinputD{3}{help\_vignette          }{; Display SXT vignette function}\index{HELP\_VIGNETTE}

\subsubsection{SXT\_OFF\_AXIS}

The X-ray vignetting function can be approximately removed with the
routine SXT\_OFF\_AXIS.  Example calling statements are:
%
\idlinputa{data\_out = sxt\_off\_axis(index, data, index\_out)}\index{SXT\_OFF\_AXIS}
\idlinputb{data\_out = sxt\_off\_axis(index, data, /update\_index)}
\idlinputb{vignette = sxt\_off\_axis(index, /vignette\_only)}
%
SXT\_OFF\_AXIS calls SXT\_VIGNETTE to calculate the SXT X-ray vignette 
function.  See SXT Calibration Note 37 and the Instrument Guide of this
manual for more information.  Two Vignette functions have been determined:
the high-energy function is applied to the Al12 and Be119 filters and
the low-energy function is applied to all other filters.  Note that this
approach is somewhat approximate and care should be used when applying this
correction to SXT data.

\subsubsection{WL\_PROCESS [*]}

Alan McAllister wrote the routine WL\_PROCESS to process the SXT aspect
sensor images and generate limb darkening profiles, flat field images,
white light images minus the dark current, flat field, and limb darkening
signals.   The routine is still under development and you should look
at the documentation header of that routine for more details.

\subsection{Routines for Image Alignment}

The routines described here are specific to SXT.  There are also some routines
listed in the General Yohkoh Software chapter which can be used for either
SXT or other ground-based images.

\subsubsection{SXT\_PREP}

See the earlier section describing the details of SXT\_PREP.

\subsubsection{SXT\_CENTER [*]}
\index{alignment, SXT images}

SXT\_CENTER calculates the row ({\it x}) and column ({\it y}) of the
center of the solar disk and the radius ({\it r}) of the Sun
given a data cube ({\it data}) and the index structure ({\it index}).
The routine performs a fit to the limbs of the image.  The fit can
be off by several pixels in the E/W direction for X-ray images.
See the SXC database if you are interested in the X-ray center
for all SFD images as calculated by SXT\_CENTER.
%
\idlinputa{sxt\_center,data,index,x,y,r} \index{SXT\_CENTER}
%
There are many options that are possible to use, please
check them with DOC\_LIBRARY.

\subsubsection{GET\_GBO\_PFI [*]}
\index{alignment with ground-based images}
\index{ground-based images, aligning to SXT}

Given a SXT PFI image and either the file name of a ground-based image,
or the ground-based image itself, GET\_GBO\_PFI will extract the portion of
the GBO image corresponding to the SXT PFI.  The routine (a modification
of the routine GBO\_PFI written by Alan McAllister)\index{GBO\_PFI}
determines the PFI corners from {\it index}, rotates these to the
time of the GBO image, and extracts the section of the GBO image.
You can either pass in the GBO image itself, in which
case you MUST also supply the time for it, or a string
with the path/filename using the Yohkoh file name convention.
Some sample calls are:
%
\idlinputa{gbo\_img = get\_gbo\_pfi(index, gbo\_fullimg, gbo\_time)}
\idlinputc{gbo\_img = get\_gbo\_pfi(index, '/yd5/gbo91\_46a/gkm911116.1958')}\index{GET\_GBO\_PFI}

\subsubsection{OCENTER}

OCENTER will obtain the center of the Sun from a optical full frame image.
It makes a ``silhouette image'' consisting of 1's and 0's, then
calculates the centroid to determine $x$ and $y$. The area is used to
determine the image radius. The input image can be compressed
or decompressed, and in any summation mode.  The output is in SXT full resolution
pixels unless {\it /noscale} is set.
%
\idlinputa{ocenter, image, x, y, radius}\index{OCENTER}
\idlinputb{ocenter, image, x, y, radius, /noscale, cut=0.3}
%
where {\it image} is the 2-D input image, and {\it x} and {\it y} are the
E/W and N/S position of the sun.  {\it radius} is the solar radius in
pixels and {\it cut} is the fraction of image maximum to define the limb (default is 0.2)

\subsection{Routines for Accessing Secondary Database Files}

\subsubsection{GTAB\_COMM, GTAB\_ENTRY, GTAB\_ROI}
\index{control tables, SXT}
\index{sequence tables, SXT}
\index{tables, SXT}

It is possible to get information on what was used in an SXT table by
using one of these routines.  GTAB\_COMM returns information on the
common table, GTAB\_ENTRY returns information on the entry tables,
and GTAB\_ROI returns information on the ROI location and image
shape tables.  Some sample calls:
%
\idlinputa{print, gtab\_comm(index)}	\index{GTAB\_COMM}\index{GTAB\_ENTRY}\index{GTAB\_ROI}
\idlinputc{print, gtab\_comm('15-nov-91')} 
%
\subsubsection{GTAB\_PFI and GTAB\_FFI}

These routines allow a user to print information on the partial-frame
and full-frame observing sequence being used.  There are four possible
sequences for PFI and four more for FFI.  Which sequence is used is
determined by the DP mode and telemetry rate.  If the SXT index for
an image is passed, then it will figure out which of the four sequences was
running at that time.  
%
\idlinputa{print, gtab\_ffi(index)}	\index{GTAB\_FFI}\index{GTAB\_PFI}
\idlinputb{print, gtab\_pfi('15-nov-91', 2)}
%
If a time is passed, it will default to show
sequence number 0.  It is possible to specify which sequence table by passing
it as a second parameter.

\subsection{Routines for Engineering Plots}

\subsubsection{PLOT\_SOT}

PLOT\_SOT will plot out the aspect sensor degradation as a
function of time by typing:
%
\idlinputa{.run plot\_sot} \index{PLOT\_SOT}
%
It will produce plots for both the narrow-band and wide-band filters.

\subsubsection{PLOT\_TEMPS2 [*]}

PLOT\_TEMPS2  plots the SXT instrument temperatures.
This program can only be run after the variable {\it index} exists which
came from an SXT file.  A common practice is to run PLOT\_SOT which gets 
images over the whole mission.
%
\idlinputa{.run plot\_temps2} \index{PLOT\_TEMPS2}
%
A mosaic of time histories of the various instrument temperatures will
be plotted. 

\subsubsection{PLOT\_SSL}

PLOT\_SSL will plot the SXT summary log (SSL) information.  A series of 
plots are made which include:
\IItem
\item Plots of measured exposure levels
\item Plots of SXT temperatures
\item Plots of number and duration of exposures through different filters
\item Plots of percentage of data received
\item Plots of average/max SXS1,SXS2,HXT-Low,RBM counting rates
\end{itemize}

Sample calls are:
%
\idlinputa{plot\_ssl}\index{PLOT\_SSL}
\idlinputb{plot\_ssl, [0,1]}
\idlinputb{plot\_ssl, 3}
%
where the second example only plots the first two series of plots (exposure levels
and SXT temperatures), and the last example only plots percentage of data received.

\newpage %------------------------------------------------------------------------
\section{Wide Band Spectrometer (WBS)}

\begin{sloppy}
\subsection{Routines for Making Time Plots}

\subsubsection{PLOTT\_WDA  }
\index{light curves, WBS}

PLOTT\_WDA will make a light curve plot for all channels using either the index or
roadmap.  The second `T' signifies that it is a time plotting routine.
Seven plots are made, one for each channel.  Some sample calls are:
%
\idlinputa{plott\_wda, index}	\index{PLOTT\_WDA}
\idlinputb{plott\_wda, roadmap}	
\idlinputc{plott\_wda, roadmap(100:200), psym=10} 
%
\subsection{Routines for Making Spectral Plots}

\subsubsection{PLOTS\_WDA}

PLOTS\_WDA is a very rudimentary plotting routine that will display the spectra for any of the
WBS sub-instruments.  It is interactive and will prompt the user for
which sub-instrument to display, and which datasets.  A sample call is:
%
\idlinputd{plots\_wda, index, data}\index{PLOTS\_WDA}

\subsection{Routines for 2-D Spectral Display}

\subsubsection{DISP\_WDA  }

The evolution of  all of the WBS spectra  against  time  can  be  displayed as a pseudo-image
using the routine DISP\_WDA.  Note:  The time axis of DISP\_WDA is not uniform.
%
\idlinputd{disp\_wda, index, data}\index{DISP\_WDA} 
%

\subsubsection{SXSPC}

SXSPC makes the time profiles of SXS-PC11, PC12, PC-21, and 
PC22 with various options\footnote{If this code is used as a template, we recommend
that the calling sequence be {\it index,data} for all routines}.
%
\idlinputa{pc\_data= sxscv(data, index)}
\idlinputc{sxspc,pc\_data,index}\index{SXSPC}

\subsubsection{WBSPC}

WBSPC makes four counting rate time profiles of SXS-PC11(21), 
SXS-PC12(22), HXS-PC1 and HXS-PC2. 
%
\idlinputd{wbspc,data,index}\index{WBSPC}

\subsubsection{PLOT\_HXSPC}

PLOT\_HXSPC makes a counting rate time profile of HXS-PC1, HXS-PC2 
or HXS-PC1 + PC2 with \mbox{UTPLOT}. 
%
\idlinputd{plot\_hxspc,index,data,pc}\index{PLOT\_HXSPC}
 
\subsubsection{PLOT\_HXSPH}

PLOT\_HXSPH makes a counting rate time profile of HXS-PH with
\mbox{UTPLOT}. You choose the energy or channel range.
%
\idlinputa{plot\_hxsph,index,data,range=range}
\idlinputc{plot\_hxsph,index,data,channel=channel}\index{PLOT\_HXSPH}

\subsubsection{PLOT\_GRSPCL}

PLOT\_GRSPCL makes a counting rate time profile of GRS-PC11, PC12, 
PC21 or PC22 with \mbox{UTPLOT}. 
%
\idlinputd{plot\_grspcl,index,data,pc}\index{PLOT\_GRSPCL}

\subsubsection{PLOT\_GRSPCH}

PLOT\_GRSPCH makes a counting rate time profile of GRS-PC13, PC14, 
PC15, PC16, PC23, PC24, PC25 or PC26 with \mbox{UTPLOT}.
%
\idlinputd{plot\_grspch,index,data,pc}\index{PLOT\_GRSPCH}

\subsubsection{PLOT\_GRSPHL}

PLOT\_GRSPHL makes a counting rate time profile of GRS-PHL1 or GRS-PHL2 with \mbox{UTPLOT}. 
You choose the energy or channel range. 
%
\idlinputa{plot\_grsphl,index,data,ph=1,range=range,channel=channel}\index{PLOT\_GRSPHL}

\subsubsection{PLOT\_GRSPHH}

PLOT\_GRSPHH makes a counting rate time profile of GRS-PHH1 or GRS-PHH2 with \mbox{UTPLOT}. 
You choose the energy or channel range. 
%
\idlinputd{plot\_grsphh,index,data,ph=1,range=range,channel=channel}\index{PLOT\_GRSPHH}

\subsubsection{Light Curve of RBM-PC }

See the description in the User's Guide.

\subsection{Routines for Data and Information Extraction}

\subsubsection{GT\_ Routines}

The routines GT\_SXS1, GT\_SXS2, GT\_HXS, GT\_GRS1, GT\_GRS2, GT\_RBMSD, and GT\_RBMSC
routines will extract the average counts/sec for the selected channel.

\vspace{0.2in}
\begin{tabular}{|l|l|l|} \hline
SXS1  & { Only SXS\_PC21 }          & { 3-15 keV} \\
SXS2  & { Only SXS\_PC22 }          & { 15-40 keV} \\
HXS   & { HXS\_PC1 plus HXS\_PC2 }  & { 20-657 keV} \\
GRS1  & { GRS\_PC11 plus GRS\_PC21} & {  0.3-1.2 MeV } \\
GRS2  & { GRS\_PC12 plus GRS\_PC22} & {  1.2-5.6 MeV } \\
RBMSD & {  PC1 plus PC2 }           & { 5-300 keV  } \\
RBMSC & { Only RMSSC}               & {  $>$20 keV } \\ \hline
\end{tabular}\vspace{0.1in}

The input can be roadmap, index, or observing log and it will
get the proper structure tag and decompress it properly to 
return counts/sec/sensor.
It is possible to get a string defining the
channel selected by using the {\it title} keyword option.
%
\idlinputa{y = gt\_sxs1(roadmap)}	\index{GT\_SXS1}\index{GT\_SXS2}\index{GT\_HXS}\index{GT\_GRS1}
\idlinputc{y = gt\_hxs(w\_h, title=title)}\index{GT\_GRS2}\index{GT\_RBMSD}\index{GT\_RBMSC} 
%
\subsubsection{GET\_INFO}

See the description in the ``General Yohkoh Software'' chapter on
page~\pageref{get_info}.

\subsection{Routines for Calibration and Analysis}

\subsubsection{HXS\_FSP [*]} \index{spectral fitting}

With HXS\_FSP you interactively choose data intervals, and fit the HXS spectrum,
using the routine fsp\_11.pro. {\it index} and $data$ are the WBS index and data 
structures. $fit\_pars$ is the structure containing the results.  Optional parameters are 
-- $sc\_par$ is a structure containing spectrometer 
channel information, $ch\_dta$ is a structure containing the data for each channel, 
$outfile$ and $pfile$ are filenames for printouts and plots, respectively; 
$countfile$ is a filename, if this option is set, the count rates are printed
into that file which may be fit by the routine FSP\_PROC described above. 
%
\idlinputa{HXS\_FSP, index, data, fit\_pars}\index{HXS\_FSP}
\idlinputb{HXS\_FSP, index, data, fit\_pars, sc\_par, ch\_dta}
\idlinputb{HXS\_FSP, index, data, outfile=outfile}
\idlinputb{HXS\_FSP, index, data, pfile=pfile}
\idlinputb{HXS\_FSP, index, data, countfile=countfile}
\idlinputb{HXS\_FSP, index, data, fit\_pars, sc\_par, ch\_dta, sdel=sdel}
%

\subsubsection{HXS\_SPL}

HXS\_SPL makes a HXS spectrum fitted by single power law. You
interactively choose the background and flare time intervals for the
spectral analysis.  
%
\idlinputd{hxs\_spl,data,index}\index{HXS\_SPL}

\subsubsection{HXS\_SP2}

HXS\_SP2 makes HXS spectrum fitted by double power law in a similar way to HXS\_SP1.
%
\idlinputd{hxs\_sp2,data,index}\index{HXS\_SP2}

\subsubsection{GRS\_SPEFF}

GRS\_SPEFF makes preliminary GRS-1 and 2 spectra (0.3 -- 100 
MeV).You interactively choose the flare and background time intervals 
for the spectral analysis. The flux of each channel is calculated by 
dividing the counts by full energy absorption efficiency.  The first three 
channels data of GRS-1 and the four channels of data of GRS-2 are not plotted 
because these channel widths are not exactly determined.
%
\idlinputa{grs\_speff,data,index,ph=1,/disp}\index{GRS\_SPEFF}
\idlinputb{grs\_speff,data,index,ph=2,/disp}
\idlinputc{grs\_speff,data,index,ph=1,fltime=fltime,bgtime=bgtime}

\subsubsection{Further Analysis of HXS and GRS Data}

There are several routines for further HXS and GRS data analysis. With 
these routines you can get the following:

\IItem
\item Time profile of ratio of HXS-PC2 to HXS-PC1 counting rates       
\item Time profile of ratio of HXS-PHi-j to HXS-PHm-n counting rates
\item Time profile of ratio of GRS-PCi to GRS-PCj counting rates
\item Time profile of ratio of GRS-PHi-j to GRS-PHm-n counting rates
\item HXS spectral fitting by single power law, double power law, thermal 
     and power law plus Gaussian etc.    
\item Residuals and chi-square map for HXS spectral analysis
\item Gamma-ray spectral analysis (continuum plus lines) with the maximum 
     number of fitting parameters is 62
\item Residuals and chi-square map for GRS spectral analysis
\end{itemize}

See the detailed description in the User's Guide.

\subsection{Instrument Response Files}

The instrument response files for SXS, HXS and GRS are listed here.  These
files are ASCII files and are located in \$DIR\_WBS\_CAL.

\subsubsection{SXS}
\index{response files, WBS-SXS}

\vspace{0.2in}\begin{tabular}{|l|p{10.0cm}|}\hline
dtcorrf.dat  & {\raggedright
      Table of the deadtime correction factor vs. counting rates of
       SXS-PC11, PC12, PC21 and PC22 } \\ \hline 
\end{tabular}
 
\subsubsection{HXS}
\index{response files, WBS-HXS}

\vspace{0.2in}\begin{tabular}{|l|p{10.0cm}|}\hline
hxs\_01.rel & {\raggedright
      Table of channel number (0 -- 31) vs. energy (keV) relation for HXS-
       PH for HXS-OS of ``01 (hex)". (1992 June 9 -- present). } \\ \hline 

hxs\_21.rel & {\raggedright
      Table of channel number vs. energy relation for HXS-PH for
       HXS-OS of ``21 (hex)". (1991 Oct. 1 -- 1992 June 9). } \\ \hline 

hxs\_01\_conv260.rel & {\raggedright
      Table of incident photon energies (keV) corresponding to the 260
       rows of the 260 x 32 response matrix for HXS-PH spectral 
       analysis for HXS-OS of ``01 (hex)". (1992 June 9 -- present). } \\ \hline 

hxs\_21\_conv260.rel & {\raggedright
      Table of incident photon energies (keV) corresponding to the 260
       rows of the 260 x 32 response matrix for HXS-PH spectral 
       analysis for HXS-OS of ``21 (hex)". (1991 Oct. 1 -- 1992 June 9). } \\ \hline 

hxs\_01\_conv260.resp & {\raggedright
       260 (row) x 32 (column) response matrix for HXS-PH spectral 
       analysis for HXS-OS of ``01 (hex)". The row and column represent 
       the incident photon energy and observed channel number, 
       respectively. The matrix elements of i-th row represent a response 
       function for incident photons of i-th energy in hxs\_conv260.rel.     } \\ \hline 

hxs\_21\_conv260.resp & {\raggedright
      260 (row) x 32 (column) response matrix for HXS-PH spectral 
      analysis for  HXS-OS of ``21 (hex)". This is similar to 
      hxs\_01\_conv260.resp. } \\ \hline 

dtcf\_pc\_hxs.pro & {\raggedright
       Deadtime correction factor for HXS-PC1 and PC2.  The correction 
       is not exact when  the deadtime-corrected count of total PC exceeds
      about 100,000 counts/sec. It is due to instrument limitation. } \\ \hline 

dtcf\_ph\_hxs.pro & {\raggedright
       Deadtime correction factor for HXS-PH. The correction is not exact
       when the deadtime-corrected count of total PH exceeds about 35,000 
       counts/sec. In addition, spectral distorsion occurs when the deadtime-corrected 
       count of total PH exceeds about 21,000 counts/sec. It is due 
       to instrument limitation. } \\ \hline 
\end{tabular}
   
\subsubsection{GRS}
\index{response files, WBS-GRS}

\vspace{0.2in}\begin{tabular}{|l|p{10.0cm}|}\hline
grs1\_40.rel & {\raggedright
     Table of channel number (0 -- 127)  vs. energy (keV) relation for GRS-
     1 for GRS1-OS of ``40 (hex)". (1991 Oct.1- present). Energy widths 
     of the first 3 channels are not exact.  } \\ \hline 

grs2\_40.rel & {\raggedright
      Table of channel number (0 -- 127)  vs. energy (keV) relation for
      GRS-2 for GRS2-OS of ``40 (hex)". (1991 Oct.1- present). 
      Energy widths of first 4 channels are not exact.  } \\ \hline 

grs1\_40\_conv260.rel  & {\raggedright
    Table of incident photon energies (keV) corresponding to the 260
     rows of the 260 (row) x 128 (column) response matrix for GRS-
     PHL1 spectral analysis. } \\ \hline 

grs1\_40\_conv260.resp & {\raggedright
     260 (row) x 128 (column) response matrix for GRS-PHL1 spectral
     analysis. The row and column represent the incident photon energies
     and observed channel number, respectively. The matrix elements 
     of i-th row represent a response function for incident photon
     of i-th energy in grs1\_conv260.rel.  } \\ \hline   

grs2\_40\_conv260.rel  & {\raggedright
     Table of incident photon energies (keV) corresponding to the 260
     rows of the 260 (row) x 128 (column)  response matrix for GRS-
     PHL2 spectral analysis. } \\ \hline 

grs2\_40\_conv260.resp & {\raggedright
      260 (row) x 128 (column) response matrix for GRS-PHL2 spectral
      analysis. This is similar to grs1\_conv260.resp.  } \\ \hline 

dtcf\_ph\_grs11.pro & {\raggedright
       Deadtime correction factor for GRS-PHL1.  } \\ \hline 

dtcf\_ph\_grs21.pro & {\raggedright
       Deadtime correction factor for GRS-PHL2.  } \\ \hline 
\end{tabular}

\end{sloppy}


\newpage %------------------------------------------------------------------------
\section{Software for Ground-Based and Other Satellites (GBO)}

\subsection{Accessing Ground-Based FITS Images}

All Ground-Based images that are stored in the Yohkoh database use the
FITS file format. \index{FITS files}

\subsubsection{Directory and File Organization}

The ground-based data are stored in a single FITS image per file.  The
data are organized to have all images for a given week stored in one
directory.  For example, the data taken during week 47 of 1992
(from 15-Nov-92 through 21-Nov-92 inclusive) would be in the
directory /yd0/gbo92\_47a at the ISAS system.
\index{FITS files}
\index{ground-based FITS files}

The Yohkoh file naming convention for ground-based data is similar
to that used for Yohkoh data.  There is a three letter prefix followed by the
normal file ID portion (YYMMDD.HHMM) (see the Reference Guide section defining the
Yohkoh FileIDs).  The first letter of the three letter prefix is always
`g' to signify ground-based data.  The second letter is the institute
where the data was taken.  The letters assigned to the institutes are:

\begin{verbatim}
                B = Big Bear
                C = Boulder Colorado
                G = Goddard Space Flight Center
                H = Holloman
                J = CRL/Hiraiso
                K = Kitt Peak
                L = Learmonth, Australia
                N = NAOJ, Nobeyama, Norikura
                P = Palehua (SOON)
                R = Ramey (SOON)
                S = San Vito (SOON)
\end{verbatim}

\noindent The last letter is the type of data that is in the file.  The letters
assigned to the types of images are:

\begin{verbatim}
                C = Large Scale H-Alpha
                G = Green Line Image (5303 A)
                H = H-alpha
                I = HeI 10830 A
                K = Calcium
                M = Magnetogram
                P = Polarized Radio (17 GHz) (R-L)
                R = Red Line Image (6374 A)
                S = Spectrohelioscope
                T = Total Intensity Radio (17 GHz) (R+L)
                W = white light
                X = X-ray
                Y = Yellow Line Image (5694 A)
\end{verbatim}

A sample name is {\tt /yd0/gbo93\_01a/gkm930101.1657} for the ISAS system.
NOTE: The GBO files online could be compressed so that there is a ``.Z''
at the end of the file name.  The reading routine RFITS2 (and YODAT) will
handle these compressed files automatically.

\subsubsection{RFITS}

RFITS reads a standard format FITS file by typing: \index{FITS files}
%
\idlinputa{img = rfits(infil, header=header)} \index{RFITS}
%
where {\it img} is the image, {\it infil} is the input file name, and $head$ is
the string array with the data header in it.  It is possible to use
the $/SCALE$ option to convert the data into some physical units.  For
example, the magnetogram data would be converted to gauss.
%
\idlinputd{img = rfits('/yd0/gbo92\_37/gkm920907.1442', head=head, /scale)}
%

\subsubsection{GBO\_MASK}
\index{masking GBO images}
\index{correcting GBO images}
\index{GBO, masking lettering}

The routine GBO\_MASK can be used to mask out the writing that appears
on some of the ground-based images.  It is important to perform this step
before using the ``contaminated'' image for limb fitting.  A sample call
is:
%
\idlinputd{img = gbo\_mask(img)}\index{GBO\_MASK}

\subsection{Accessing GOES Data}

\subsubsection{PR\_GEV}

The GOES event log files are available with the Yohkoh database.  To get a
printout of the X-ray events for a given day, use something like:
%
\idlinputa{pr\_gev,'2-nov-92'}\index{PR\_GEV}
%
See the User's Guide for a sample printout.

\subsubsection{PLOT\_GOES}

PLOT\_GOES routine will plot the GOES one minute light curve data.  The 
following are a few examples:
%
\idlinputa{plot\_goes, '2-nov-92'}	\index{PLOT\_GOES}
\idlinputb{plot\_goes, '2-nov-92', '4-nov-92'}
%
The default is to plot 24 hours of data.  See the User's Guide for a sample plot.
%
\subsection{Accessing GRO BATSE Data}

\subsubsection{PR\_GBE}

The BATSE event log files are available with the Yohkoh database.  To get a
printout of the X-ray events for a given day, use something like:
%
\idlinputa{pr\_gbe,'15-nov-91}\index{PR\_GBE}
%
See the User's Guide for an example.

\subsubsection{PLOT\_GBL}

BATSE light curves can be produced using PLOT\_GBL.  It is possible to
specify the time span or to specify an event.  Some sample calls are:
%
\idlinputa{plot\_gbl, '15-nov-91 22:00', '15-nov-91 23:00'}\index{PLOT\_GBL}	
\idlinputb{plot\_gbl, event=1901}
%
See the User's Guide for a sample plot.

\newpage %------------------------------------------------------------------------
\section{Low Level Routines}

\subsection{Plotting Routines}

\subsubsection{PLOT\_LCUR}

PLOT\_LCUR is a low level generic plotting routine used by several other routines.
The routine returns the list of subscripts which are between the times selected
by the user.  The user clicks on the plot with the left button to define a new start time,
the right button to define an end time, and the middle button to exit.  The user can
expand a time range after marking the start/stop times by clicking with the left
button on the box in the lower right corner.  Some of the more simple calls are:
%
\idlinputa{ss = plot\_lcur(roadmap, gt\_sxs1(roadmap))}	\index{PLOT\_LCUR}
\idlinputb{ss = plot\_lcur(index, gt\_sum\_l(index), plotr=a, title=title)}	
\idlinputc{ss = plot\_lcur(index, gt\_sum\_l(index), /nohard)} 
%

\subsubsection{CLEARPLOT}

CLEARPLOT will reset the IDL plotting variables. \index{CLEARPLOT}

\subsubsection{CLEAR\_UTPLOT}

CLEAR\_UTPLOT will reset the UTPLOT plotting variables.\index{CLEAR\_UTPLOT}

\subsection{File and Directory Routines}

\subsubsection{CONCAT\_DIR}

CONCAT\_DIR is fundamental in allowing software to be portable
between Unix and VMS systems.  Given a directory logical name (or
environment variable) it will figure out whether to put a `/' between
the directory and the file name (for Unix systems), or to use
a `:' (for VMS systems).  A restriction is that the directory must
be a logical or environment variable.  Some sample calls are:
%
\idlinputa{outfil = concat\_dir(dir, filnam)}	\index{CONCAT\_DIR}
\idlinputc{outfil = concat\_dir('\$DIR\_GEN\_OBS', 'obs92\_23a.01')} 
%

\subsubsection{FILE\_LIST}

FILE\_LIST enables you to get a string array {\it infil} with all the files
that fulfill a set of specifications by typing:
%
\idlinputa{infil = file\_list(dir, filenam)}\index{FILE\_LIST}
\idlinputa{infil = file\_list(dir, filenam, /cd)}
%
where {\it dir} is a string array of directory name(s) and {\it filenam} is a string
with the file designation (wild cards are ok --- e.g., sfd* or bda920101.*).

\subsubsection{FILE\_MENU}

FILE\_MENU works very much like FILE\_LIST but is menu driven.  It only
gets you a single file (infil) by typing:
%
\idlinputd{infil = file\_menu(dir,filenam)} \index{FILE\_MENU} 
%
\subsubsection{DATA\_PATHS}

DATA\_PATHS is fundamental to several routines including YODAT.  The
routine should return a string array with all the directories where
there are Yohkoh reformatted data.  The routine is site specific since
each institute organizes the data slightly differently.  A common practice
is to use DATA\_PATHS2 to get the standard data directories, and 
then append the specialized data directories.  See the sample DATA\_PATHS
program in the `site' branch of the Yohkoh software.
\index{DATA\_PATHS}

\subsubsection{DATA\_PATHS2}

DATA\_PATHS2 searches all `/yd' directories for directories with 
YY\_WW names (for example, `/yd1/92\_36a' or `/yd10/91\_35a').  Since the
generation of the data directory list is done automatically, it is not
necessary for a programmer to edit DATA\_PATHS every time a new week
of data are placed on-line.
\index{DATA\_PATHS2}

\subsubsection{NEW\_DPATH}\index{data directories}
\index{customizing your data path}

NEW\_DPATH will add elements to the Yohkoh data paths array. These are the disk areas
automatically searched for reformatted files.  A file option allows reading from a file
of pathnames.  This can be conveniently called from an a personal IDL startup file to
automatically define paths when entering IDL.  Switches are available to add current directory,
initialize contents, remove elements, or save current contents for later input via file option.
%
\idlinputa{new\_dpath, patharray}\index{NEW\_DPATH}
\idlinputb{new\_dpath, /current}
\idlinputb{new\_dpath, /init}
\idlinputb{new\_dpath, /file}
\idlinputb{new\_dpath, file=file}
\idlinputb{new\_dpath, /save}
%
Current contents of data paths area may be reviewed with the command:
\idlinputd{prstr, data\_paths()}

\subsubsection{GBO\_PATHS}

GBO\_PATHS is similar to DATA\_PATHS, but it looks for the
environment variables beginning with `DIR\_GBO' and creates a list.
This routine is used by YODAT to find where the ground-based FITS
files are located.
\index{GBO\_PATHS}

\subsubsection{GET\_SUBDIRS}

GET\_SUBDIRS will return all the subdirectories under a given
directory.  An example:
%
\idlinputd{dirs = get\_subdirs('/ys')}\index{GET\_SUBDIRS} 
%

\subsubsection{PR\_PATH}
\index{PR\_PATH}

PR\_PATH will display all the directories that are in the
IDL variable !path.

\subsubsection{PATH\_LIB}

PATH\_LIB will search directories in the IDL !path variable in the
order of the list to find a given IDL program.  The default is to
only give the first instance that the file is found, but it is possible to
get all locations by using the {\it /multi} switch.  A wild card (`*')
effectively sets the {\it /multi} switch).  Same examples are:
%
\idlinputa{path = path\_lib()}	\index{PATH\_LIB}
\idlinputb{path = path\_lib('add*')}	
\idlinputc{path = path\_lib('yodat', /multi)} 
%
\subsubsection{PR\_PATH\_LIB}

PR\_PATH\_LIB is like PATH\_LIB, except PR\_PATH\_LIB is a procedure which
will print the results to your screen.  For example,
%
\idlinputa{pr\_path\_lib,'gt\_*'}
%
will return a list of all ``gt\_'' routines

\subsubsection{FILES\_SEARCH}

FILES\_SEARCH will search all files in sub-directories from a given directory
for a given string.  In the following example, all .PRO files under the
/ys tree are searched to find the string `CONV\_'.
%
\idlinputd{files\_search, '/ys', 'CONV\_'} \index{FILES\_SEARCH} 
%
\subsection{Miscellaneous}

\subsubsection{PRSTR}

PRSTR prints any string array to the terminal or a file, one element per line.
For terminal output, the default is to print by screen (Unix ``more'' behavior).
The {\it /compress} switch removes null lines and excess white space prior to output.
This is useful (for example) for printing FITS headers to terminal.  {\it /hc}
will create a hard copy to the printer selected by PPRINT.  {\it file=file} will write the results to a file.
%
\idlinputa{prstr, strarray}\index{PRSTR}
\idlinputb{prstr, strarray, /print}
\idlinputb{prstr, strarray, /compress}
\idlinputc{prstr, strarray, lun}
%
\subsubsection{STR2ARR}

Given a string, STR2ARR will separate the items into an array
using a `,' as the delimiter by default.  Some examples are:
%
\idlinputa{arr = str2arr('a,b,c,d,e,f,ggg,hh')}	\index{STR2ARR}
\idlinputc{arr = str2arr(!path, delim=':')} 
%
\subsubsection{ARR2STR}

Given an array, ARR2STR converts it to a string.  The items will be separated by
a comma by default.
%
\idlinputd{str = arr2str(indgen(10))}\index{ARR2STR} 
%
\subsubsection{STR\_REPLACE}

Given a string (or an array of strings) it is possible to replace all
occurrences of a given string using STR\_REPLACE.  In the example below, all occurrences of
``sfr'' are replaced with ``spr''.
%
\idlinputd{out = str\_replace(in, 'sfr', 'spr')}\index{STR\_REPLACE}
%

\subsubsection{WC\_WHERE}
The WC\_WHERE function will search a string array for the occurrence of a substring and
return the indices of the elements where a match is found.  The substring
may contain one or more wild cards.  An optional third parameter contains
a count of the elements returned.  The {\it case\_ignore} switch may be
used to force the search to be insensitive to the case of the characters.
%
\idlinputa{ss=wc\_where(strarray, pattern)}\index{WC\_WHERE}
\idlinputb{ss=wc\_where(filearray, 'sfr9310*', filecount)}
\idlinputc{ss=wc\_where(strarray, '*time*',/case\_ignore)}

\subsubsection{REBIN [IDL]}

REBIN is an IDL routine that enables you to make a 2
dimension array larger or smaller (it also works on
multidimensional arrays). To use it to create a new
512$\times$512 image (ndat) from a 64$\times$64 image (data) type:
%
\idlinputa{ndat=rebin(data,512,512,/sample)} \index{REBIN}
%
Note that the new x and y dimensions must be integral
multiples (or divisors) of the original array dimensions.

\subsubsection{PLOT\_TRAV}

It is possible to plot a time line showing when the SXT and BCS team members 
will be on travel to Japan by using PLOT\_TRAV.  The plot separates the
people by institution.  Some examples are:
%
\idlinputa{plot\_trav}	\index{PLOT\_TRAV}
\idlinputb{plot\_trav, /lparl}	
\idlinputb{plot\_trav, /ops}	
\idlinputb{plot\_trav, /bcs}
%
The default is to plot SXT personnel.  To show BCS personnel use the {\it /bcs}
switch.  The {\it /lparl} switch will only plot
the key Lockheed SXT personnel.

\subsubsection{RD\_TFILE}

RD\_TFILE is a generic ASCII (text) file reading routine.  It can be used to 
return the contents of any text file as an IDL array.  A fast algorithm is 
used which makes it more than an order of magnitude faster than reading 
line by line until end-of-file.  See the User's Guide description for more details.
Calling Examples
%
\idlinputA{4}{text=rd\_tfile(filename)                   }{; orig. file-$>$ string array}\index{RD\_TFILE}
\idlinputB{4}{data=rd\_tfile('fdata.dat',/auto,/convert) }{; determine n columns and}
\idlinputB{4}{                                           }{; data type automatically}
\idlinputB{4}{text=rd\_tfile('file.pro',nocomment=';')   }{; remove comment lines}
\idlinputc{passwd=rd\_tfile('/etc/passwd',delim=':',/auto,/nocomment)}

\subsubsection{DEF\_TAPD}

DEF\_TAPD returns default tape drive names as a scaler string.  It includes default entries for the
most common operating systems.  It offers automatic substitution of the an
input drive number (default is drive 0).  If the system variable !ys\_deftape is defined,
the routine will return that value (with drive number substitution, if requested).\index{tape drive names}
%
\idlinputa{drive = def\_tapd()}\index{DEF\_TAPD}\index{default tape drive}\index{tape drive names}
\idlinputc{drive = def\_tapd(2)}

\subsubsection{WMENU\_SEL}

WMENU\_SEL is an expansion on the IDL WMENU routine.  It allows for many menu
pages if the number of items will not fit on one page.  It also allows a user
to select several items.  Some sample calls are:
%
\idlinputa{ss = wmenu\_sel(array)}	\index{WMENU\_SEL}
\idlinputc{ss = wmenu\_sel(files, /one)}
%

\subsubsection{STR\_DIFF}
\index{structures, comparing}
\index{comparing structures}

STR\_DIFF will is a boolean function which returns true (1) when differences
are found between the two input structures.  If no
differences are found, it returns false (0).
%
\idlinputa{qdiff = str\_diff(index1, index2)}\index{STR\_DIFF}
\idlinputb{qdiff = str\_diff(index1, index2, /diff}
\idlinputb{qdiff = str\_diff(index1, index2, dtnames=dtnames}
%
where {\it /diff} will only check the tag names. $tnames=tnames$ is an
optional input list of the tag names which should be checked (the default is to check all tags).  
You can get a list of the tags whose values differ by using the
optional keyword output, $dtnames=dtnames$.
STR\_DIFF is not recursive.

\newpage %------------------------------------------------------------------------
\section{Getting Help on Software and Data}

\subsection{DOC\_LIBRARY [IDL-LIB]}

IDL has a facility called DOC\_LIBRARY which you can use to get the
details of any procedure that you know the name of by typing:
%
\idlinputa{doc\_library,'yodat'} \index{DOC\_LIBRARY}
%
This will obtain a listing of the header information of
the program YODAT (any comments put in at the beginning
of the code between `;+' and `;-') provided it is in your
path. Wild cards are allowable, e.g.,
%
\idlinputa{doc\_library,'test*'}
%
DOC\_LIBRARY is a script driven program (i.e., it will work on ordinary
terminals as well as X-terminals or workstations.   Do not include the
`.PRO' in the call to DOC\_LIBRARY.

\subsection{FASTDOC}

This procedure will print out the IDL documentation header for the input
routine(s).  The location of the IDL routines are determined using a table 
lookup algorithm so that subsequent calls are very fast.  For routines
located within the Yohkoh tree, FASTDOC is an efficient substitute 
for DOC\_LIBRARY, which must search for routines on every call.  
The {\it /summ} switch may be used to print only the procedure or function 
definition line.  The {\it /multi} switch will print all online versions of 
the input routines.  When called without parameters, an interactive version 
is invoked.  Currently only works on Unix machines.
%
\idlinputa{fastdoc, 'fastdoc'}\index{FASTDOC}
\idlinputb{fastdoc, 'fastdoc', /multi, /summ} 
\idlinputb{fastdoc, '*anytim*'}
\idlinputc{fastdoc}

\subsubsection{PR\_PATH\_LIB}

PR\_PATH\_LIB will search directories in the IDL !path variable in the
order of the list to find a given IDL program.  The default is to
only give the first instance that the file is found, but it is possible to
get all locations by using the {\it /multi} switch.  A wild card (`*')
effectively sets the {\it /multi} switch).  
For example,
%
\idlinputa{pr\_path\_lib,'gt\_*'}\index{PR\_PATH\_LIB}
%
will return a list of all ``gt\_'' routines and their directory locations.

\subsection{XDOC}

XDOC is a widget version of DOC\_LIBRARY. It is invoked by typing:
%
\idlinputa{xdoc,'name'}\index{XDOC}
%
where NAME is the name of the procedure to be examined. The text of the input
procedure will appear in a scroll window, with buttons to control print the
file, and also extracting and copying the file to the current directory as .TXT
file. Calling XDOC without a procedure name will produce a menu listing of all 
the directories and/or libraries that are defined in the current IDL\_PATH. The
user can subsequently scan the IDL path for any desired procedure by clicking
on a particular path element.

\subsection{CHKARG}

CHKARG is a routine that solves the problem of what to enter when you have
forgotten the argument list or argument ordering of a particular procedure or
function. It is invoked by typing:
%
\idlinputa{chkarg,'name'}\index{CHKARG}
%
where NAME is the name of the procedure in question. CHKARG will echo the
calling sequence (arguments and keywords) and also the directory/library
location of the procedure.

\subsection{XDL [IDL-LIB]} 

XDL is a widget driven version of DOC\_LIBRARY and will
present you with a complete list of all the IDL software in your path. 
You can search using the mouse and slider on the screen.  It is run by
typing:
%
\idlinputd{xdl} \index{XDL} 
%
\subsection{PRO\_LIST}

PRO\_LIST returns a list of the IDL programs, functions, and procedures (.PRO files)
that are in the IDL path (!path).
%
\idlinputa{pro\_list}\index{PRO\_LIST}
\idlinputc{pro\_list, outfil='pro\_list.txt'} 
%

\subsection{HELP [IDL]}

The IDL command HELP is available to get information on all the
variables, procedure and functions currently in IDL's memory.  By typing:
%
\idlinputa{help} \index{HELP}	
\idlinputb{help, data}
%
you get a list of all of the variables that are defined within the current
IDL session.  If you want information the definition of a structure, you
can use the /STRUCTURE option.  Some examples are:
%
\idlinputa{help, /st, roadmap}	
\idlinputb{help, /st, index.gen}
%
It is possible to get information on the calling parameters of procedures and
functions that have already been compiled by typing:
%
\idlinputa{help, /routine}
%
The procedure and function name is listed first.  The positional parameters are
listed in lower case and the keyword parameters are in upper case.

\subsection{HELP\_PREFIX}

HELP\_PREFIX will display a list of the Yohkoh three letter prefixes which are
used for the data files.  The {\it /full} option will show a paragraph about
the prefix.  Some sample calls are:
%
\idlinputa{help\_prefix}\index{HELP\_PREFIX}
\idlinputb{help\_prefix, 's*', outfil='junk.txt'}
\idlinputc{help\_prefix, 'att', /full}

\subsection{HELP\_FIGS}

HELP\_FIGS will display a menu of several figures which appear in the Yohkoh
guides (one option is to call HELP\_ROLL which shows the S/C roll sign
conventions).  A sample call is:
%
\idlinputa{help\_figs}\index{HELP\_FIGS}

\appendix
\newpage %------------------------------------------------------------------------

%TODO - MONS - add \label{install_sec}
\input rguide_install.tex	% \section{Installation and Maintenance of the Yohkoh Software}

\newpage %------------------------------------------------------------------------

\input rguide_custom.tex	% \section{Customizing Your Personal Yohkoh Working Environment}

\newpage %------------------------------------------------------------------------

\section{How to Contribute Software to the Yohkoh System}

We encourage users to contribute SW to the system, however we strongly
recommend that people at remote sites do not make changes or additions
to the directories under \$ys.  If additions must be made, we recommend
that they be placed in the \$ys/site/soft branch of the Yohkoh software tree.
Software in the \$ys/site/soft branch are not changed during software
installations and upgrades.
The routines placed in the \$ys/site/soft branch should not be modified
versions of ``official'' routines since updates to those routines will
not be accessed.
\index{site software}\index{contributing software}\index{local software}\index{local software contributions}
See the discussion of IDL\_PATH to understand how you can have both
Yohkoh Software directories and personal directories accessible at the
same time.

We have a system in
place to facilitate contributions via anonymous FTP from remote systems. 
A set of Unix script files is used to automate the transfer (all FTP
commands are handled within the scripts) and to help the Yohkoh SW
managers to handle the contributions in a systematic fashion
\footnote{The method used in the past was to use the {\it online} script.
We request that people start to use the {\it ys\_contrib} script
as the {\it online} script will be removed at some point in the future.}.

There are several categories of user contributions which we are interested
in having remote sites submit to the system:

\begin{enumerate}
\item Software: Software contributions are expected to follow the guidelines described
in appendix of the Reference Guide.

	\IItem
	\item Corrections to distributed Yohkoh SW. This category would include any
	changes which were required at a remote site to fix a known problem (bug)
	with a distributed routine.  It also includes modifications which were
	required to get the routine to work properly at the particular site 
	due to differences in environment (operating system, shell environment, etc)
	
	\item Enhancements to distributed SW. This includes any changes made at remote
	sites to add new functions or features and thought to be of
	a more general interest.

	\item New software which would be of use to others and possibly avoid duplication
	of SW effort.  General purpose tools and utilities
	\end{itemize}

\item Non-Software:
	\IItem
	\item Non-SW information of general interest. Examples would be hints, clever 
	   tricks and mistakes encountered during the use of the Yohkoh SW system.
	   As these might get automatically included in a newsletter without editing, 
	   please keep these  brief and to the point.
	\end{itemize}
\end{enumerate}

Submissions may be made through the use of the one line command
\footnote{Requires Yohkoh SW Version 931108.02 or higher}:
%
\ultrixinputa{ys\_contrib  files [README] [/ysmod]}

\begin{verbatim}
   Where: files   = SW source, tar or compressed tar file
          README  = optional special announcement or description (file) 
          /ysmod  = flag modifications to existing/distributed Yohkoh SW
\end{verbatim}

Some examples are:
%
\ultrixinputa{ys\_contrib stepper.pro /ysmod}
\ultrixinputb{ys\_contrib spec\_fitter.pro spec\_filter2.pro}
\ultrixinputb{ys\_contrib HINTS}
\ultrixinputb{ys\_contrib local\_lib.tar}
%
On remote machines, this command (Unix alias) will execute a set of script files which
\IItem
\item connects to anonymous FTP account on the master host
\item create subdirectory pub/swmaint/contrib/{\it node}/{\it user}
\item ``FTP puts'' the remote files
\item sends mail to software account and {\it user}@{\it node} announcing new contribution
\end{itemize}

On ISAS local machines, it checks to see if the person has a /ys/ucon/soft
directory and copies it there if it exists.  If not, it follows the steps
shown above for remote machines.

A cron job running on the SW master will monitor the activity of the user 
contribution area. It would perform any decompression and tar extraction 
required (.Z and .tar files) and sends mail to the Yohkoh SW managers 
if contributions sit around too long without access.  Possible disposition 
of contributed items include:
\IItem
\item move to \$ys (atest or ucon) area as appropriate
\item delegate review and modification, then mv to \$ys
\item reject/delete
\item e-mail to {\it user}@{\it node} notifying
\end{itemize}

Contributed File Name Conventions - the following restrictions apply.

\begin{verbatim}
File Type               Required Name

tar                     <name>.tar
compressed              <name>.Z
compressed-tar          <name>.tar.Z
idl source code         <routine>.pro 
\end{verbatim}

If $<$routine$>$ is a correction or an enhancement of an existing routine,
then the file name must be identical to the existing routine which it
corrects or modifies.  If filename is HINTS, it is assumed to be
``non-software'' and may get included in newsletter verbatim. 

         % \section{How to Contribute Software to the Yohkoh System}

\newpage %------------------------------------------------------------------------
\section{Institutes and Nodes with the Yohkoh Package}

\subsection{List of Institutes}

The following are a list of the Yohkoh principle investigator and
co-investigator sites which have the Yohkoh software and database
package.  The node names and a contact person are listed.
\index{sites with Yohkoh package}
\index{Yohkoh package, sites}
\index{software sites}
\index{installation sites}

\vspace{0.2in}\begin{tabular}{|p{3.0in}|p{1.5in}|l|} \hline
{Institute}				& {Computer Nodes}	& {Contact Person} \\ \hline
   {Institute of Space and }		& {isass0 thru isass4}	& {Freeland}\\
   {Astronautical Sciences (ISAS)}	& {flare1 thru flare12}	& {Shimizu}\\
   { }					& {isasxa thru isasxc}	& {Bentley}\\
   { }					& {isass6}		& {Hudson}\\ \hline
{Lockheed Palo Alto Research }		& {sxt0 thru sxt6, sag}	& {Freeland}\\
   {Laboratory (LPARL)}			&			& \\ \hline
{Montana State University}		& {sxt4, msusxt6}	& {Acton} \\ \hline
{University of Hawaii}			& {akala, akoko, maile}	& {Canfield} \\ 
    { }					& {hau, iliahi, wiliwili} & \\ \hline
{University of California, Berkeley}	& {sunspot}		& {McTiernan} \\ \hline
{Stanford University}			& {flare, panache}	& {Klimchuk} \\ \hline
{Solar Physics Research }		& {noao}		& {Harvey} \\
   {Corporation (SPRC)}			&			& \\ \hline
{National Astronautical Observatory} 	& {spot}		& {Tsuneta} \\
   {of Japan (NAOJ)}			&			& \\ \hline
{University of Tokyo}			& {neptune}		& {Khan} \\ \hline
{Mullard Space Science }		& {MSSL Cluster}	& {Bentley} \\
   {Laborartory (MSSL)}			&			& \\ \hline
{Rutherford Appleton}			& {solg1,RLSAC?}	& {Phillips} \\ 
   {Laboratory (RAL) }			&			& \\ \hline
{Naval Research Laboratory (NRL)}	& {aspen,dogwood,sola}	& {Mariska} \\ 
    { }					& {solb} & \\ \hline
\end{tabular}\vspace{0.2in}

This next table shows the various other institutions which are not primary or
co-investigator institutions and which have the Yohkoh package.

\vspace{0.2in}\begin{tabular}{|p{3.0in}|p{1.5in}|l|} \hline
{University of Alabama at Huntsville}	& {nessie}		& {Mariska (NRL)} \\ \hline
{University of Birmingham}		& {??}			& {Simnett} \\ \hline
{Solar Data Analysis Center (GSFC)}	& {umbra,sdac}		& {Gurman,Zarro} \\ \hline
{California Institute of Technology}	& {sundog}		& {Zirin,Lim} \\ \hline
{NSSDC (GSFC)}				& {??}			& {Batchelor} \\ \hline
{Marshall Space Flight Center}		& {golem, golem2}	& {Porter} \\ \hline
{University of Glasgow}			& {astro?}		& {Norman?} \\ \hline
{Harvard-Smithsonian Center for}	& {darmok?}		& {Kline?} \\
    {Astrophysics}			& 			& \\ \hline
{National Center for Atmospheric }	& {riker}		& {Stanger} \\
    {Research (NCAR/HAO)}		&			& \\ \hline
{Harvard University}			& daystrom		& {Bookbinder} \\ \hline
{Stanford University}			& quake, kilohoku	& {Milford,Gethyn} \\ \hline
{Space Environment Laboratory, NOAA}	& seldmc,sunspot	& {McAllister,Bornmann}	\\ \hline

{Department of Astronomy, Kyoto}	& {??}			& {Kawai} \\ 
    {University}			& 			&  \\ \hline
{Geophysical Institute, Kyoto}		& {step4ku}		& {Yatagai} \\
    {Unversity}				& 			&  \\ \hline
{CRL - Akioka}				& {planet}		& {Akioka} \\ \hline
{CRL - Marubashi?}			& {??}			& {??} \\ \hline
{Shibaura? Institute of Technology}	& {ogwl}		& {Sabah} \\ \hline
{Nagoya ?}				& {??}			& {Kato} \\ \hline
{Nobeyama ?}				& {??}			& {??} \\ \hline
{Astronomical Institute, Czech Republic} & {147.231.24.1}	& {Farnik} \\ \hline
\end{tabular}


\subsection{List of Node Names and Numbers}

A list of the most of the computer nodes which have the Yohkoh software
is listed here.  To verify that the lists are accurate, we recommend 
logging into sxt, isass0 or flare2 and looking at the file {\tt /etc/hosts}.
\index{network addresses}
\index{addresses, network}
\index{node numbers, addresses}

\begin{verbatim}
           DECNET             Internet                          Machine

SAG      24.131   192.68.162.134 (sag.space.lockheed.com)   DEC-VMS
SXT      24.134   192.68.162.107 (sxt.space.lockheed.com)   SGI-Unix
SXT1     24.362   192.68.162.100 (sxt1.space.lockheed.com)  DEC-Ultrix
SXT2     24.365   192.68.162.109 (sxt2.space.lockheed.com)  DEC-Ultrix
SXT3     24.366   192.68.162.110 (sxt3.space.lockheed.com)  DEC-Ultrix
SXT4              192.31.215.58  (sxt4.oscs.montana.edu)    DEC-Ultrix
SXT6              192.68.162.158 (sxt6.space.lockheed.com)  DEC-Ultrix

spot              133.40.2.120 (spot.mtk.nao.ac.jp)         SUN
neptune           133.11.3.23  (neptune.astron.s.u-tokyo.ac.jp) SUN

ISASS0   40.932   133.74.8.100 (isass0.solar.isas.ac.jp)    DEC-Ultrix
ISASS1   40.933   133.74.8.101 (isass1.solar.isas.ac.jp)    DEC-Ultrix
ISASS2   40.934   133.74.8.102 (isass2.solar.isas.ac.jp)    DEC-Ultrix
ISASS3   40.935   133.74.8.103 (isass3.solar.isas.ac.jp)    DEC-Ultrix
ISASS4   40.936   133.74.8.104 (isass4.solar.isas.ac.jp)    DEC-Ultrix
ISASS6            133.74.8.106 (isass6.solar.isas.ac.jp)    SUN

ISASXA   40.927   133.74.8.110 (isasxa.solar.isas.ac.jp)    DEC-VMS
ISASXB   40.928                                             DEC-VMS
ISASXC   40.929                                             DEC-VMS

FLARE1            133.74.8.1   (flare1.solar.isas.ac.jp)    SUN
FLARE2            133.74.8.7   (flare2.solar.isas.ac.jp)    SUN
FLARE3            133.74.8.3   (flare3.solar.isas.ac.jp)    SUN
FLARE4            133.74.8.4   (flare4.solar.isas.ac.jp)    SUN
FLARE5            133.74.12.94                              SUN
FLARE6            133.74.8.6   (flare6.solar.isas.ac.jp)    SUN
FLARE7            133.74.8.87  (flare7.solar.isas.ac.jp)    MIPS
FLARE8            133.74.8.88  (flare8.solar.isas.ac.jp)    MIPS
FLARE9            133.74.8.89  (flare9.solar.isas.ac.jp)    MIPS
FLARE10           133.74.8.90  (flare10.solar.isas.ac.jp)   MIPS
FLARE11           133.74.8.91  (flare11.solar.isas.ac.jp)   MIPS
FLARE12           133.74.8.92  (flare12.solar.isas.ac.jp)   MIPS
FLARE13           133.74.8.93  (flare13.solar.isas.ac.jp)   MIPS
FLARE14           133.74.8.94  (flare14.solar.isas.ac.jp)   MIPS
FLARE15           133.74.8.95  (flare15.solar.isas.ac.jp)   MIPS

MSSL     19.253                                             DEC-VMS
MSSLV1            128.40.70.62 (msslv1.mssl.ucl.ac.uk)      VMS-4000
MSSLV2            128.40.70.63 (msslv2.mssl.ucl.ac.uk)      VMS-4000
MSSLVB            128.40.70.70 (msslvb.mssl.ucl.ac.uk)      VMS-3100
MSSLA1            128.40.70.58 (mssla1.mssl.ucl.ac.uk)      VMS-3000

ssd0              128.60.8.1    (ssd0.nrl.navy.mil)         VAX
aspen             128.60.8.72   (aspen.nrl.navy.mil)        SUN
dogwood           128.60.108.102 (dogwood.nrl.navy.mil)     SUN
sola              128.60.8.41   (sola.nrl.navy.mil)         SUN
solb              128.60.8.42   (solb.nrl.navy.mil)         SUN
nessie            146.229.9.11  (nessie.optics.uah.edu)     SUN
koa               128.171.167.1 (koa.ifa.hawaii.edu)        SUN?
mamane            128.171.2.2   (mamane.ifa.hawaii.edu)     SUN
sunspot                         (sunspot.ssl.berkeley.edu)  SUN?
star              36.10.0.5     (star.stanford.edu)         ???
flare             36.14.0.166   (flare.stanford.edu)        DEC-Ultrix
panache           36.14.0.51    (panache.stanford.edu)      DEC-Ultrix
ogwl                            (ogwl.se.shibaura-it.ac.jp) ???
setp4ku                         (step4ku.kugi.kyoto-u.ac.jp) SUN

riker                           (riker.hao.ucar.edu)        SGI
darmok                          (darmok.harvard.edu)        ???
astro                           (astro.glasgow.ac.uk)       ???
sundog   14.905   131.215.139.154 (sundog.caltech.edu)      VMS
umbra             128.183.57.24 (UMBRA.gsfc.nasa.gov)       DEC-Ultrix

NOTE: To go from DECNET xx.yyy convention to the single node number
notation, take the xx portion, multiply by 1024, and add `yyy'.  
So SAG becomes 24*1024 + 131 = 24707:: 
\end{verbatim}


\newpage %------------------------------------------------------------------------
\section{Accessing the University of Hawaii SPAM Database}
\index{SPAM database}\index{Hawaii SPAM database}\index{meat, Hawaiian delicacy}

Mees Solar Observatory (MSO) is located on Haleakala, Maui, at 165E
longitude and 20N latitude.  MSO instrument operation hours vary from
1800-0300 UT in December to 1630-0400 UT in June.  A searchable catalog
called SPAM (Spectroscopy and Polarimetry at Mees) contains MSO data logs
(not data).  Some MSO data are available on line.  Other MSO data can be
obtained through the Data Use Coordinator, canfield@mamane.ifa.hawaii.edu.

SPAM logs (and searchable attributes, in addition to date, day of year,
and time) include:  MSO Log (instrument, NOAA AR, data type, observing
setup), SEL Event List (NOAA AR, X-ray Class), SEL Region Report (NOAA
AR), Yohkoh Orbit Summary, Yohkoh SXT Quiet Mode PFI Observations
(latitude, longitude, X-ray and optical image size), Yohkoh Flare
Observations (latitude, longitude, specific channel counts or ratios).
SPAM runs on a Sun Unix workstation at MSO, and is available over
Internet.  Simply access (e.g., telnet) koa.ifa.hawaii.edu (128.171.167.1)
from any vt100, Sun, or xterm emulator.  Log on as spam (lower case);
there is no password.  New users are asked to read release notes and
hints.

Vector magnetograms from the MSO Stokes Polarimeter are available on line
for about a month after acquisition.  These data are available by
anonymous ftp over Internet.  Use ftp koa.ifa.hawaii.edu, log in as
anonymous, provide your name as the password, and then respond to the ftp
prompt with cd pub/stokes.  Use get to obtain a copy of the README file
for further information and conditions for data use.

\newpage %------------------------------------------------------------------------
\section{Accessing the Optical Solar Data of NAOJ}
\index{NAOJ software}\index{software, NAOJ}

\begin{verbatim}

1. Introduction

This document describes how to make access to various optical data of
the sun obtained at the National Astronomical Observatory of Japan (NAOJ).
>From workstations which support the X-window and are connected to NAOJ via
network, you may log-in to our workstation

     'spot' (spot.mtk.nao.ac.jp, IP-address=133.40.2.120),

under the username 'guest'. The password can be obtained by sending
an e-mail request to either one of the following.

     sakurai@spot.mtk.nao.ac.jp (T.Sakurai)
     ichimoto@spot.mtk.nao.ac.jp (K.Ichimoto)

For remote users it would be more convenient to transfer the data and
the software to your own workstation and run the software locally. 
The IDL package should be installed on your workstation. Files can
be transferred by anonymous ftp on 'spot'. After you are connected to
'spot' via ftp, enter 'anonymous' as the username. For password prompt,
you are requested to enter your name, which will be recorded.

These data can be utilized freely in your data analysis. If you write
a paper or give a talk by using these data, you are requested to consult
with us in terms of co-authorship. 

For technical details, please contact:
	Norikura heliograms/filtergrams          : K.Ichimoto, K.Kumagai
	Flare Telescope magnetograms/Dopplergrams: K.Ichimoto, T.Sakurai
	Okayama magnetograms                     : T.Sakurai
	H-alpha full-disk images                 : Y.Suematsu, N.Tanaka
These people can be accessed by e-mail at <name>@spot.mtk.nao.ac.jp.

In any case, only representative data (a few images per day)
are provided on-line. Once you figure out that the data you are 
interested in are in archive tapes, you are encouraged to visit
NAOJ, recover the data from tapes, and make use of them.


2. Observing Instruments

This section briefly describes the sources of data, namely the optical
observing facilities currently being operated at NAOJ.

2.1  Mitaka Campus

(a) H-alpha flare patrol
    optics: 4cm refractor + Halle H-alpha filter
    field of view: full disk
    pixel size: 4"
    form of data: digital images of H-alpha line center
    image cadence: one minute
    recording media: digital audio tape

(b) The Solar Flare Telescope     
    This is made of four telescopes T1-T4.
    field of view: 340" x 320"
    pixel size: 0.66"
(T1) vector magnetograph
    optics: 20cm refractor + birefringent filter (band width=1/8A)
    form of data: digital I,Q,U,V intensities of Fe I 6303A line
    image cadence: 3 minutes
    recording media: digital audio tape
(T2) continuum telescope
    optics: 15cm refractor + broad-band filters
    form of data: analog images taken mostly at the wavelength of g-band
    image cadence: video rate
    recording media: SVHS video tape
    (tapes are recycled unless no notable events are found)
(T3) H-alpha telescope
    optics: 15cm refractor + Zeiss H-alpha filter
    form of data: analog images of H-alpha line center
    image cadence: 10 seconds
    recording media: laser video disk
(T4) Dopplergraph
    optics: 20cm refractor + birefringent filter (band width=1/5A)
    form of data: digital I,V,Doppler shifts of Fe I 6337A line
    image cadence: 3 minutes
    recording media: digital audio tape

(c) STEP Full-Disk Magnetograph (STEP=Solar Terrestrial Energy Program)
    20cm heliostat + 6cm refractor + birefringent filter
    field of view: full disk
    pixel size: 5"
    form of data: digital I,V,Doppler shifts of Fe I 5324A line
    image cadence: (the instrument is now under testing)
    recording media: digital audio tape

2.2  Norikura Coronagraph Station

(a) Automated Digital Coronagraph
    optics: 10cm coronagraph + interference filters
    field of view: 2600" x 2400"
    pixel size: 5"
    form of data: digital images of the corona in the following wave bands
         wavelength               band width
         5303A                    3A
         He D3                    4A
         H-alpha                  3A
         continuum at 6630A       21A
    image cadence: 3 minutes
    recording media: digital audio tape

(b) Spectroheliographic Observations
    optics: 25cm coronagraph + Littrow spectrograph
    raster area: four swaths of 500" wide (2.5" step)
                 synthesis of full disk maps is made after the observation
    spectral coverage: 2A (0.2A x 10 wavelength points)
    form of data: digital spectroheliogram of He I 10830A
    image cadence: one map per day (one raster scan takes 30 minutes)
    recording media: optical disk

2.3 Okayama Observatory
    optics: 65cm reflector + Littrow spectrograph + photoelectric magnetograph
    raster area: 500" x 450" (10" step) or 420" x 390" (6" step)
    spectral coverage: 27-80mA from the center of 5250A line
               (detectors are photomultipliers; no wavelength resolution)
    form of data: digital I,Q,U,V,Doppler shifts of Fe I 5250A
    image cadence: a few maps per day (one raster scan takes one hour)
    recording media: magnetic tape and magneto-optical disk

The data available on-line are:
	part of Mitaka H-alpha full-disk images (2.1a), 
	part of Flare Telescope vector magnetograms (2.1b-T1),
	all of Norikura He 10830 fill-disk heliograms (2.2b), and
	all of Okayama vector magnetograms (2.3).
Other data are archived in tapes in digital form, or recorded on analog media.


3. Browsing the Data by 'show'

After you log-in at 'spot' under the username 'guest', follow the instruction
shown on the banner message.  You simply type

	spot% show

and then enter your machine's IP-address after the prompt. An interactive,
menu-driven session on the X-window will start.
By using the mouse you first select from
      magnetic data of flare telescope
      Ha full disk image of Mitaka
      Norikura data (He10830, corona)
      Okayama magnetic data 
      exit
On all the menus, <return> means that you go back to the main menu, and
the 'show' program stops by selecting <exit>.

3.1 Flare Telescope Vector Magnetograms

The data have names 'fbyymmdd.hhmm', where yymmdd and hhmm designate,
respectively, the date and time in UT. By using the mouse, select the file
you want to see. When the menu is too big and is split into several pages, 
you may select 'next page' and the next page of the file list will
be shown. The other options control plotting styles and printer output.
	<contour>	: magnetogram in contour
	<spot+contour>	: magnetogram in contour, sunspots in gray scale
	<red-blue>	: magnetogram in red-blue, sunspots in contour
	<PostScript>	: make postscript output file
	<printout>	: print postscript file at a local printer at Mitaka
<PostScript> is only selectable after you have selected data to be displayed.
In order to transfer the postscipt file, use anonymous ftp. The contour plot 
is saved in 'tmp/magcont.ps' under the anonymous ftp directory.

After you exit, the data are stored in arrays: intensity map in 'img',
longitudinal magnetid field in 'Bl', and transverse magnetic fields in
'Bx,By'. The header h contains observing parameters. The magnetic data
are 2 byte integer in unit of 0.1 Gauss and each image has 256*240 pixels,
where a pixel corresponds to about 1.35 arcseconds.  The instrument tends to
saturate for magnetic fields stronger than about 1700 Gauss. The field
strength in large sunspots should be used with some caution.

The direction of the transverse magnetic field (i.e. the resolution of
the 180 degree ambiguity) is determined by referring to the potential field
calculated from the longitudinal magnetic field distribution. The direction
may not be correct in regions with high magnetic shear.

In order to obtain the observation status, type
	IDL> fstplot
and then choose yymmdd.

3.2 Mitaka Full-Disk H-alpha Images

The data have names 'hayymmdd.hhmm', where yymmdd and hhmm designate,
respectively, the date and time in UT. By using the mouse, select the file
you want to see. After you exit, the image data are stored in an array
'img', and the header h includes the observing parameters.

3.3 Norikura Spectroheliograms

In the 'Norikura' menu ( He10830, corona ) you should select He10830.
The other entry is not yet implemented.  The data have names 'heyymmdd.hhmm',
where yymmdd and hhmm designate, respectively, the date and time in UT.
The data names followed by '.v' are Doppler images. By using the mouse, select
the file you want to see. After you exit, the image data are stored in an array
'img', and the header h includes the observing parameters.

3.4 Okayama Vector Magnetograms

First you select the year (1982 - ), and the file list appears.
The data have names 'ymddn.D', where y is a letter indicating the year
(B=1982, C=1983, ,,, M=1993), m indicates the month (1=Jan, ,, 9=Sept,
A=Oct, B=Nov, C=Dec), dd is the date, and n=A,B,C,,, are sequence
numbers of observation on the day. Then you are asked to enter
several numbers from the keyboard as follows.

	obs.area    : 0=skip, 1=show: _
	     (location of the observed area on the sun)
	halftone map: 0=skip, 1=    I, 2=   BL, 3=   VL: _
	contour map : 0=skip, 1=    I, 2=   BL, 3=   VL: _
	vector map  : 0=skip, 1=(   BX,   BY): _

Here I is the intensity map, BL is the longitudinal magnetogram, VL
is the Doppler map, and (BX,BY) are the transverse field vectors. If 0 is
entered, the corresponding map is not shown. If the potential field lines
had been computed and stored in a file 'ymddn.L', you will be asked:
	field lines : 0=skip, 1=show : _

At the next prompt
	1=plot again, 2=hardcopy, 9=exit > : _
you can plot the map in a different style by selecting 1. The postscript
output file will be created if you select 2. The postscript file can
be later transferred by anonymous ftp.

After you exit, the data are stored in a floating array 'rdata', 
and the structure 'mparam' contains observing parameters. 
The 'mparam.status' includes fields such as
	i, q,u,v, bx,by,bl,,,,.
If for example the data By are stored in rdata(*,*,2), mparam.status.by
takes the value 2. In order to know which part of rdata contain valid
data, type
	IDL> help,/st,mparam.status
The data whose status value is -1 are not stored in rdata array.

The electric current distribution can be seen by typing
	IDL> .run jn
	IDL> magplot, mparam, rdata, /nomenu
Then you will see the following prompt.

	obs.area    : 0=skip, 1=show: _
	halftone map: 0=skip, 1=    I, 2=  BLP, 3=   BL, 4=   VL, 5=   JN: _
	contour map : 0=skip, 1=    I, 2=  BLP, 3=   BL, 4=   VL, 5=   JN: _
	vector map  : 0=skip, 1=(  BXP,  BYP), 2=(   BX,   BY): _
	1=plot again, 2=hardcopy, 9=exit > : _

Here JN is the normal component of the electric currents, and the field 
components followed by P are those of the potential magnetic field.


4. Anonymous ftp Access to spot

When you are connected to 'spot' via anonymous ftp, under the home directory
you have directories

	flare                           : Flare Telescope magnetograms
	         - log                  : Flare Telescope magnetograms
	monochro                        : H-alpha full-disk images
	norikura - he10830              : He10830 spectroheliograms
                 - corona
	okayama  - 1982                 : Okayama magnetograms
                 - ...
	doc                             : documents
	idlsoft                         : IDL routines

All the IDL routines used here are stored under 'idlsoft'. 
Compressed tar files of IDL software is provided as naojidl.tar.Z 
in the home directory. The 'doc' directory contains text files explaining
the software and the data analysis. 
The observation log files of the Flare Telescope are in /solar/flare/log.
The files 'yymmdd.log' give you the time and the observing region
for all data on the day. The files 'lv##.log' contain list of H-alpha
video disk recordings of the Flare Telescope T3.
     

5. Description of the Software

The 'show' program assumes the directory structure of NAOJ workstations.
Therefore, when you want to display and analyse the data obtained via ftp,
you have to invoke lower-level IDL routines. 

5.1 Flare Telescope Vector Magnetograms

To read a file named 'fbyymmdd.hhmm' and store the data into img,Bx,By,Bl:
	IDL> f1data, 'fbyymmdd.hhmm', h, img, Bx, By, Bl

Or an interactive program can be invoked by
	IDL> .run fdisp 

The map can be displayed by
	IDL> magtv1, h=h, img, Bx, By, Bl
or
	IDL> magtv2, h=h, img, Bx, By, Bl
or
	IDL> magcont, h=h, img, Bx, By, Bl

To calculate and display electric current distribution:
	IDL> .run jnft1
(The data should exist in h,img,Bx,By,Bl.)

5.2 Mitaka H-alpha Images and Norikura He10830 Heliograms

To read a file and store the image into 'img':
	IDL> nkrget, <filename>, h, img   

To display:
	IDL> tvscl, img

5.3 Okayama Vector Magnetograms

To read a magnetogram file:
	IDL> readm, mparam, rdata, filename=<filename>

To display magnetograms and potential field lines:
	IDL> magplot, mparam, rdata, /nomenu

To calculate and display electric current distribution:
(The data should exist in mparam and rdata.)
	IDL> .run jn

\end{verbatim}

\newpage %------------------------------------------------------------------------

\section{Using the Laser Disk System at ISAS}

\subsection{Viewing Existing Movies (VIDEO\_MENU)}\label{video_menu}
\index{laser video}
\index{video}

This program provides interactive computer controlled viewing of
the library of movie sequences recorded on the ISAS SONY laser
disks.  The user must be logged on to the isass3 computer (remote
logon from another ISAS workstation is fine) in order to use the SONY laser disk player.

To run the software the user must log on to isass3.  The calling sequence
is:
%
\idlinputa{video\_menu}\index{VIDEO\_MENU}
%
The user is prompted to check for
the proper settings on the SONY disk drive, and then a listing is
displayed from which the user selects a movie sequence for display.
Upon selection the sequence is played repeatedly.  While the
sequence is playing the user may adjust the speed by keyboard input.
The user may interrupt the movie at any time and return to the menu.
The library of available movie sequences is updated manually as movies 
are recorded on the SONY, so the listing could be out of date.  

In addition to this basic mode, VIDEO\_MENU may be called with
a keyword {\it vcr} set which allows non-interactive playing of frame
sequences specified in an input file.  This mode of operation is
convenient for demonstrations and for making video tape copies of
selected sequences of movies.

The centerpiece of the laser disk movie
catalogue is the full disk movie which covers the duration of the
mission.  However, there are over 100 entries in the menu, corresponding
to a variety of interesting sequences showing flares, large scale
coronal transients, and theoretical modeling.

\subsection{Making Title Pages}
\label{laser_titles}

The video title pages may be prepared by using an IDL program called
VIDEO\_TITLE{}.  First, you must prepare an ASCII control file that
specifies what the title pages should contain.  The IDL routine reads
this file and writes the text to a Z-buffer window (using ordinary
XYOUTS commands) and then reads it back into an array that can be
stored in a {\tt *.genx} file.  The font type and size and placement
can be easily adjusted.  
Some example calls are:
%
\idlinputa{array = video\_title(filename)}\index{\VIDEO\_TITLE}
\idlinputB{3.5}{array = video\_title(filename,/plot)	}{; Display the results}
\idlinputb{array = video\_title(filename,/plot,outfile='video1',/high)}
\idlinputb{array = video\_title(filename,/plot,outfile='video1')}
%
The variable $filename$ specifies the name of an ASCII control
file that contains the text of the page.  For example try the
following:
%
\idlinputa{array = video\_title('/ys/gen/doc/howto\_video\_title.doc',/plot)}
%
where {\tt /ys/gen/doc/howto\_video\_title.doc} is the name of a
``how to" file which is also an example control file.  This file
explains the format of the control file.  For the first time users,
it is recommended to copy that file over and make changes to it to
accommodate your needs.

The control file specifies the position on the screen, the text, the size
and thickness of the characters.  Different fonts can be used also.
A portion of that file is shown here:

\begin{verbatim}
;  howto_video_title.doc                J. R. Lemen  Rev A,  4-Jan-94
;
;  The control file contains 5 items per line separated by a double
;  slash or "//".   The first and second fields are the positions in
;  the 620 by 480 sized video window (0,0 is the lower left corner).
;  It is advisable not to write too close to any edge, since the
;  text may be lost, depending on the display monitor.  Setting xpos
;  equal to -1 will cause the text to be automatically centered (and
;  leading or trailing blanks will be discarded).  The third field
;  is the text and the fourth and fifth fields are the character
;  size and thickness, respectively.
;
;  The Fonts can be changed using the standard !n IDL vector commands
;  (see the example below).
;
;  This entire document is an example control file (since every line
;  except the important ones below begin with an ";").  Below the
;  dashed line is a specific example.  This file will cause two
;  pages to be generated (because of the NEWPAGE// line).  It is not
;  necessary to have more than one title page per file.
;
; ------------------------------------------------------------------
;  Semicolons are treated as comments
;  Separate fields with //
;  xpos // ypos // Text // size // thickness
;  (size and thickness will default to 1.0 if omitted)
;  (setting xpos to -1 will cause x position to auto-center)
-1//425//X-RAY CORONA OF THE SUN                           //2.8//2.8
-1//375//Images from the Soft X-ray Telescope              //2.1//1.4
-1//345//on the YOHKOH mission                             //2.1//1.4
-1//275//Data from:  November 11 to 27, 1991               //2.1//1.4
-1//220//!8Prepared by:                                    //2.1//1.4
-1//190//J. Lemen, G. Slater, K. Strong, and S. Tsuneta    //1.7//1.7
-1//100//Institute for Astronautical Research, Japan       //1.4/1.4
-1// 75//National Aeronautics and Space Administration, USA//1.4//1.4
-1// 30//(V1.0 13 April 1992)//1.4
NEWPAGE//
-1//300//Data from:  November 11 to 27, 1991               //2.1//1.4
-1//200//!18Displayed 100,000 times real time              //2.1//1.4

\end{verbatim}

The {\it /high} switch makes the routine run slow, but gives a higher
quality result.  It is recommended to debug the output without the
{\it /high} switch and only use it for the final result. 

The $outfile=$ switch will cause the title pages to be written to
a {\tt *.genx} file that can be written to the ISAS Sony Laser disk
using GO\_NVS5{}.  If you want the background color to be blue,
make sure that you specify color table 1 in GO\_NVS5{}.

\subsection{Recording a New Movie to Laser Disk}

\subsubsection{Hardware: Positioning the Sony Laser Disk}

\begin{enumerate}
\item Check that the green light on the NVS is on.  Power cycle if necessary.
\item Check that the RS-232 cable is connected from the NVS to the Sony LVR-5000.
\item Make sure the correct optical disk is inserted (check side A or B).
\item Put the `LOCAL/REMOTE' switch in the local position.
\item Depress the `REC STANDBY' button to initiate blank frame check.
This will find positions of all blank areas on the disk.  
When completed, the disk will be positioned to the last recorded
frame before the nearest (not necessary the first) blank frame.
\item Use the record `SKIP' buttons to position the laser disk to the last 
recorded frame before the desired starting frame number (consult the
Sony Laser disk log book).  On the display, Cont. Rec = is the last
recorded frame before the blank frame; DUR = number of blank frames.
\item Toggle the format of the numbers displayed to show the time-format.  
Record numbers in the log book.   To start over, press the `CLEAR' button.
\item Set the left console switch to `remote'.
\end{enumerate}

\subsubsection{Software}

\EEnumerate
\item Login onto a non-isass0 machine (isass1-4).  

\item Enter IDL.  Make sure no other IDL window jobs are running on the same
workstation.  If there are two jobs, the color table could be corrupted.

\item Then enter one of the following:
\end{enumerate}
~\\
%
\idlinputA{3}{go\_nvs5,/sfd           }{; Standard weekly movie making}	\index{GO\_NVS5}
\idlinputB{3}{go\_nvs5,/sfd,/nosfw    }{; Standard weekly movie making}
\idlinputB{3}{go\_nvs5,/help          }{; For on-line documentation}
\idlinputB{3}{go\_nvs5,/genx          }{; to use a GENX type file as the input}
%
The temporary NVS files will be written to your home directory.
Use the nvsdirfn='/1p/user/nvs0' switch to redirect to another location.

For the SFD option, the default increment is 10 (process 10 images at a time).  
This is good if no one else is using the
workstation at the same time.
If the  /sfd switch is given, go\_nvs5 will prompt the user with the list of
files which are in the /yd1/sfd directory.

For the GENX option, the array will not be autoscaled (it should be a byte
type).  If the number of images in the genx file is large, IDL may run out of core.
In that case, try increment=1.  The program will prompt the user for the 
GENX filename.

\subsubsection{Adding Another Movie}

The above procedure is for starting from scratch.  If you have just completed
a run and the Sony frame number has not been changed, then just type:
%
\idlinputa{go\_nvs5 [,/sfd]}
%
to make the next movie.

\subsubsection{NVS/Sony Problems}

\IItem
\item Invalid Num -- If the message `Invalid Num' appears on the display
monitor, the nvs box is not in sync with the Sony laser disk.  To
correct this situation begin with a blank frame check (see
above hardware procedure) and follow that with software procedure shown above.

\item One common problem is to forget to attach the RS-232 cable.  This is
sometimes switched to ISASS3 to control the recorder during playback 
to record with the VCR).

\item How to toggle the format frame/time format:  depress the frame/time 
button located on the lower-left side of the console number keypad--where 
frame \# is a simple number and time has the format of mm:ss:ff.
\end{itemize}

\subsection{Transferring a Movie to VCR Video} \index{MK\_VCR}\label{mk_vcr} \index{video}	%-----------------------------
\index{VCR, making movie}

MK\_VCR is an IDL procedure which can be used to control the Sony Laserdisk
recorder.  In this way sequences can be displayed easily in order to make
VCR video recordings.

The MK\_VCR procedure reads an ASCII file (described) below and then calls 
sonyloop to actually control the laser disk player. 

\subsubsection{Initial setup}

\EEnumerate
\item First, make sure the RS-232 cable from isass3 is connected to the back
of the Sony recorder (it requires an adapter connector).  

\item Switch the local/remote switch to remote.

\item Log on to isass3 and enter IDL.  
\end{enumerate}

\subsubsection{Short test of hardware communications.}

You can preform a simple test to see if things are working correctly
by typing:
%
\idlinputA{3}{sonyloop,6000		}{; Position laser disk to frame number 6000}
\idlinputB{3}{sonyloop,6000,6200	}{; Play from 6000 to 6200 at normal speed}
\idlinputC{3}{sonyloop,6000,6200,sec=2	}{; Play a factor of 2 slower}
%

\subsubsection{Running MK\_VCR}

If things look like they are working correctly, you can then try mk\_vcr.
To get a template of the file the mk\_vcr will read, execute the following
Unix command to copy the example file to your own directory:
%
\ultrixinputa{cp /ys/gen/data/mk\_vcr\_example.txt .}
%
After you copy the example file, do the following.  Insert Side B of the 
laser optical disk. Then,
%
\idlinputa{mk\_vcr,'mk\_vcr\_example.txt',1,3}
%
which execute lines 1 to 3 of the file.  (Line 0 puts up a blank frame).
If you type 
%
\idlinputa{mk\_vcr,'mk\_vcr\_example.txt}
%
the routine will inform you of the number of lines in the file and
ask you to enter the start and stop line numbers.

If you want to make a movie, you could try the following IDL program:
%
\idlinputA{4}{sonyloop,8000            				}{;Get it to a blank frame}
\idlinputB{4}{for i=0,2 do mk\_vcr,'mk\_vcr\_example.txt',0,23	}{;There are 24 lines in the file}
\idlinputB{4}{sonyloop,8000                   			}{;End on a blank frame}
\idlinputB{4}{end }{}
%
As you can see, the sequence in the `for loop' will execute 3 times.  Each
time through takes about 7 minutes, so the whole movie will be just over
20 minutes in length.

\subsubsection{How to create/modify the file that MK\_VCR uses}

The file has some descriptions about how to change it.  Basically,
the lines in the file look like the following:

\begin{verbatim}
 8000				; Position to a blank frame (provide leader)
 6077, 6077,    4,    0, [ -1  0  0  0] "Movie Title Page"
 6078, 6078,    2,    1, [ -1  0  0  0] "Nov 1991 Movie - Title"
 5048, 5225,    2,    1, [  1  2  1 -1] "Nov 1991 Movie"
; c0    c1      c2    c3       [c4]         "  c5   "
\end{verbatim}

The above sequence will display the Nov 91 press release sequence if Side B
is inserted.  Some notes about the format:

\IItem
\item Text following a `:' is considered to be a comment.
\item Only the first column is required.  All subsequent columns are optional.
\item c0 is starting frame number.
\item c1 is the ending frame number.
\item c2 is the wait (in sec) after displaying the first frame
\item c3 is the wait (in sec) after displaying the last frame
\item c4: The number in the boxes are the speeds that are used by sonyloop.
Up to four different speeds can be specified. 
\end{itemize}
\begin{verbatim}
      0 is no operation
      1 is normal speed (30 frames per second)
      2 is twice slower (15 frames per second)
      3 is 3x slower, etc (10 frames per second)
      -2 is 3x faster.
\end{verbatim}

If a fifth parameter is specified in the brackets, it is a repeat number.
If this number is negative, sonyloop will play the sequence forward
and backward.  For example,

\begin{verbatim}
 5048, 5225, 2,  1, [  1  0  0  0  1] "Nov 1991 Movie" ;1 time forward
 5048, 5225, 2,  1, [  1  0  0  0 -1] "Nov 1991 Movie" ;1 time forward/backward
 5048, 5225, 2,  1, [  1  0  0  0 -3] "Nov 1991 Movie" ;3 times forward/backward
\end{verbatim}

SPECIAL NOTES:
\begin{itemize}
\item Sonyloop doesn't send the correct commands to the Sony Laser Recorder
        to go backwards.  Thus, no matter what speed you specify, it always
        goes at normal speed in reverse.  (Maybe a Japanese reader can study
        the manual and fix this problem).

\item Sonyloop tries to compute the time it will take the laser disk recorder
        to play the specified sequence.  Because the timings in IDL can be
        off by a certain amount (less than or equal to about a second), it is
        wise to make one of the wait parameters (c2 or c3) equal to at least
        1.  If they are set to 0, IDL will sometimes send the next sequence
        before the previous sequence has had a chance to complete.
\end{itemize}

\newpage %------------------------------------------------------------------------
\section{Using the Laser Disk System at LPARL}

The following is a guide to record and play laser disk movies at LPARL.

\subsection{Viewing Existing Movies}

\subsubsection{Using IDL and Menu Driven Software}

The program VIDEO\_MENU described in section~\ref{video_menu} is not available
at LPARL during the writing of this guide, however it may exist now.  See one of
the software engineers to see if it is available.

\subsubsection{Displaying a Single Recorded Image}

\begin{center} {A. Manual Operation} \end{center}

The Panasonic optical disk recorder/player and the Panasonic
optical disk player may be ``manually'' controlled by using either the
buttons on the front of each machine or the remote controllers.
These buttons and the remote controller are labeled in English
and are easily understood.

\begin{center} {B. IDL Operation} \end{center}

\EEnumerate
\item Log onto sxt0 on any terminal
\item Enter IDL
\item Suppose you want to display frame 1000.  Here's the command:
	\idlinputd{pana,1000}
\end{enumerate}

\subsubsection{Playing the Panasonic Laser Disks}

\begin{center} {A. Manual Operation} \end{center}

The Panasonic optical disk recorder/player and the Panasonic
optical disk player may be played ``manually'' by using either the
buttons on the front of each machine or the remote controllers.
These buttons and the remote controller are labeled in English
and are easily understood.

\begin{center} {B. IDL Operation} \end{center}

\EEnumerate
\item Log onto sxt0 on any terminal
\item Enter IDL
\item Suppose you want to play frames 100 to 200 on the recorder for 10
repetitions at a rate of 90 frames per second.  Here's the command:
%
\idlinputa{movie\_pana,100,200,rate=10,num\_repeat=3}\index{MOVIE\_PANA}
%
\item The general command is
%
\idlinputa{movie\_pana,start\_frame,stop\_frame,device,device=device1,rate=rate, \$}
\idlinputbb{		   num\_repeat=num\_repeat,backforth=backforth}
%
   The device parameters should be ignored because at the present time
   there is only one available device, which is the default.  More
   information on this routine can be obtained with the command:
%
\idlinputa{doc\_library,'movie\_pana'}
\end{enumerate}

\subsection{Making Title Pages}

See the description in the previous chapter on page~\pageref{laser_titles} describing the laser disk 
system at ISAS.

\subsection{Recording a New Movie to Laser Disk}

\begin{enumerate}
\item Turn on power to Panasonic recorder and Sony monitor labeled
   `Laser Disk Recorder'.
\item Find the disk you want to record on (it may be in the recorder).
   Note that each disk has two sides.  The `up' side is the active
   side.  Note also that there is blue `write protect' sliding switch
   on the right side of each side of the disk.  Move this switch to its
   right hand position (`read/write') using a Bic pen or equivalent tool.
   Now insert the laser disk you want to record on into the recorder
   after first ejecting the disk already in there if there is one.
\item Log onto sxt0 on an X terminal 
\item Enter IDL
\item At the prompt do this:
%
\idlinputa{ptest}
%
   Look at the monitor.  If after a few seconds a test pattern appears
   the equipment is properly set up and you may proceed.  If no test
   pattern appears or if it looks unusual then something is wrong.  Refer
   to section IV on problems below.
\item Images may be recorded either from an SDA file or from a data cube
   resident in memory.  The images will be re-sized to fit within the
   630 x 486 size of the Peritek video image.  The re-sizing will use
   linear interpolation unless the /NOINTERP option is used,  By default
   they will be
   centered.  The images may be of any size.  If they are in a data cube
   then the entire cube will be normalized to its maximum value and byte
   scaled, unless the /NOSCALE keyword is used in the procedure call.
   If the images are in an SDA file the images must be pre-scaled by the
   user.  Decide on a color table.  A gray scale (IDL standard color table
   1) will be used by default.  If the color table desired is not one of
   the first 15 IDL standard color tables then you must supply r, g, and b
   color vectors.
\item Decide what frame on the laser disk you wish to start recording at.
   The IDL recording program will automatically find the first sufficiently
   large unrecorded area if you skip this step.
   To do this manually, type:
%
\idlinputa{command\_pana,'OF'}\index{COMMAND\_PANA}
%
   Type the `display' button on the remote controller to display the
   current frame number on the monitor.  Then use the remote controller to
   play or scan through the disk until you find the frame number at which
   you want to start recording.  Key the number of frames you wish
   to record using the keypad.  Then hit the red `rec mode' key.  This
   will verify that there are enough contiguous blank frames available
   following the selected frame.
\item Suppose you have the cube in a 3-D IDL array called DATA and the color
   vectors in the variables R,G, and B.  Here's how to record it:
%
\idlinputd{pana\_record,data,r=r,g=g,b=b,/record}
%
\item For recording images from an SDA file the call would be
%
\idlinputa{pana\_record,file\_name,r=r,g=g,b=b,/record}
%
   where file\_name is a string naming the SDA file, including path.
   More information on this routine can be obtained like this:
%
\idlinputa{doc\_library,'pana\_record'}
\end{enumerate}

\subsubsection{Panasonic Problems}

If no test image appears after issuing the PTEST command in the instructions
described in the previous section, then do these things:

\IItem
\item Make sure that the power switch on the back of the Peritek
       `clock box' is in the on position.  The clock box is located
       in the middle shelf of the SXT0 computer cabinet.
\item Check that the four gold colored video cables from the Peritek
       are connected to the RGB and sync terminals on the back of the
       recorder.
\end{itemize}

\subsection{Transferring a Movie to VCR Video}

As of the writing of this document, the routine MK\_VCR (which is described
on page~\pageref{mk_vcr}) was not available for the LPARL video system.  The
routine may be expanded in the future.  The best method for transferring a 
laser disk movie to VCR video is to talk to one of the LPARL software
engineers.

	% two chapters

\newpage %------------------------------------------------------------------------
\section{Using Magneto-Optical (MO) Disks at ISAS}\index{MO disks}\index{magneto-optical disks}

A complete archive of the Yohkoh data for the whole mission is available
on Magneto-Optical (MO) disks at ISAS.

A Unix script and associated alias is available to mount and dismount MO 
(magneto optical) disks at ISAS.  An IDL interface routine is also provided
to allow MO mounts and dismounts from within an IDL session or callable
from other IDL routines.  Once mounted, access to data on these drives is 
identical to other magnetic disks --- standard Unix operations (ex: ls) are 
permitted.  For MO disks containing Yohkoh data, the standard IDL functions 
(ex: yodat access) are available.

MO disks are available on several machines of the SUN machines at ISAS.
including flare3, flare4, flare6, flare13, flare14, flare15.  The first
(and in most case, only) MO drive on any machine is referred to as drive 0.
Some machines may have a second drive (drive 1) --- all drives are clearly
marked with a drive number. Find an available (empty) drive and insert
your disk --- if you intend to write, verify that the write protect switch
allows writing.  By default, the mount is executed on the machine which 
contains the MO driver.  If that machine is different than the machine 
which executes the command, then the MO disk is automatically 'exported' 
and mounted on the local machine.  Use the /all switch to force mounting
on all ISAS machines.

\subsection{Mounting MO Disks From Unix}

The alias {\it momount} executes the script which performs all MO operations.
Parameters and switches allow specification of machine name, drive number, 
access mode, dismounts, etc.  Options include {\it /write /umount /eject /1}
and {\it /all}.
Some sample calling sequences are:
%
\ultrixinputA{3}{momount flare13 			}{\# mount flare13 , drive 0, readonly}
\ultrixinputB{3}{momount flare13 /umount		}{\# dismount same}
\ultrixinputB{3}{momount flare4  /1 /write		}{\# mount flare4, drive 1, read/write}
\ultrixinputB{3}{momount flare4  /1 /eject		}{\# dismount and eject same}
\ultrixinputC{3}{momount flare15 /all			}{\# mount flare15, drive 0, on all nodes}

\subsection{Mounting MO Disks From IDL}

An IDL driver sets up the parameters and spawns a call to the same script
file described above to allow IDL MO control (interactive or via routine).
Keyword options similar to the Unix script are available with the IDL
routine.  Some examples are:
%
\idlinputA{3}{momount,'flare13'			}{; mount flare13 , drive 0, readonly}
\idlinputB{3}{momount,'flare13',/umount		}{; dismount same}
\idlinputB{3}{momount,'flare4', /one, /write	}{; mount flare4, drive 1, read/write}
\idlinputC{3}{momount,'flare4', /one, /eject    }{; dismount and eject same}

\newpage %------------------------------------------------------------------------
\section{Guidelines for Writing Distributed Software}

\subsection{Names of Routines}

The first concern is not to use a name that is already being used.
To check if the name exists on the /ys tree on an Ultrix machine, you can
use the symbol `chk\_name'.  Here is an example (note that the .PRO
portion is required):
%
\ultrixinputa{chk\_name yodat.pro}
%
On a VMS machine, the following command should work:
%
\vmsinputa{dir ys:[...]yodat.pro}
%
It is possible to do the search from within IDL on any of the 
machines using a command like:
%
\idlinputa{print, path\_lib('yodat')}	\index{PATH\_LIB}
\idlinputB{3}{print, path\_lib('yo*')  }{;for all routines beginning with `yo'}
\idlinputb{pr\_path\_lib, 'yo*'}
%
The second concern is use care when chosing the name.  It should not be
general enough to cause conflicts or confusion between all of the other
instrument teams.  For example, the original name of SXT\_DECOMP was
DECOMP.  Every instrument has a decompression routine, so the name of
the instrument needs to be incorporated in the name of the routine for
general routines.  The name of the routine should not be shorter than
four letters and less than 14 characters (so that IDL can
compile it properly).  Underscores are acceptable, and the file
name should be all lower case.

The GT\_ routines are a unique set of routines meant solely for the
extraction of data out of a Yohkoh data structure.  
Normally, routines should have the name GET\_ unless it is designed to 
extract data from one fo the Yohkoh data structures.

\subsection{Calling Sequence}

It is the desire to have the calling sequence be {\bf index,data} for
all routines that require the index and data.  Please try to avoid having
any calling sequence of the form {\it data,index}.

In general, positional parameters should be used for any input which is
required for the procedure.  Keyword parameters should be used for the
optional parameters.

\subsection{Standard Headers}

The following standard IDL should be included at the top of each routine.  It
can be found in the file \$DIR\_