%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%  DO NOT EDIT THIS FILE %%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%  DO NOT EDIT THIS FILE %%%%%%%%%%%%%%
%% The file that should be edited is "FCD_NOTIC.TEX" %
%%%%%%%%%%%%%%%%  DO NOT EDIT THIS FILE %%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%	(19-jul-1990)	--  Landscape Version
%
% ------------------------------------------------------------------------------
%
%	Beginning of the Macro Section
%	------------------------------
\special{ps: landscape}	% For the PostScript laser printer
\magnification=1200
%\hsize=6.25 true in				% Portrait Version Dimensions
%\vsize=8.5 true in				% Portrait Version Dimensions
\hsize=9.0 true in				% Landscape mode
\vsize=6.true in				% Should work for A4
\tolerance=5000 \hbadness=\tolerance
\voffset=2\baselineskip         		% Leave room for headline
\parskip=5pt plus 0.8pt \relax			% Inter-paragraph spacing
\def\today{\number\day\space\ifcase\month\or    % Put in today's date
     January\or February\or March\or April\or May\or June\or
     July\or August\or September\or
     October\or November\or December\fi ~\number\year}
%- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
%
%  \verbatim	
%
%  The next statements define the \verbatim macro.  The \verbatim macro allows
%  text which has been typed in to be printed exactly as it appears in the
%  input file.  The verbatim text is printed with the typewriter font at 10 
%  truept.
%
%  To use place, the text you want to be verbatim in between the \verbatim
%  and \endverbatim macros as in the following example: 
%
%  \verbatim  Text which you want to be verbatim  \endverbatim
%
%  The characters which are ignored are defined in the \dospecials macro.
%  Most of the active TeX commands will be ignored such as
%  	 _, <tab>, $, ^, %, }, and {.  
%  The backslash character \ and therefore should not be included.
%  -    -    -    -    -    -    -    -    -    -    -    -    -    -    -    -
\font\ttt=cmtt10 at 10truept
%%\font\ttt=amtt10 at 10truept
\def\dospecials{\do\ \do\{\do\}\do\$\do\&%
   \do\#\do\^\do\^^K\do\_\do\^^A\do\%\do\~}	%* End of \do
\def\uncatcodespecials{\def\do##1{\catcode`##1=12 }\dospecials}
   \def\setupverbatim{\ttt\baselineskip=12 truept% in \tt mode at 10pt
   \raggedbottom\parskip=0pt\parindent=0pt%
   \def\par{\leavevmode\egroup\box0\endgraf}%
   \obeylines\uncatcodespecials\obeyspaces%
   \catcode`\^^I=\active\everypar{\startbox}}	%* End of \setupverbatim
\newdimen\w\setbox0=\hbox{\ttt\space}\w=8\wd0% tab amount
\def\startbox{\setbox0=\hbox\bgroup}%		%* \Startbox macro
{\catcode`\^^I=\active
  \gdef^^I{\leavevmode\egroup
    \dimen0=\wd0 % the width so far, or since the previous tab
    \divide\dimen0 by \w
    \multiply\dimen0 by \w % compute previous multiple of \w
    \advance\dimen0 by \w  %advance to next multiple of \w
    \wd0=\dimen0 \box0 \startbox}}		%* End of new definition for ^^I
\def\verbatim{\begingroup\setupverbatim}	%* \verbatim definition
\def\endverbatim{\endgroup}			%* \endverbatim definition
%
%  End of \verbatim macro definitions
%- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
%  Headline macro
%
%  Headline is arrange as \line{\reporthead \hfil \sectionhead}
%
\newtoks\sectionhead \sectionhead={\hfil}	% Set up blank section header
\newtoks\reporthead  				% Set up Report header
\reporthead={\twelverm SOLAR-A FILE FORMAT CONTROL DOCUMENT}
\reporthead={\hfil}
%
% Headlines begins with \pageno>1
\headline={\ifnum\pageno>1 \line{\the\reporthead \hfil \the\sectionhead}%
    \else\line{\hfil}\fi} 			% Headline begins with \pageno>1
%- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
%  Replacement macros
%
\def\@{\phantom{0}}				% \@ macro
\def\SMM{{\sl SMM}}				% \SMM macro
%- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
%  Font definitions
\font\titlefont=cmbx10 at 12truept 		% \titlefont = \bf at 12pt
\font\twelverm =cmr10  at 12truept		% \twelverm  = \rm at 12pt
%%\font\titlefont=ambx10 at 12truept 		% \titlefont = \bf at 12pt
%%\font\twelverm =amr10  at 12truept		% \twelverm  = \rm at 12pt
%- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
%  Section macros
%
\outer\def\section#1{\bigskip\bigskip\goodbreak\leftline{\titlefont #1}\medskip
   \sectionhead={\twelverm #1}}			% Section titles = running title
\outer\def\subsection#1{\bigskip\goodbreak\leftline{\titlefont #1}\medskip}
\def\newpage{\vfill\eject}
%- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
%  Table of Contents macro
%
\newdimen\conwid  \newdimen\conshift
\outer\def\contents#1#2#3{{\conwid=\hsize \advance\conwid -40pt
     \conshift = \hsize \advance\conshift -\conwid \conshift=0.5\conshift
     \twelverm\baselineskip=14.4truept
     \leftline{\hskip\conshift \hbox to \conwid{
		\hbox to 21truept{\hss#1}\hskip 3truemm #2\dotfill#3}}}}
% ------------------------------------------------------------------------------
\newdimen\hk\setbox0=\hbox{\rm 00-MMM-00}\hk=\wd0	% Size of date
\def\Ver#1#2{\centerline{\hbox to 3truein{(\hbox to \hk{#1\hfil}\ Ver #2)\hfil}}}
% ------------------------------------------------------------------------------
%  Figure caption macros
%
%	\figure		To insert a figure cation (uses \midinsert)
%	\pagefigure	To insert a figure on a separate page (uses \pageinsert)
%
\outer\def\figure#1#2#3{\midinsert\vskip #1{\narrower\noindent{\bf#2}\space
	\rm#3\par}\endinsert}
%
%  \figure{size}{figure number}{caption}
%  Example:
%  \figure{4.5truein}{Figure 1-3.}{Schematic of the FCS and BCS Instruments.}
%
% MDM \outer\def\pagefigure#1#2{\pageinsert\ \vfill{\narrower\noindent{\bf#1}\space
\outer\def\pagefigure#1#2{\pageinsert\vfill{\narrower\noindent{\bf#1}\space
	\rm#2\par}\endinsert}
%
%  \pagefigure{figure number}{caption}
% ------------------------------------------------------------------------------
%
\centerline{\bf SOLAR-A FILE FORMAT CONTROL DOCUMENT}
\bigskip
\centerline{            Version 2.00            }
\centerline{             25-Mar-92              }
\bigskip
\centerline{		(printed on \today)     }\smallskip
\Ver{Nov 1989 }{0.10 -- R.D.Bentley}
\Ver{Dec 1989 }{0.20 -- M.D.Morrison}
\Ver{May 1990 }{0.30 -- R.D.Bentley}
\Ver{26-Jun-90}{0.40 -- M.D.Morrison}
\Ver{ 6-Jul-90}{0.50 -- M.D.Morrison}
\Ver{ 9-Jul-90}{0.60 -- RDB, JRL}
\Ver{10-Jul-90}{0.70 -- MDM, JRL}
\Ver{19-Jul-90}{0.80 -- MDM}
\Ver{25-Jul-90}{1.00 -- MDM}
\Ver{ 9-Jul-91}{1.10 -- MDM}
\Ver{10-Jul-91}{1.20 -- MDM}
\Ver{24-Mar-92}{1.99 -- MDM}
\Ver{25-Mar-92}{2.00 -- MDM}
\bigskip

\newpage

\centerline{\bf TABLE OF CONTENTS}\bigskip

\contents{1.}{Scope                                          }{\@2}
\contents{2.}{File Names                                     }{\@4}
\contents{3.}{Data Flows                                     }{\@7}
\contents{4.}{Definition of Reformatted File Structure       }{\@10}
\contents{5.}{Spacecraft Common Basic Part Files (CBA)       }{\@25}
\contents{6.}{BCS Data Files (BDA)                           }{\@28}
\contents{7.}{HXT Data Files (HDA)                           }{\@39}
\contents{8.}{SXT Data Files (SDA)                           }{\@45}
\contents{9.}{WBS Data Files (WDA)                           }{\@56}
\contents{10.}{Attitude Control Data Files (ATT)             }{\@70}
\contents{11.}{Observing Log (OBS)                           }{\@78}
\contents{12.}{Pointing Log (PNT)                            }{\@90}
\contents{13.}{Spacecraft Ephemeris Log (FEM)                }{\@93?}
\contents{14.}{Event Log                                     }{\@96?}
\contents{15.}{Flare Catalog                                 }{\@100}
\contents{16.}{Access Software                               }{\@101}

\section{1. SCOPE}

	This document describes the formats of the raw data files that
will compose the reformatted Solar-A dataset, the observing log, the
event log, and the flare catalog.

	There will be seven reformatted files: one each for the BCS (Bragg
Crystal Spectrometer), HXT (Hard X-ray Telescope), and WBS (Wide Band 
Spectrometer); for SXT (Soft X-ray Telescope) there will be two files -- 
partial frame image (PFI) and full frame image (FFI); and
two spacecraft common files -- one containing raw attitude control data (ATT),
and a Spacecraft Common Basic Part File (CBA) that will contain all the
housekeeping data for the spacecraft and experiments (the ``basic'' part).
The structure of SXT and BCS files will be based on instrument modes, while the
HXT, WBS, and houskeeping files will be based on telemetry frames. 

The previous File Control Documents (before Ver 2.0) made references to bit
patterns using the ISAS/NEC convention of bit 7 being the least significant bit
(LSB) (example: xxxxxxx = 01234567).  The documentation for Ver 2.0 and all
future versions refer to bit 0 being the least significant bit.  An example
reference would be bits 4:6 in the byte being refered to are AAA in the byte
xAAAxxxx. The change in notation was to make programming easier since most
software functions work with the LSB being bit 0. 

There has been an attempt to avoid using real numbers and to use scaled 
integers instead.  As the data is reduced more and more, it will be difficult
to avoid using real numbers.  Future versions of the File Control Document
will address that issue.

The structure data type definitions listed in this document are in the form
of the FORTRAN syntax for structure definitions.  There is one set of master
structure definitions.  Programs take that definition and make the IDL
structure definitions and the File Control Document TEX file that is included
in this document.  In this manner the FCD and the IDL definitions can easily
be kept up to date.  One distiction that should be noted is that the field
names for the CHARACTER data types have had their names changed when being
converted to an IDL structure.  The string ``st\$'' is added before the original
field name as listed in this document and the FORTRAN definition files.  For
example, if the tag is define as

\verbatim
	CHARACTER*16 ProgName
\endverbatim

then the IDL tag name would be ``ST\$ProgName'' and the tag would be a byte
array of 16 elements long (bytarr(16)).  This was necessary because IDL has
the capability of having variable length strings, and the read statement had
to have a fixed known length.

\verbatim
In order to highlight and emphaize where there have been changes between FCD
version 1.2 and 2.0 a brief summary is listed  here: 
	* There have been slight adjustments to the contents and definitions 
	   of the structures of all of the instruments 
	* There will now be an observing per week (not per month)
	* There are ephemeris files (FEM files) summarizing the spacecraft
	  day/night, SAA, and station contact transitions.
	* A summary subset of the pointing information is contained in 
	  PNT files which will be kept on-line for the whole mission.
	* A complete archive history of all tapes made and distriubted will
	  be available in XAD and XBD files.
\endverbatim


\newpage

\section{2. FILE NAMES}

\subsection{2.1 File Name Prefixes}

All file name prefixes shall be three characters long.

The following prefixes shall be used for the corresponding file types:

\verbatim
	File Type			      Prefix	Direct 		Weekly
							Reformatter	Files
							Output

	Spacecraft Attitude Control Data	ADA	   *

	BCS Raw data				BDA	   *
	BCS Spectroscopic Data			BSR
	BCS Fitted Spectra file			BSF
	BCS Calibrated Parameter file		BPC
	BCS fit parameters file			BPF

	Spacecraft Housekeeping data		CBA	   *
	(Common Basic Area)

	Event log				EVN

	Ephemeris S/C data			FEM			  *

	HXT Raw data				HDA	   *
	HXT Image Deconvolved			HXI

	Observing log				OBS			  *

	Pointing summary files			PNT			  *

	SXT FFI Raw data			SFR	   *
	SXT PFI Raw data			SPR	   *
	SXT (Both FFI/PFI) Background Subtract	SBS
	SXT (Both FFI/PFI) Calibration		SBC
	SXT PFI Background Subtracted		SPS
	SXT FFI Calibration			SFC
	SXT PFI Raw data (part of whole file)	SPP
	SXT Groundbased Data (MicroVAX)		SGB

	WBS Raw data				WDA	   *

	Exabyte tape ASCII log files		XAD			  *
	Exabyte tape binary log files		XBD			  *

\endverbatim

The ``File ID'' is of the form ``yymmdd.hhmm'' where ``yy'' is the year, ``mm''
is the month, ``dd'' is the date, ``hh'' is the hour and ``mm'' is the minutes
of the first minute of sun for the orbit. Thus, for data covering an orbit that
starts at 1250 UT on 3 September 1991, the file for the BCS would be: {\ttt
BDA910903.1250} 

Please note that the SXT file names (e.g. SPR, SFR, ...) given above describe
files which are internally of the same format and are referred generically
throughout this document as ``SDA.'' The different BCS file names refer to
files which have different internal formats. 

Temporary reformatted files will be written to permit quick look analysis, and
to these files an additional character -- ``T'' -- will be added to the name
to identify it as such. Text listing files which correspond to the data files
will have the character ``L'' appended to their filenames.

\verbatim
        File Name Examples:     BDA910901.1234
                                SFR910902.1234
                                SFR910902.1234_T
                                SFR910902.1234_L
				REF910902.1234_LOG

\endverbatim

\subsection{2.2 File ID's}

The file ID's shall be 11 characters long in the format shown below:

\verbatim
	YYMMDD.HHMM

	where YY - Year of data
	      MM - Month of data
	      DD - Day of data
	      HH - Hours
	      MM - Minutes

\endverbatim

The file ID for the reformatted data files shall be constructed by the
reformatting program from the first minute of sunlight as given by the 
predicted space ephemeris.  This method is used instead of using the actual 
first minute of sunlight from the telemetry data, since the data from the 
beginning of an orbit might be overwritten or otherwise lost.  Thus, the file 
ID may not always correspond exactly to the actual time of the first data set.

The ID shall be passed unchanged to all derived files. 

NOTE: The ISO-9660 standard for CD-ROMs only allows 8 characters for file 
name and 3 characters for the extension.  We might have to reconsider for the
file ID.

\newpage

\section{3. DATA FLOW}

This section describes how the data is converted into the reformatted data base
files and the observing log and event log files. 

The raw telemetry data will be transferred from the ISAS Sirius storage system
on the FACOM mainframe computer to one of the co-investigators workstation 
computers (DEC 5500).  The reformatter is written in IDL Ver 2.0 and can
be run on any of the workstations (DEC, Sun, ...).  The reformatter will
run automatically using the raw telemetry as the input.

Data will be reformatted and put in temporary files on a daily basis after
each set of KSC passes.  Only KSC real time and BDR dumps made at KSC will be
reformatted at this time.  Approximately 4 days after the end of the week,
all of the DSN data should have arrived and the data will be 
reformatted again using all data available.  This data will replace the
temporary data and will be distributed to all of the co-investigator
institutions.  The temporary data will generally cover 24 hours and will not
be time ordered.  The final distributed data will have one orbit of data in
each file and will be time ordered.

The observing log will also run automatically, but it will use the reformatted
data files as the input.  

\verbatim

Program:	Reformatter
Location:	Workstation Computer (DEC 5500)
Input:		Raw Telemetry transferred from Sirius Storage/Access System
Output:		Reformatted Data files:
					CBAyymmdd.hhmm
					SFRyymmdd.hhmm
					SPRyymmdd.hhmm
					BDAyymmdd.hhmm
					WDAyymmdd.hhmm
					HDAyymmdd.hhmm
					ADAyymmdd.hhmm
Duration:	One file per instrument per S/C orbit
Sizes:		??
-----------------

Program:	Observing Log Generator
Location:	Workstation Computer (DEC 5500)
Input:		Reformatted files
Output:		OBSyy_ww
Duration:	One file per week
Sizes:		??
-----------------

Program:	Event Log Generator
Location:	Workstation Computer (DEC 5500?)
Input:		Solar-A Observing Log
		Tracking Log (active region # and coordinates)
		Ground Base Observation Log
		CD-ROM Index listing
Output:		EVENT.LOG
Duration:	One file for whole mission (??)
Sizes:		??
-----------------

Program:	Flare Catalog Generator
Location:	Workstation Computer (DEC 5500?)
Input:		Reformatted Files - hand searched(?)
		Observing Log
Output:		FLARE.LOG
Duration:	One file for whole mission (??)
Sizes:		??
-----------------

\endverbatim

\pagefigure{Figure 3-1}{Flow of Solar-A Data}

\newpage

\section{4. DEFINITION OF REFORMATTED FILE STRUCTURES}

The reformatted data files will be binary and arranged in VMS-style fixed
length record formats.  On UNIX systems the logical records will be padded
as necessary, and on VMS systems the files will be direct access.  The word
convention that will be used on all reformatted data files is that used by
DEC.  There is one IDL subroutine which does all of the reading and writing.
If the data file is being read on a machine that requires that the bytes be
swapped (a Sun workstation for example), the subroutine will handle that 
automatically.

The data structure of SXT and BCS files will be based on instrument modes,
while the HXT, WBS, and houskeeping files will be based on telemetry frames. 

Each file shall be logically divided into the following six sections:

\smallskip{\parskip=0pt
	\itemitem{1.} File Information and Pointer Section
	\itemitem{2.} File Header Section
	\itemitem{3.} Quasi-Static Index Section
	\itemitem{4.} Index and Data Section
	\itemitem{5.} Instrument Optional Sections
	\itemitem{6.} Road Map Section
}					% Resets \parskip

\pagefigure{Figure 4-1}{Solar-A Reformatted Files}

\subsection{4.1 Pointer Section}

	This always begins at the first record of the file.  Within a file, 
the record lengths will be fixed, but the different kinds of reformatted files
may have different lengths.  Thus, the number of spares will vary depending on
the file type.  The program which reads the file will learn from the Pointer
Section how to read the rest of the file and where to go to get certain data.

The pointer section will be the same for all 6 types of reformatted files
(CBA, BDA, HDA, SDA, WDA, ATT) as well as the OBS, FEM, and PNT files.  

\verbatim
STRUCTURE       /Pointer_Rec/   
\  INTEGER*2     Pointer_Version/'1011'x/   
\                                 !  0- Pointer structure version   
   
\  BYTE          type_integer    !  2- Integer format convention   
\                                !       1 = DEC (Digital)   
\  BYTE          type_real       !  3- Real format convention   
\                                !       1 = DEC (Digital)   
\  BYTE          file_structure  !  4- (e.g., fixed record, stream of bytes)   
\                                !       1 = stream (IDL /BLOCK)   
\  INTEGER*4     VMS_rec_Size    !  5- Logical (physical on VMS) record length   
   
\                                !       -1 for the following pointers means no such section   
   
\  INTEGER*4     file_header     !  9- Pointer to File Header (Section 4.2)   
\                                !     Bytes from beginning of file   
\  INTEGER*4     qs_section      ! 13- Pointer to Quasi-Static Index section   
\                                !     Bytes from beginning of file   
\  INTEGER*4     data_section    ! 17- Pointer to Index and Data section   
\                                !     Bytes from beginning of file   
\  INTEGER*4     opt_section     ! 21- Optional data section (BCS, WBS)   
\                                !     Bytes from beginning of file   
\  INTEGER*4     map_section     ! 25- Pointer to Road Map section   
\                                !     Bytes from beginning of file   
\  INTEGER*4     TotBytes        ! 29- Total number of bytes in the file   
   
\  INTEGER*2     Header_Version /'1021'x/   
\                                ! 33- Header structure version   
\  INTEGER*2     Roadmap_Version ! 35- Road map structure version   
\                                !     This value is defined in the   
\                                !     "Wrt___Map" Routines.   
\  INTEGER*2     Data_Version    ! 37- Data structure version   
\                                !     This value is only used for   
\                                !     ATT and WBS files.   
   
\  INTEGER*4     itest           ! 39- Integer test pattern   
\                                !       (value = '01020304'x = 16909060   
\  REAL*4        rtest           ! 43- Real test pattern   
\                                !       (value = 1.234e+5)   
\  BYTE          Spare(1)        ! 47- Spare   
END STRUCTURE                   ! 48- Total   
\endverbatim

\subsection{4.2 File Header}


The file header provides information on what data is contained in the file, 
generally, the extent of the time covered by the contents.

The file header section will be the same for all 6 types of reformatted files
(CBA, BDA, HDA, SDA, WDA, ATT) as well as the OBS, FEM, and PNT files.  


\verbatim
STRUCTURE       /File_Header_Rec/   
\  INTEGER*4     fileVerNo       ! 00- File Structure version number   
\  INTEGER*4     progVerNo       ! 04- Program version number (v.vvv * 1000)   
\  CHARACTER*16  progName        ! 08- Name of creating program   
\  CHARACTER*11  fileCreDate     ! 24- file Creation Date (DD-MON-YYYY)   
\  CHARACTER*8   fileCreTime     ! 35- file Creation Time (HH:MM:SS)   
\  INTEGER*4     first_time      ! 43- Time of first DATA SET in file   
\  INTEGER*2     first_day       ! 47- Day of first DATA SET in file   
\  INTEGER*4     last_time       ! 49- Time of last DATA SET in file   
\  INTEGER*2     last_day        ! 53- Day of last  DATA SET in file   
\  integer*4     orb_st_time     ! 55- Start time (millisec of day) of ORBIT   
\  integer*2     orb_st_day      ! 59- Start day (since 1-Jan-79)   
\  integer*4     orb_en_time     ! 63- End time (millisec of day) or orbit   
\  integer*2     orb_en_day      ! 81- End day (since 1-Jan-79)   
\                                !       (use ^^ times to compare to check with   
\                                !       quasi-static index times)   
   
\  INTEGER*4     nDataSets       ! 83- Number of data sets.  Each data set is:   
\                                !       For SDA this is a single image   
\                                !       For CBA,HDA,ATT this is a single major frame   
\                                !       For WDA this is two major frames   
\                                !       For BDA this is a single spectra   
\  INTEGER*4     maxSamps        ! 87- The maximum number of bins, samples, or   
\                                !       pixels in all data sets in the file.   
   
\  INTEGER*4     ntot_qs         ! 91- Total number of quasi-static entries   
\  INTEGER*4     nrep_qs         ! 95- Number of repeated quasi-static entries   
\                                !       (should generally be zero, except when   
\                                !       a parameter is changed in orbit)   
\  INTEGER*4     ntot_opt        ! 99- Total number of optional entries   
\                                !     Not generally used since there is usually   
\                                !     a header structure at the beginning of the   
\                                !     optional data section.   
   
\  CHARACTER*3   file_type       !103- Declaration of file type   
\                                !       The prefix of the file type so that   
\                                !       the file can be identified internally.   
\                                !       Valid Options are:   
\                                !               BDA, SPR, SFR, HDA, WDA, ADA, CBA   
\  CHARACTER*3   spacecraft      !106- Identification of the spacecraft from   
\                                !       which the data originated   
\                                !       Valid Options are:   
\                                !               SMM, P78, HIN, YOH (Yohkoh, Solar-A),   
\                                !               Gnd (Ground testing)   
\  CHARACTER*3   instrument      !109- Identification of the instrument from   
\                                !       which the data originated   
\                                !       Valid Options are:   
\                                !               BCS, HXT, SXT, WBS, ATT   
\  CHARACTER*3   machine         !112- The computer and/or operating system   
\                                !       used to create the file   
\                                !       Valid Options are:   
\                                !               ULX     - DEC Ultrix   
\                                !               VMS     - DEC VMS system   
\                                !               SGI     - Silicon Graphics Unix system   
\                                !               IBM   
\                                !               SUN   
\                                !               FAC     - Facom   
\                                !       Byte ordering and the storage of reals   
\                                !       can be different on different computers.   
\  CHARACTER*13  FileID          !115- File ID (to derive the file name)   
   
\  CHARACTER*80  comment1        !128- comment field 1   
\  CHARACTER*80  comment2        !208- comment field 2   
   
\  integer*2     refVerNo        !288- Reformatter program Version Number  (v.vvv * 1000)   
   
\  BYTE          spare(46)       !290- spare   
END STRUCTURE                   !320- Total   
\endverbatim

\subsection{4.3 Quasi-Static Index Section}

This section of the file contains index information that does not vary during 
the course of an orbit, or varies slowly.  In the latter case, the index
information is time-tagged to show when the contents of the quasi-static
data record are valid.   Each instrument will have a common quasi-static
record as shown here:

\verbatim
STRUCTURE       /QS_General1_Rec/   
\  integer*2     entry_type /'1011'x/   
\                                ! 00- Structure/Entry type   
   
\  integer*4     st_time         ! 02- Start time (millisec of day) of valid data   
\  integer*2     st_day          ! 06- Start day (since 1-Jan-79)   
\  integer*4     en_time         ! 08- End time (millisec of day)   
\  integer*2     en_day          ! 12- End day (since 1-Jan-79)   
   
\  integer*2     scOffset(3)     ! 14- Offset from S/C Boresight (arcsec)   
\                                !      (0) = Pitch; (1) = Yaw; (2) = Roll   
\                                !       [NOT IMPLEMENTED AS OF 25-Mar-92]   
\  integer*2     hxtOffset(3)    ! 20- Offset from HXT boresight (arcsec)   
\                                !      (0) = Pitch; (1) = Yaw; (2) = Roll   
\                                !       [NOT IMPLEMENTED AS OF 25-Mar-92]   
\  integer*2     sxtOffset(3)    ! 26- Offset from SXT boresight (arcsec)   
\                                !      (0) = Pitch; (1) = Yaw; (2) = Roll   
\                                !       [NOT IMPLEMENTED AS OF 25-Mar-92]   
\  integer*2     bcsaOffset(3)   ! 32- Offset from BCS-A boresight (arcsec)   
\                                !      (0) = Pitch; (1) = Yaw; (2) = Roll   
\                                !       [NOT IMPLEMENTED AS OF 25-Mar-92]   
\  integer*2     bcsbOffset(3)   ! 38- Offset from BCS-B boresight (arcsec)   
\                                !      (0) = Pitch; (1) = Yaw; (2) = Roll   
\                                !       [NOT IMPLEMENTED AS OF 25-Mar-92]   
\  integer*2     offset_version  ! 44- Offset solution version   
\                                !       [NOT IMPLEMENTED AS OF 25-Mar-92]   
   
\  integer*4     bAngle          ! 46- Solar B angle (arcsec)   
\                                !       [NOT IMPLEMENTED AS OF 25-Mar-92]   
\  byte          dpf             ! 50- Data presence flag   
\                                !       b0: Solar B angle is available   
\                                !       b1: Offset data is available   
\                                !       [NOT IMPLEMENTED AS OF 25-Mar-92]   
   
\  integer*2     time_sol_ver    ! 51- Current algorithm and parameter version   
\                                !       used for converting between DP time   
\                                !       and universal time   
\                                !       [NOT IMPLEMENTED AS OF 25-Mar-92]   
\  byte          spare(11)       ! 53- Spare   
END STRUCTURE                   ! 64- Total   
\endverbatim

Each instruments will have it's own special quasi-static records and those
are described in later sections.  


\subsection{4.4 Index and Data Section}

This section contains blocks of data records, and each data block is prefixed
with a short index block. The contents of this section depends on the file type
and is discussed in later sections.  
The data structure of SXT and BCS files will be based on instrument modes,
while the HXT, WBS, and houskeeping files will be based on telemetry frames. 


Every instrument will have a structure with identical information.  The
following is the general instrument structure. 

\verbatim
STRUCTURE       /GEN_Index_rec/   
\  integer*2     index_version /'1011'x/   
\                                ! 00- Index structure version                                   Ground Info   
\                                !       AAAABBBB CCCCDDDD   
\                                !       AAAA = Instrument   
\                                !               1= General   
\                                !               2= BCS   
\                                !               3= SXT   
\                                !               4= HXT   
\                                !               5= WBS   
\                                !               6= ATT   
\                                !               7= CBA   
\                                !               8= Other   
\                                !               9= FEM   
\                                !               A= PNT   
\                                !       BBBB = Reserved for future use   
\                                !       CCCC = Separates different types of entries   
\                                !              (different QS types, ...)   
\                                !       DDDD = Version secondary number   
   
\  integer*4     time            ! 02- Time (millisec of day)                                    Derived from DP_Time   
\                                !       (see "day" description for more details)   
\  integer*2     day             ! 06- Day (since 1-Jan-79)                                      Derived from DP_Time   
\                                !     For BCS: This is the time that the data is   
\                                !               taken (not when it is read out of   
\                                !               the queue).  It uses the DP_Time   
\                                !               and the BCS clock value.   
\                                !     For HXT: This is major frame time.  There is a   
\                                !               four second offset buffer in the HXT   
\                                !               electronics.  The data for the dataset   
\                                !               is actually for 4 seconds BEFORE the   
\                                !               time listed in these fields.   
\                                !               NOTE: The definition for this fields might   
\                                !               be changed in Apr '92 to be the true time   
\                                !               of the data.  In that case, the read routines   
\                                !               will make a four second offset correction for   
\                                !               the old data files.   
\                                !     For SXT: This is major frame time when the   
\                                !               image was commanded.  For the actual time   
\                                !               that the shutter opened, add the "exposure   
\                                !               latency" value (usually ~100 msec) to this time   
\                                !     For SXT/Gnd: This is the time when the file   
\                                !               was created   
\                                !     For WBS: This is major frame time   
   
\  byte          dp_time(4)      ! 08- DP time for the major frame   
\                                !     For BCS: This value is empty (see BCS_DP_Sync_Rec)   
\                                !               (0) = TIMER1                                    W50 F1   
\                                !                       LSB = "SFK" = 2048 sec   
\                                !                       (period of SFK clock = 4096)   
\                                !               (1) = TIMER2                                    W50 F0   
\                                !                       LSB = "SFC" = 8 sec   
\                                !                       (period of SFC clock = 16)   
\                                !               (2) = TIMER3                                    W51 F0   
\                                !                       LSB = "FA" = 0.03125 sec   
\                                !               (3) = FI (Frame Indicator)                      W03 F0   
\  byte          DP_mode         ! 12- DP Mode                                                   W50 F2   
\                                !     For BCS: This value is empty (see BCS_DP_Sync_Rec)   
\                                !       b0:4 =  xxx01001 (= 9) Flare mode   
\                                !               xxx01011 (=11) BCS-Out mode   
\                                !               xxx01100 (=12) Night mode   
\                                !               xxx01101 (=13) Quiet mode   
\  byte          DP_rate         ! 13- DP Rate                                                   W48 F15   
\                                !     For BCS: This value is empty (see BCS_DP_Sync_Rec)   
\                                !       b5:7 =  100xxxxx (=4) High rate   
\                                !               010xxxxx (=2) Medium rate   
\                                !               001xxxxx (=1) Low rate   
\  byte          Flare_Control   ! 14- Flare flag control (active triggers)                      W50 F60   
\                                !     For BCS: This value is empty (see BCS_DP_Sync_Rec)   
\                                !       b4   = BCS triggering enabled   
\                                !       b3   = HXS-PC1 triggering enabled   
\                                !       b2   = SXS-PC triggering enabled   
\                                !       b0:1 = SXS sensors to allow triggering enabled   
\                                !               00 = SXS-PC11   
\                                !               01 = SXS-PC12 (default)   
\                                !               10 = SXS-PC21   
\                                !               11 = SXS-PC22   
\  byte          Flare_Status(4) ! 15- Flare flag status                                         W50 F16n+3   
\                                !     For BCS: This value is empty (see BCS_DP_Sync_Rec)   
\                                !       b7   = Flare/RBM flag control (set = Auto)   
\                                !               Controls flare and RBM flags (auto/manual)   
\                                !       b6   = SXS detects a flare   
\                                !       b5   = HXS detects a flare   
\                                !       b4   = BCS detects a flare   
\                                !       b3   = RBM flag status (used for judging   
\                                !             false or true Gamma burst (GBD))   
\                                !             (set= should cancel GBD flag)   
\                                !       b2   = RBM flag status for false or true flares   
\                                !             (set= should cancel flare flag)   
\                                !       b0:1 = Flare status   
\                                !               00: No flare   
\                                !               10: Normal flare   
\                                !               11: Great flare   
\                                !               01: BCS-MEM Dump Control   
\  byte          RBM_Status      ! 19- Radiation Belt Montitor Status                            W50 F61   
\                                !       b7   = RBM status (set = on)   
\                                !               (RBM flag on allows for canceling flares)   
\                                !       b4:5 = Flare mode   
\                                !               11: Great Flare   
\                                !               10: Normal Flare   
\                                !               00: Quiet   
\                                !               01: BCS Memory mode out   
\  byte          Telemetry_mode  ! 20- Telemetry mode                                            W51 F06   
\                                !       b0:3    = 0000 - Real time link   
\                                !               = 0001 - Recording playback   
\                                !               = 0101 - TMX Reproduce High   
\                                !               = 0110 - TMX Reproduce Low   
\                                !               = 0111 - TMS Reproduce High (no convolution)   
\                                !               = 1000 - TMS Reproduce low   
\                                !               = 1001 - TMS Reproduce High (Convolution)   
\  byte          cal_status      ! 21- CAL status                                                W51 F55   
\                                !       b6 = HXT-CAL enable/disable (DP editing status)   
\                                !       b5 = HXT-CAL-DATA (overrides columns 6 and 7)   
\                                !       b4 = HXS-PH enable/disable   
\                                !       b3 = HXS-PH-CAL-DATA   
\                                !       b2 = GRS-CAL enable/diable   
\                                !       b1 = GRS-CAL-DATA   
\                                !     _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _   
   
\  integer*4     pntg_angle(3)   ! 22- X,Y,Z euler angles in sun pointing coordinates            From Mainframe   
\                                !     (See ATT_STRUCT for full definition)   
\  byte          pntg_Trace      ! 34- Information on how pointing was derived                   From Mainframe   
\                                !     and whether there is data present   
\                                !     (See ATT_STRUCT for full definition)   
\  byte          pntg_jitter     ! 36- Magnitude of pointing change                              From Mainframe   
\                                !     (See ATT_STRUCT for full definition)   
   
\                                !     _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _   
\  byte          telemetry       ! 38- Telemetry source information                              W7 in 16 byte leader   
\                                !       b0:3 = Ground Station   
\                                !               0 = KSC Real time data   
\                                !               1 = KSC playback data   
\                                !               5 = DSN - Goldstone playback data   
\                                !               7 = DSN - Canberra playback data   
\                                !               9 = DSN - Madrid playback data   
\                                !               15 = Ground based (test data)   
\                                !       b4:7 = Bit rate   
\                                !               0 = low   
\                                !               1 = medium   
\                                !               2 = high   
\  byte          sirius(5)       ! 39- Sirius data base information ??                           Ground Info   
\                                !       TODO ?? - What info here? - path?   
\                                !       [NOT IMPLEMENTED AS OF 25-Mar-92]   
   
   
\                                !     _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _   
\  byte          data_quality    ! 44- Data quality                                              Ground Info   
\                                !               1 = good   
\                                !       [NOT IMPLEMENTED AS OF 25-Mar-92]   
\  integer*4     nmissSamps      ! 45- Number of missing bytes (due to telemetry                 Ground Info   
\                                !     drop outs - minor or major frames)   
\                                !       [NOT IMPLEMENTED AS OF 25-Mar-92]   
\  integer*4     StartSamp       ! 45- Starting sample number of good data                       Ground Info   
\                                !       (zero if there are no dropouts)   
\                                !       [NOT IMPLEMENTED AS OF 25-Mar-92]   
   
\                                !     _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _   
\  byte          data_word_type  ! 49- Data word type (byte, integer*2, real...)                 Ground Info   
\                                !       b0:3 = Data word type   
\                                !               0 = byte   
\                                !               1 = integer*2   
\                                !               2 = integer*4   
\                                !               3 = real*4   
\                                !       b4   = Set if data is compressed   
\  integer*2     nIndexStruct    ! 50- Number of "extra" index structures following   
\                                !     the general index structure   
\                                !     (for additional "ground" structures,   
\                                !     processing information structures, ...)   
\  integer*2     nIndexByte      ! 52- Number of bytes in the index records   
\  integer*4     nDataByte       ! 54- Number of byte in the data section   
   
\  byte          SXT_Pow_stat    ! 58- Power Status (0=off, 1=on)                                W48  F25   
\                                !       b7 = 5 Volts   
\                                !       b6 = 28 Volts   
\                                !       b5 = Filter Wheel   
\                                !       b4 = Shutter / Aspect Controller   
\                                !       b3 = Micro A Select   
\                                !       b2 = Micro B Select   
\                                !       b1 = Camera   
\                                !       b0 = Thermoelectric Cooler (TEC)   
\  BYTE          bcs_pow_stat    ! 59- BCS Power status                                          W112 F32n+3   
\                                !       b0 = Calibibration-B (set=enabled)   
\                                !       b1 = HVB logical flag (set=enabled)   
\                                !       b2 = HVB power (set=on)   
\                                !       b3 = Spectrometer B (set=on)   
\                                !       b4 = Calibibration-A (set=enabled)   
\                                !       b5 = HVA logical flag (set=enabled)   
\                                !       b6 = HVA power (set=on)   
\                                !       b7 = Spectrometer A (set=on)   
\  byte          hxt_Pow_stat    ! 60- HXT Power status                                          W48 F32+1   
\                                !       b7 = HXT1 (electronics for 00 to 31)   
\                                !       b6 = HXT2 (electronics for 32 to 63)   
\                                !       b5 = OS memory status   
\                                !       b4 = HXA on/off   
\                                !       b3 = HXA cal   
\                                !       b2 = HXT cal   
\                                !       b1 = HV reduction fuction on/off (enable SAA HV on/off)   
\                                !            Usually HV is 900 V, reduced to ~0 V when on   
\                                !       b0 = HV enable (double command safety)   
\                                !            HV cannot go on until this is enabled   
\  byte          wbs_pow_stat    ! 61- Power status                                              W48 F32n+2   
\                                !       b7 = WBS HV enable/disable   
\                                !       b6 = WBS on/off (set=on)   
\                                !       b5 = WBS-A on/off (set=on)   
\                                !       b4 = SXS-HV on/off (set=on)   
\                                !       b3 = HXS-HV on/off (set=on)   
\                                !       b2 = GRS-HV1 on/off (set=on)   
\                                !       b1 = GRS-HV2 on/off (set=on)   
\                                !       b0 = RBM-HV on/off (set=on)   
\  byte          SXT_Control     ! 62- SXT Control Status                                        W114 F32   
\                                !       b7   = Power control mode (1=auto, 0=manual)   
\                                !       b6   = SXT control mode (1=auto, 0=manual)   
\                                !       b2:3 = SXT day/night mode   
\                                !               00 = SXT day mode   
\                                !               01 = SXT evening mode   
\                                !               10 = SXT night mode   
\                                !               11 = SXT morning mode   
\                                !       b1   = SXTE-U hard reset (1=executed)   
\                                !       b0   = SXTE-U soft reset (1=executed)   
\  byte          spare1(15)      ! 63- Spare Bytes   
END STRUCTURE                   ! 80- Total   
\endverbatim

\subsection{4.5 Instrument Optional Sections}

The BCS obtains count rates independantly from the spectral data.  These
are held in this optional section, together with the time that the samples
were accumulated.

The HXT aspect sensor (HXA) data is contained in a section by itself at
the end of the ATT file. 

\subsection{4.6 Road Map Section}

The Road Map section contains pointers to all of the 
Index/Data records in the preceding section.  The pointers are expressed in 
bytes from the beginning of the file, where the counting begins from 0. The 
appropriate file record for VMS files may be calculated by dividing these 
quantitites by the file record length (see {\ttt VMS\_rec\_Size} in \S 4.1).

The contents of the roadmap are a sub-set of the index record so all information
in the roadmap must be present in the index record.  The roadmap 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.  The roadmap generally
holds mode information and an indication of the signal level observed.  A
further description of each instruments roadmap section is given below.

\subsection{4.7 Summary of Different Structure Types}

In later chapters, the various file sections are defined in terms of 
software structures.  The correspondance between the file sections and the 
structure names is given below:

\verbatim
				Structure Name
				--------------
Pointer Section
				Pointer_Rec

File Header			
				File_Header_Rec

Quasi-Static Index Section
				QS_General1_Rec
				BCS_QS_Instr_Rec
				BCS_QS_Conv_Rec
				BCS_QS_Group_Rec
				HXT_QS_Instr_Rec
				HXT_QS_Conv_Rec
				SXT_QS_Instr_Rec
				SXT_QS_Conv_Rec
				WBS_QS_Instr_Rec
				WBS_QS_Offset_Rec
				WBS_QS_Del_Rec
				WBS_QS_Conv1_Rec
				WBS_QS_Conv2_Rec
Index Sections
				ATT_Index_Rec
				BCS_Index_Rec
				HXT_Index_Rec
				GEN_Index_Rec
				SXT_Index_Rec
				WBS_Index_Rec
Data Sections
				HXT_PC_Data_Rec
				HXT_PH_Data_Rec
				CBA_Data_Rec
				BCS_Data_Rec
				SXT_Data_Rec
				WBS_DHK_Data_Rec
				WBS_PC_Data_Rec
				WBS_PH_Data_Rec
Optional Data Section
				BCS_DP_Sync_Rec
				HXA_Scan_Rec
Road Map Section
				BCS_Roadmap_Rec
				HXT_Roadmap_Rec
				SXT_Roadmap_Rec
				WBS_Roadmap_Rec

Observing Log Section
				Obs_FileID_Rec
				Obs_OrbitSol_Rec
				Obs_WBSHXT_Rec
				Obs_BCS_Rec
				Obs_Sxt_Rec
				Obs_BCS_Status_Rec
				Obs_HXT_Status_Rec
				Obs_WBS_Status_Rec

Event Log Section
				Evn_Common_Rec
				Evn_PFI_Rec

\endverbatim

\newpage

\section{5.  SPACECRAFT COMMON BASIC PART FILE (CBA)}

\verbatim
	File Identifier:		CBA
	Record Size:			16 bytes
\endverbatim

The CBA (common basic area) data file is one of the reformatted data files 
which is written by the reformattor.  All data that is necessary to analyze
the scientific data is removed from the ``basic part'' and inserted into the
index sections of the instrument data files.  It is not expected to be necessary
to access this file since all relevant data has been copied to the instrument
files.

The general layout of this and the other reformatted data files is:

\smallskip{\parskip=0pt
	\itemitem{1.} File Information / Pointer Section
	\itemitem{2.} File Header Section
	\itemitem{3.} Quasi-Static Index Section
	\itemitem{4.} Index/Data, Index/Data, \dots\ Section
	\itemitem{5.} Road Map Section
}					% Resets \parskip

\subsection{5.1 Pointer Section}
	The pointer section is described in Section 4.1.  

\subsection{5.2 File Header}
	The File Header is described in Section 4.2.

\subsection{5.3 Quasi-Static Index Section}
	The structure QS\_General1\_Rec described in Section 4.3 will be used.

\subsection{5.4 Index and Data Section}

This section contains a series of index and data blocks. 
Only the General Index Structure is needed for this entry.  There is no
additional index structured needed.

The data blocks will contain all the spacecraft and experiment
houskeeping data stored in the ``Basic Part'' of the telemetry which
constitutes 25\% of the bubble data recorder.  One block per major frame. 
Descriptions of the raw telemetry words are available, but are mostly
written in Japanese.

\verbatim
STRUCTURE       /CBA_Data_Rec/   
\  byte          basic(4,8,64)   !   0- Basic part   
END STRUCTURE                   !2048- Total   
\endverbatim

\subsection{5.5 Instrument Optional Section}

The CDA file contains no optional section.

\subsection{5.6 Road Map Section}

This section contains a record for every ``block'' in the Index/Data section.
The information in this section is a subset of the index structure (see the
general index structure for a full explanation of each field).


\verbatim
STRUCTURE       /CBA_Roadmap_Rec/   
\                                !     For a full description of the fields,   
\                                !     look at the Index_Rec definition   
   
\  integer*4     ByteSkip        ! 00- Offset in bytes from the beginning of   
\                                !     of the data file for the beginning   
\                                !     of the data set index structure.   
   
\  integer*4     time            ! 04- Major frame time (millisec of day)   
\  integer*2     day             ! 08- Major frame day (since 1-Jan-79)   
   
\  byte          DP_mode         ! 10- DP Mode   
\  byte          DP_rate         ! 11- DP Rate   
   
\  integer*4     sxt_ffi         ! 12- Serial number for SXT FFI image   
\                                !     (to allow easy matching to engineering information   
\                                !     like AEC,ARS,ART ...)   
\  integer*4     sxt_pfi         ! 16- Serial number for SXT PFI image   
   
\  byte          SXT_Pow_stat    ! 20- SXT Power Status   
\  BYTE          bcs_pow_stat    ! 21- BCS Power status   
\  byte          hxt_Pow_stat    ! 22- HXT Power status   
\  byte          wbs_pow_stat    ! 23- WBS Power status   
   
\  byte          spare(8)        ! 24-   
END STRUCTURE                   ! 32- Total   
\endverbatim

\newpage

\section{6.  BCS RAW DATA FILE (BDA)}

\verbatim
	File Identifier:		BDA
	Record Size:			16 bytes
\endverbatim


The BDA (BCS DAta) file is one of the reformatted data files which is written
by the reformattor.  The general layout of this and the other reformatted data
files is: 

\smallskip{\parskip=0pt
	\itemitem{1.} File Information / Pointer Section
	\itemitem{2.} File Header Section
	\itemitem{3.} Quasi-Static Index Section
	\itemitem{4.} Index/Data, Index/Data, \dots\  Section
	\itemitem{5.} Optional Data Section (DP sync data)
	\itemitem{6.} Road Map Section
}					% Resets \parskip

\subsection{6.1 Pointer Section}
	The pointer section is described in Section 4.1.  

\subsection{6.2 File Header}
	The File Header is described in Section 4.2.

\subsection{6.3 Quasi-Static Index Section}

	The structure QS\_General1\_Rec described in section 4.3 will be used.

\verbatim
STRUCTURE       /BCS_QS_Instr_Rec/   
\  integer*2     entry_type /'2011'x/   
\                                ! 00- Structure/Entry type   
   
\  integer*4     st_time         ! 02- Start time (millisec of day) of valid data   
\  integer*2     st_day          ! 06- Start day (since 1-Jan-79)   
\  integer*4     en_time         ! 08- End time (millisec of day)   
\  integer*2     en_day          ! 12- End day (since 1-Jan-79)   
   
\                                !     _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _   
\  byte          SCAval(2,4)     ! 14- Upper and lower channel SCA settings                      W49 F32n+0,2,4,6,8,   
\                                !       (Channel, 0=lower)                                              10,12,14   
\                                !       (channel, 1=upper)   
\  byte          hv_control      ! 22- HV control (commanded)                                    W49 F32n+16   
\                                !       b0:2 = trim for HVA   
\                                !       b4:6 = trim for HVB   
\                                !       NOTE: Changes in one orbit during a cal   
\  BYTE          stim_control    ! 24- Stimulus on/off                                           W49 F32n+26   
\                                !       b0   = Detector A internal stim generator (set=off)   
\                                !       b1   = Detector A stim source (set=internal)   
\                                !       b2   = Detector A multiplexor (set=disable)   
\                                !       b4   = Detector B internal stim generator (set=off)   
\                                !       b5   = Detector B stim source (set=internal)   
\                                !       b6   = Detector B multiplexor (set=disable)   
\                                !     _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _   
\  byte          Fe26_thresh     ! xx- Fe XXVI threshold                                         W66 F28 SF4n+2   
\                                !       value*16 = actual threshold counts   
\  byte          chan_mfd        ! xx- Channels selected and min flare duration                  W66 F28 SF4n+3   
\                                !       LSB = b0   
\                                !       b5:7 = SAA Algorithm channel   
\                                !       b4:5 = Flare algorithm channel   
\                                !       b0:3 = Mininum flare duration   
\  byte          SAA_Thresh      ! xx- SAA Threshold                                             W66 F29 SF4n+3   
\                                !       value*16 = actual threshold counts   
\  byte          Flr_RiseThresh  ! xx- Flare rise threshold                                      W66 F30 SF4n+3   
\                                !       value*16 = actual threshold counts   
\  byte          Flr_DecayThresh ! xx- Flare decay threshold                                     W66 F31 SF4n+3   
\                                !       value*16 = actual threshold counts   
\  byte          Flr_OptionID    ! xx- Flare Option ID                                           W66 F63 SF4n+3   
\                                !     _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _   
   
\  BYTE          sensitivity(4)  ! 26- Det. Sensitivity (Nominal Val= 200)                       Ground Defined   
\  INTEGER*4     posGain(4)      ! 30- Position Gain for det (Angstrom/Bin)                      Ground Defined   
\  INTEGER*4     posOffset(4)    ! 46- Position Offsets. (micro-Angstrom)                        Ground Defined   
\                                !       NOTE that the Gain and offset are the   
\                                !       slope and intercept of the line giving   
\                                !       the conversion between bin numbers and   
\                                !       wavelength.   
   
\  integer*2     bcs2dp_ver      ! 62- Algorithm and parameters used to convert                  Ground Defined   
\                                !       between BCS timer and DP timer   
\  byte          spare(12)       ! 64-   
END STRUCTURE                   ! 80- Total   
\endverbatim

\verbatim
STRUCTURE       /BCS_QS_Conv_Rec/   
\  integer*2     entry_type /'2031'x/   
\                                ! 00- Structure/Entry type   
   
\  integer*4     st_time         ! 02- Start time (millisec of day) entries are valid   
\  integer*2     st_day          ! 06- Start day (since 1-Jan-79)   
\  integer*4     en_time         ! 08- End time (millisec of day)   
\  integer*2     en_day          ! 12- End day (since 1-Jan-79)   
   
\  integer*4     hv_conv(2)      ! 14- Conversion for high voltage in 0.01 KeV   
\                                !       (0) = intercept; (1) = slope   
\                                !       NOT IMPLEMENTED AS OF 25-Mar-92]   
\  integer*4     temp_conv(2)    ! 22- Conversion for temperature in 0.01 deg.   
\                                !       NOT IMPLEMENTED AS OF 25-Mar-92]   
   
\  integer*2     solution_ver    ! 30- Solution version   
\                                !       NOT IMPLEMENTED AS OF 25-Mar-92]   
   
\  byte          spare(32)       ! 32-   
END STRUCTURE                   ! 64- Total   
\endverbatim

\smallskip\noindent
The second structure defines the bin group lists:

\verbatim
STRUCTURE       /BCS_QS_Group_Rec/   
\  integer*2     entry_type /'2041'x/   
\                                ! 00- Structure/Entry type   
   
\                                !   - No starting and ending times are needed for the   
\                                !     grouper plan.   
\  integer*4     time            ! 02- Creation time in msod   
\  integer*2     day             ! 06- Creation date in days since 1-Jan-1979   
   
\  integer*2     length          ! 08- Total No of bytes of data created by the plan   
\  integer*2     ModeID          ! 10- The modeID that is described   
\  byte          ngrp(4)         ! 12- Number of groups for each channel   
\  integer*2     groups(10,4)    ! 16- The Grouper plan for each channel   
\                                !       groups(*,ichan) = [nout1,nbin1, nout2,nbin2, nout3,nbin3, ...]   
\                                !               where ichan is then channel in question   
\                                !                       nout1 is the number of output values   
\                                !                       nbin1 is the number of raw input values binned   
\  byte          spare(32)       ! 96- Spare   
END STRUCTURE                   !128- Total   
\endverbatim

\subsection{6.4 Index and Data Section}

	The ``blocks'' in this section are combined index and data records. The
blocks may span more than one file record, but the start of a new block will
always be at the file record boundary. The boundries between individual blocks
are determined from the corresponding road map section, which contains pointers
to the record number. BCS data blocks are of variable lengths -- the length is
the total of the number of groups of bins in all channels. Each byte of the
block contains the (compressed) counts for the corresponding bin group received
during the data gather interval. 

	A BCS ``mode'' is one integration of a given interval (``dgi'') for a 
particular grounper (bin) plan.  A BCS ``sequence'' is several modes running 
depending on the flare flag.  There is typically one sequence for quiet mode
and one for flare.

The DP mode and rate must be derived from the BCS\_INDEX field ``DP\_Flags''
since the information in the GEN\_INDEX is for the major frame when the data
was read out, not when the data was taken (BCS data is stored in a queue in
the BCS microprocessor)

The structure of the BDA mode indexes are as follows:

\verbatim
STRUCTURE       /BCS_Index_Rec/   
\  integer*2     index_version /'2011'x/   
\                                ! 00- Index structure version   
   
\  byte          dp_time_out(4)  ! 02- DP time (timer1,2,3 and FI) for when   
\                                !     the data is read out   
\                                !     Use this time to check the state of the   
\                                !     Spacecraft during readout - see   
\                                !     BCS_DP_Sync_Rec structure   
   
\                                !     _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _   
\  BYTE          blockID         ! 06- BCS Block ID                                              Derived   
\                                !      =0: Normal Queue Data Block   
\                                !      =1: Fast Queue Data Block   
\                                !      =2: Micro Dump Block (fixed extraction)   
\                                !          Reformatter forces this mode whenever the   
\                                !          CPU is disabled   
\                                !      =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 (garabage).  Avoid this value to avoid   
\                                !          these datasets when making light curves.   
   
\  BYTE          ModeID          ! 09- Mode ID (Grouper Plan)                                    Mode Header(8)   
\                                !       For "Normal" and "Fast" queue data   
\                                !       (BlockID = 0 or 1) this value is the   
\                                !       ModeID used in conjunction with the   
\                                !       grouper plan.   
\                                !   
\                                !       If the mode ID is not recognized, then   
\                                !       it is set to 255, and the mode header   
\                                !       is put out with the beginning of the   
\                                !       data.   
\                                !   
\                                !       For "Cal Mode" (BlockID = 3)   
\                                !       this holds the channel number as   
\                                !       derived from PHA_CONTROL with a   
\                                !       1.5 major frame delay   
\                                !               b4:7 = first 256 bytes   
\                                !               b0:3 = last 256 bytes   
\                                !       Value = 1,2,3,4   
\                                !       Value = 0 if unknown (data dropouts)   
\  BYTE          ModeRepNum      ! 10- Mode Repeat Number                                        Mode Header(6)   
\  BYTE          ControlTally    ! 11- Control Byte Tally                                        Mode Header(7)   
\                                !   
\  BYTE          ControlByte     ! 12- Control Byte                                              Mode Header(12)   
   
\  BYTE          dgi             ! 13- Data Gather Interval (125 msec units)                     Mode Header(9)   
\                                !       For "Cal Mode" (BlockID = 3)   
\                                !       this value comes from                                   W49 F22   
\  INTEGER*2     nSampPChan(4)   ! 14- Number of data samples per channel                        (From Grouper Plan)   
   
\  INTEGER*2     total_cnts(4)   ! 22- Total counts in each channel for the mode                 Derived   
\                                !     Saved counts have been divided by 10 to   
\                                !     to avoid overflow problems   
   
\  BYTE          DP_Flags        ! 30- DP Flags received by BCS                                  Mode Header(4)   
\                                !       b0      = Radiation Belt monitor (set = yes)   
\                                !       b1,2    = 0,0: No flare   
\                                !               = 1,0: Normal Flare   
\                                !               = 1,1: Great Flare   
\                                !               = 0,1: BCS MEM Mode   
\                                !       b3,4    = 0,0: Low (1 kps)   
\                                !               = 1,0: Med (4 kps)   
\                                !               = 0,1: Hi (32 kps)   
\                                !               = 1,1: Hi (32 kps)   
\                                !       b5      = BCS-OUT after flare (set = enable)   
\                                !       b6      = BCS-OUT after night (set = enable)   
\                                !       b7      = Currently BCS-OUT mode   
\  BYTE          BCS_Status      ! 31- BCS Status                                                Mode Header(5)   
\                                !       b0 = SAA Threshold exceeded (set = yes)   
\                                !       b1 = Flare threshold exceeded (set = yes)   
\                                !       b2 = HVU's turned off by BVS SAA algorithm   
\                                !       b3 = Fe XXVI thershold exceeded   
\                                !       b4 = BCS is in night state   
\                                !       b5 = BCS is in SAA state   
\                                !       b6 = Status of data in queue (set = hi)   
\                                !       b7 = Status of BCS flare flag (set = hi)   
   
\  byte          MissBasicData   ! 32- Flag to mark if the DP major frames                       Derived   
\                                !     for the period when the data was taken   
\                                !     were telemetered down (set = got the data)   
\                                !       (ie: got the basic part data for   
\                                !       the period when the data was taken)   
\  byte          MissModeID      ! 33- Missing the beginning of the data which                   Derived   
\                                !     has the mode ID so all information is   
\                                !     guessed.   
   
\  INTEGER*2     length          ! 35- Total No of bytes of data created by the plan   
\                                !     This is the array length of the output vector   
\                                !     which holds all of the channels.  This is the   
\                                !     true length, where INDEX.GEN.NDATABYTES is the   
\                                !     number of bytes written to the disk, which could   
\                                !     have padded zeros.   
\  BYTE          spare(14)       ! 34- Spare bytes   
END STRUCTURE                   ! 48- Total   
\endverbatim

	The data blocks contain the four channel spectra as ``output'' from the
accumulator. The bin list is needed to split this data into channels, and
wavelength bins. 

%% [RDB is to add more words here.]

The data is a one dimensional array.  The size of the array is defined in the
index structure and is the total number of bins for all four channels.  The 
reading routine will return a 1-D array if only one 
data set is read, or a 2-D array if many data sets are read (where the length
of the second dimension is the number of datasets extracted) 

%% \input fcdticdir:BCS_Data_Rec.tic

\subsection{6.5 Instrument Optional Section -- DP Sync Section}

	A number of records each containing the 12 event counters (light
curve data), the high voltage monitor values, the temperatures, and an
associated time stamp.  There is one entry per major frame.

\verbatim
STRUCTURE       /BCS_DP_Sync_Rec/   
\  integer*2     index_version /'2022'x/   
\                                ! 00- Index structure version   
   
\  INTEGER*4     time            ! 02- Time (ms of day) of major frame during readout   
\  INTEGER*2     day             ! 06- Day since 1-Jan-79 or major frame during readout   
   
\  byte          dp_time(4)      ! 08- DP time (timer1,2,3 and FI) for when   
\                                !     the data is read out   
\                                !     (see Gen_Index for an explanation of the values)   
\  byte          DP_mode         ! 12- DP Mode during the readout   
\                                !     (see Gen_Index for an explanation of the values)   
\  byte          DP_rate         ! 13- DP Rate during readout   
\                                !     (see Gen_Index for an explanation of the values)   
\  byte          Flare_Control   ! 14- Flare flag control during readout   
\                                !     (see Gen_Index for an explanation of the values)   
\  byte          Flare_Status(4) ! 15- Flare flag status during readout   
\                                !     (see Gen_Index for an explanation of the values)   
\  byte          RBM_Status      ! 19- Radiation Belt Montitor Status   
\                                !     (see Gen_Index for an explanation of the values)   
\  byte          Telemetry_mode  ! 20- Telemetry mode   
\                                !     (see Gen_Index for an explanation of the values)   
\  byte          cal_status      ! 21- CAL status   
\                                !     (see Gen_Index for an explanation of the values)   
   
\                                !     _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _   
   
\  INTEGER*2     All_Cnts(4,2)   ! 22- All counts for the 4 channels                             W66 F00/01,F06/07,...   
\                                !                                                               W66 F32/33,F38/39,...   
\                                !     Units = counts per "Acc_Interval" (see below)   
\  INTEGER*2     Lim_Cnts(4,2)   ! 38- Limited for the 4 channels                                W66 F02/03,F08/09   
\                                !                                                               W66 F34/35,F40/41,...   
\                                !     Units = counts per "Acc_Interval" (see below)   
\  INTEGER*2     Acc_Cnts(4,2)   ! 54- Accepted for the 4 channels                               W66 F04/05,F10/11   
\                                !                                                               W66 F36/37,F42/43,...   
\                                !   NOTE: For All_Cnts, Lim_Cnts, and Acc_cnts   
\                                !       the following applies   
\                                !     Units = counts per "Acc_Interval" (see below)   
\                                !       Cnts(n,m)       n = channel   
\                                !                       m = 2 per major frame   
\                                !       The onboard counter is an unsigned 16-bit counter   
\                                !       The reformatted data is saved as a signed 16-bit value   
\                                !       If the value is negative, then 65536 (which is 2^16)   
\                                !       needs to be added to the value.   
\  integer*2     Acc_interval(2) ! 70- Accumulation interval (sec)                               Derived   
\                                !     This value is only relevant for the differences   
\                                !     made to the PREVIOUS major frame for all_cnts(*,0)   
\                                !     Since there are two values dumped each major frame,   
\                                !     the delta within the single major frame all_cnts(*,1)   
\                                !     is defined by the DP_RATE for that major frame.   
\                                !       Valid values are:   
\                                !               0 = Raw number (not counts/sec)   
\                                !                   Implies dropout for previous major frame   
\                                !               8 sec = 1/2 * 16 sec (med rate)   
\                                !               1 sec = 1/2 * 2 sec (high rate)   
\                                !               ? sec = transition high to med- TODO   
\                                !               ? sec = transition med to high - TODO   
\                                !     _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _   
   
\  byte          pha_counts(8)   ! 74- PHA Data                                                  W66 F24,25,26,27   
\                                !                                                                   F56,57,58,59   
\  BYTE          PHA_Control(2)  ! 82- PHA Control                                               W49 F32n+18   
\                                !     _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _   
\  BYTE          SpecStatus(2)   ! 84- Spectrometer status                                       W112 F32n+3   
\                                !       b0 = Calibibration-B (set=enabled)   
\                                !       b1 = HVB logical flag (set=enabled)   
\                                !       b2 = HVB power (set=on)   
\                                !       b3 = Spectrometer B (set=on)   
\                                !       b4 = Calibibration-A (set=enabled)   
\                                !       b5 = HVA logical flag (set=enabled)   
\                                !       b6 = HVA power (set=on)   
\                                !       b7 = Spectrometer A (set=on)   
\  byte          CommandStat(2)  ! 86- Command Status                                            W112 F32n+4   
\                                !       b0 = Command decode (set=disabled)   
\                                !       b1 = Program address set (set=disabled)   
\                                !       b2 = Program load (set=disabled)   
\                                !       b3 = CPU processor (set=disabled)   
\                                !       b4 = Low RAM (set=enable)   
\                                !       b5 = Watchdog Timer (set=disabled)   
\                                !       b6 = Block Command (BC) (set=enable)   
\                                !       b7 = Digital Electronics (set=on)   
   
\  byte          cpu(4,2)        ! 88- Microprocessor information/diagnostics                    W66 F28,29,30,31   
\                                !                                                                   F60,61,62,63   
\                                !     Has the clock value to tie the DP clock   
\                                !     to the BCS clock.   
   
\                                !     _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _   
\  BYTE          HV_mon(2)       ! 96- HV monitor voltage (0-255)                                W32 F32,33 SF2n   
\                                !       SF2n ==> changes every 2 MF!!?!?!   
\                                !     (See quasi-static section for conversions)   
\  byte          crytemp(2)      ! 98- Crystal Bank Temperatures (milli-Celsius)                 W32 F31,32 SF2n+1   
\                                !     (See quasi-static section for conversions)   
\  BYTE          Elec_Temp       !100- Electronics temperature                                   W32 F33    SF2n+1   
\                                !     (See quasi-static section for conversions)   
\  byte          spare(11)       !101   
END STRUCTURE                   !112- Total   
\endverbatim

There is a header at the beginning of the optional section describing the
number of entries.

\verbatim
STRUCTURE       /BCS_DPs_Head_Rec/   
\  integer*2     index_version /'2031'x/   
\                                ! 00- Index structure version   
   
\  INTEGER*2     nEntries        !  2- Number of BCS_DP_Sync_Rec to follow   
   
\  byte          spare(12)       !  4- Spares   
END STRUCTURE                   ! 16- Total   
\endverbatim

\subsection{6.6 Road Map Section}

This section contains a record for every ``block'' in the Index/Data section.
The information in this section is a subset of the index structure (see that
structure for a full explanation of each field).

\verbatim
STRUCTURE       /BCS_Roadmap_Rec/   
\                                !     For a full description of the fields,   
\                                !     look at the Index_Rec definition   
   
\  integer*4     ByteSkip        ! 00- Offset in bytes from the beginning of   
\                                !     of the data file for the beginning   
\                                !     of the data set index structure.   
   
\  integer*4     time            ! 04- Time of data (millisec of day)   
\  integer*2     day             ! 08- Day of data (since 1-Jan-79)   
   
\  BYTE          blockID         ! 10- BCS Block ID                                              Derived   
\  BYTE          seqID           ! 11- Observation Sequence ID   
\  BYTE          ModeID          ! 12- Mode ID (Grouper Plan)   
\  BYTE          moderepnum      ! 13- Mode Repeat Number   
\  BYTE          dgi             ! 14- Data Gather Interval (125 msec units)   
\  BYTE          DP_Flags        ! 15- DP Flags received by BCS                                  (From Mode Header)   
\  BYTE          BCS_Status      ! 16- BCS Status                                                (From Mode Header)   
   
\  INTEGER*2     total_cnts(4)   ! 17- Total counts in each channel for the mode   
   
\  INTEGER*2     length          ! 25- Total No of bytes of data created by the plan   
\  BYTE          ControlTally    ! 27- Control Byte Tally   
   
\  byte          spare(4)        ! 28- Spares   
END STRUCTURE                   ! 32- Total   
\endverbatim

\newpage


\section{7.  HXT RAW DATA FILES (HDA)}

\verbatim
	File Identifier:		HDA
	Record Size:			16 bytes
\endverbatim

The HDA (HXT DAta) file is one of the reformatted data files which is written
by the reformattor.  The general layout of this and the other reformatted data
files is: 

\smallskip{\parskip=0pt
	\itemitem{1.} File Information / Pointer Section
	\itemitem{2.} File Header Section
	\itemitem{3.} Quasi-Static Index Section
	\itemitem{4.} Index/Data, Index/Data, \dots\ Section
	\itemitem{5.} Optional Section for HXA data
	\itemitem{6.} Road Map Section
}					% Resets \parskip

\subsection{7.1 Pointer Section}
	The pointer section is described in Section 4.1.  

\subsection{7.2 File Header}
	The File Header is described in Section 4.2.

\subsection{7.3 Quasi-Static Index Section}

	The structure QS\_General1\_Rec described in section 4.3 will be used.

\verbatim
STRUCTURE       /HXT_QS_Instr_Rec/   
\                                !       NOT IMPLEMENTED AS OF 25-Mar-92]   
   
\  integer*2     entry_type /'4011'x/   
\                                ! 00- Structure/Entry type   
   
\  integer*4     st_time         ! 02- Start time (millisec of day) entries are valid   
\  integer*2     st_day          ! 06- Start day (since 1-Jan-79)   
\  integer*4     en_time         ! 08- End time (millisec of day)   
\  integer*2     en_day          ! 12- End day (since 1-Jan-79)   
   
\  !TBD   
   
\  byte          spare(50)       ! 14- Spare   
END STRUCTURE                   ! 64- Total   
\endverbatim

\verbatim
STRUCTURE       /HXT_QS_Conv_Rec/   
\                                !       NOT IMPLEMENTED AS OF 25-Mar-92]   
   
\  integer*2     entry_type /'4021'x/   
\                                ! 00- Structure/Entry type   
   
\  integer*4     st_time         ! 02- Start time (millisec of day) entries are valid   
\  integer*2     st_day          ! 06- Start day (since 1-Jan-79)   
\  integer*4     en_time         ! 08- End time (millisec of day)   
\  integer*2     en_day          ! 12- End day (since 1-Jan-79)   
   
\  integer*4     off_dhk(2)      ! 14- Offset time in millisec from MF time for DHK data   
\  integer*4     off_pc(2)       ! 22- Offset time in millisec from MF time for PC data   
\  integer*4     off_ph(2)       ! 30- Offset time in millisec from MF time for PHA data   
\  integer*4     off_hxa(2)      ! 38- Offset time in millisec from MF time for HXA data   
\                                !       (1) = high rate; (2) = medium rate   
   
\  integer*4     energy(5)       ! 46- Energy conversion in 0.01 KeV   
\  integer*4     hv_conv(2)      ! 66- Conversion for high voltage in 0.01 KeV   
\                                !       (1) = intercept; (2) = slope   
\  integer*4     temp_conv(2)    ! 74- Conversion for temperature in 0.01 deg.   
\  integer*2     solution_ver    ! 82- Solution version   
   
\  byte          spare(44)       ! 84-   
END STRUCTURE                   !128- Total   
\endverbatim

[Add explanation of energy conversion "energy(5)" and conversion for HV and
temp]

\subsection{7.4 Index and Data Section}
	One index/data block for every major frame.  The digital house keeping
data is included in the index record.  The DHK PC (pulse count) data is only
seen in FL and QT modes and will come once per major frame (this is the low
energy channel only). 

\verbatim
STRUCTURE       /HXT_Index_Rec/   
\  integer*2     index_version /'4011'x/   
\                                !  0- Index structure version                                   Ground Info   
\                                !       AAAABBBB CCCCDDDD   
   
\  byte          Pow_stat(2)     !  2- Power status                                              W48 F32+1   
\                                !       b7 = HXT1 (electronics for 00 to 31)   
\                                !       b6 = HXT2 (electronics for 32 to 63)   
\                                !       b5 = OS memory status   
\                                !       b4 = HXA on/off   
\                                !       b3 = HXA cal   
\                                !       b2 = HXT cal   
\                                !       b1 = HV reduction fuction on/off (enable SAA HV on/off)   
\                                !            Usually HV is 900 V, reduced to ~0 V when on   
\                                !       b0 - HV enable (double command safety)   
\                                !            HV cannot go on until this is enabled   
\  byte          HV_stat(2)      !  4- HV Status on/off                                          W48 F32+17 (+29)   
\                                !       b7 = HV0 on/off for sensor 00 to 07   
\                                !       b6 = HV7 on/off for sensor 56 to 63   
\  byte          HXT_Mon(2)      !  6- Memory content of OS-Memory                               W49 F32+31   
\                                !       b7 = HXT1 (electronics for 00 to 31)   
\                                !       b6 = HXT2 (electronics for 32 to 63)   
\                                !       b5 = HXA on/off   
\                                !       b4 = Analog part of HXT-E on/off   
\                                !       b3 = HV reduction fuction on/off (enable SAA HV on/off)   
\                                !            Usually HV is 900 V, reduced to ~0 V when on   
\                                !       b2 = RBM flag (from DP)   
   
\  byte          gain_control(64)!  8- Electronics gain for each sensor                          W65   
\                                !       Hopefully changed only once a month   
\  byte          HV_control(8)   ! 72- HV setting                                                W49 F32+9,11,13,15   
\                                !       Hopefully changed only once a month   
   
\  byte          HV_values(8)    ! 80- High voltage values (HK monitor output)                   W32 F19-F26 (even MF #s)   
\                                !     (See quasi-static section for conversions)   
\  byte          temps(21)       ! 88- HXT Temperatures (HK monitor output)                      W32 F61-F63 (even MF #s)   
\                                !     (See quasi-static section for conversions)   
\                                !                                                               W32 F00-F17 (odd MF #s)   
\  byte          dhk_data(64)    !109- DHK PC Data (low energies)                                W64 F00-F63   
\                                !     In PC mode:   
\                                !       Integrated photon counts in low channel   
\                                !     In PH (cal) mode:   
\                                !       Sensor number (same value for 4 minor frames...)   
   
\  integer*2     sum_L           !173- Summation of all 64 subcollimator   
\                                !       counts (cnts/sec)   
\                                !     Low energy (15-24.4 KeV)   
\  integer*2     sum_M1          !175- Medium-1 energy (24.4-35.2 KeV) cnts/sec   
\  integer*2     sum_M2          !177- Medium-2 energy (35.2-56.8 KeV) cnts/sec   
\  integer*2     sum_H           !179- High energy (56.8-100 KeV) cnts/sec   
\  integer*2     sigma_L         !181- Standard deviation of low energy channels   
\                                !     of fan beam elements only.  Not corrected for   
\                                !     integration period.   
\                                !       Sensor #s: (octal)      00,01,04,05   
\                                !                               10,11,14,15   
\                                !                               60,61,64,65   
\                                !                               70,71,74,75   
\                                !     For PH mode .... TODO   
   
\  byte          dataRecTypes    !183- What data follows (setting bits)                          Derived   
\                                !       b7 = PC data follows   
\                                !       b6 = PH (cal) data follows   
\                                !       Derived from (W51 F7 b0:1) - Output from DP   
\                                !               00 = PC data   
\                                !               01 = Cal data   
\                                !               10 = Dummy   
\                                !               11 = Cal data   
\                                !       W51 F55 b5:6   
\                                !               b6 = calibration enable/disable   
\                                !               b5 = Telemetry allocation   
   
\  byte          spare(8)        !184- Spare   
END STRUCTURE                   !192- Total   
\endverbatim

	The PC (pulse count) data is only seen in FL and comes four times per
major frame. The PH (pulse height) data is only seen in calibration mode (uses
SXT telemetry and it uses the internal source).  The PH data takes four major
frames to come down, and will be broken into four parts with a data index for
each part.  PC and PH are exclusive to each other. 

\verbatim
STRUCTURE       /HXT_PC_Data_Rec/   
\                                !       hxt_pc(i,j,k)           i=energy band   
\                                !                               j=sensor #   
\                                !                               k=repetition #   
\  byte          pc_data(4,64,4) !   0- PC data   
END STRUCTURE                   !1024- Total   
\endverbatim

\verbatim
STRUCTURE       /HXT_PH_Data_Rec/   
\                                !       hxt_ph(i,j)             i=energy channel   
\                                !                               j=sensor #   
\  byte          ph_data(64,64)  !   0- PH data   
END STRUCTURE                   !4096- Total   
\endverbatim

\subsection{7.5 Instrument Optional Section}

	There are no optional sections for HXT.

\subsection{7.6 Road Map Section}

This section contains a record for every ``block'' in the Index/Data section.
The information in this section is a subset of the index structure (see that
structure for a full explanation of each field).

\verbatim
STRUCTURE       /HXT_RoadMap_Rec/   
\                                !     For a full description of the fields,   
\                                !     look at the Index_Rec definition   
   
\  integer*4     ByteSkip        ! 00- Start byte of index rec   
   
\  integer*4     time            ! 04- Major frame time (millisec of day)   
\  integer*2     day             ! 08- Major frame day (since 1-Jan-79)   
\  byte          Flare_Control   ! 14- Flare flag control (active triggers)   
\                                !     Copied from GEN_INDEX (needed here to put   
\                                !     into the observing log entry)   
\  byte          Flare_Status    ! 15- Flare flag status   
   
\  byte          DP_mode         ! 10- DP Mode   
\  byte          DP_rate         ! 11- DP Rate   
   
\  byte          Pow_stat        ! 12- Power status   
\  byte          HV_stat         ! 13- HV Status   
   
\  integer*2     sum_L           ! 14- Summation of Low energy counts (cnts/sec)   
\  integer*2     sum_M1          ! 16- Medium-1 energy   
\  integer*2     sum_M2          ! 18- Medium-2 energy   
\  integer*2     sum_H           ! 20- High energy   
\  integer*2     sigma_L         ! 22- Standard deviation of low energy channels   
   
\  byte          dataRecTypes    ! 24- What data follows   
\                                !TODO - Flag to show start of PH data ??   
   
\  byte          spare(5)        ! 25-   
END STRUCTURE                   ! 32   
\endverbatim

\newpage


\section{8.  SXT RAW DATA FILES (SDA)}

\verbatim
	File Identifier:		SDA
	Record Size:			16 bytes
\endverbatim

The SDA (SXT DAta) file is one of the reformatted data files which is written
by the reformattor.  The general layout of this and the other reformatted data
files is: 

\smallskip{\parskip=0pt
	\itemitem{1.} File Information / Pointer Section
	\itemitem{2.} File Header Section
	\itemitem{3.} Quasi-Static Index Section
	\itemitem{4.} Index/Data, Index/Data, \dots\ Section
	\itemitem{5.} Road Map Section
}					% Resets \parskip

\subsection{8.1 Pointer Section}
	The pointer section is described in Section 4.1.  

\subsection{8.2 File Header}
	The File Header is described in Section 4.2.

\subsection{8.3 Quasi-Static Index Section}

	The structure QS\_General1\_Rec described in section 4.3 will be used.

\verbatim
STRUCTURE       /SXT_QS_Instr_Rec/   
\                                !       NOT IMPLEMENTED AS OF 25-Mar-92]   
   
\  integer*2     entry_type /'3011'x/   
\                                ! 00- Structure/Entry type   
   
\  integer*4     st_time         ! 02- Start time (millisec of day) entries are valid   
\  integer*2     st_day          ! 06- Start day (since 1-Jan-79)   
\  integer*4     en_time         ! 08- End time (millisec of day)   
\  integer*2     en_day          ! 12- End day (since 1-Jan-79)   
   
\  integer*2     gain_const      ! 14- Camera gain constant (e/DN*100)   
   
\  character*11  DC_FileID       ! 16- Suggested dark current file name to be used   
   
\  integer*2     solution_ver    ! 27- Solution version   
   
\  byte          spare(3)        ! 29-   
END STRUCTURE                   ! 32- Total   
\endverbatim

\verbatim
STRUCTURE       /SXT_QS_Conv_Rec/   
\                                !       NOT IMPLEMENTED AS OF 25-Mar-92]   
   
\  integer*2     entry_type /'3021'x/   
\                                ! 00- Structure/Entry type   
   
\  integer*4     st_time         ! 02- Start time (millisec of day) entries are valid   
\  integer*2     st_day          ! 06- Start day (since 1-Jan-79)   
\  integer*4     en_time         ! 08- End time (millisec of day)   
\  integer*2     en_day          ! 12- End day (since 1-Jan-79)   
   
\  integer*2     temp_conv(10,2) ! 14- Conversion for temperature in 0.01 deg.   
   
\  integer*2     solution_ver    ! 54- Solution version   
   
\  byte          spare(8)        ! 56-   
END STRUCTURE                   ! 64- Total   
\endverbatim

\subsection{8.4 Index and Data Section}

	One data index will be created for each PFI (Partial Frame Image)
EXPOSURE (not each image).  The observing regions (``ORs'') that require
several exposures to make one image will have a different index for each
exposure.  There will be one data index for each ROI (Region of Interest) in a
multiple ROI FFI (Full Frame Image) (even though it only takes one exposure). 

	All references to image shape are in terms of 1x1 pixels (not the
current image summation)

\verbatim
STRUCTURE       /SXT_Index_Rec/   
\  integer*2     index_version /'3012'x/   
\                                !  0- Index structure version                                   Ground Info   
\                                !     (See GEN_INDEX for explanation)   
   
\  byte          pfi_ffi         !  2- Image information   
\                                !       b0:2 = Image type   
\                                !            0 = PFI ("raw" PFI strips - not assembled)         Derived   
\                                !            1 = FFI   
\                                !            2 = PFI (assembled ORs)   
\                                !            3 = FFI - Patrol image buffer dump   
\                                !               (b0=0 is PFI, b0=1 is FFI)   
\                                !       b3   = For FFI 0=BLS off, 1=BLS on                      W114 F00 B4   
\                                !       b4:7 = For PFI = "OR" expsoure #                        W114 F43   
\                                !       b4:7 = For FFI = ROI# of nROI                           Derived   
   
\                                !                                                                    PFI/FFI   
\  byte          periph          !  3- Aspect/shutter/filter information                         W114 F08/02   
\                                !       b7   = Aspect door (0=closed, 1=open)   
\                                !       b6   = Shutter mode (0=Frame Transfer, 1=Mech)   
\                                !       b3:5 = Filter B position   
\                                !               1 = Open   
\                                !               2 = Al 1400 Angstrom   
\                                !               3 = Al/Mg/Mn   
\                                !               4 = Ber 100 microns   
\                                !               5 = Al 12 microns   
\                                !               6 = Mg3Mu   
\                                !       b0:2 = Filter A position   
\                                !               1 = Open   
\                                !               2 = Narrow Band (4310 A, 30 A FWHM)   
\                                !               3 = Quartz defocusing lens ('photon flood')   
\                                !               4 = Diffuser   
\                                !               5 = Wide Band (4600 A, 185 A FWHM)   
\                                !               6 = Neutral Density Mask (8%)   
\  byte          ExpLevMode      !  4- Exposure mode/level                                       W114 F09/03   
\                                !       b6:7 = Exposure mode (0=normal, 1=dark, 2=LTF)   
\                                !       b0:5 = Mailbox exposure level   
\  byte          imgparam        !  5- Image parameter information                               W114 F24/18   
\                                !       b6:7 = Exposure cadence (0=2sec,1=1sec,2=.5sec)   
\                                !       b4:5 = Number of ROI (0=1 ROI, 1=2 ROI, ...)   
\                                !       b2:3 = Compression (0=Cmp, 1=Low8, 2=Hi8)   
\                                !       b0:1 = Image resolution (0=1x1,1=2x2,3=4x4)   
\  byte          flush           !  6- Flush information                                         W114 F40/34   
\                                !       b0:1 = Pre-exposure Full frame flushes (0-3)   
\                                !       b2:3 = Set-up full frame flushes   
\                                !               # flushes = 2*(b2:3 value) in ROM   
\                                !                       = 4*(b2:3 value) 30-sep-91 to 7-Oct-91?   
\                                !                       = 8*(b2:3 value) after 7-Oct-91   
\                                !       b4:7 = Guard band   
\  integer*4     explat          !  7- Exposure latency (mailbox value)                          W114 F10,F26/04,20   
\  integer*4     expdur          ! 11- Exposure duration (mailbox value)                         W114 F42,F58/36,52   
   
\  integer*2     shape_cmd(2)    ! 15- Commanded image shape (nx by ny)                          W114 F57,F57/xx,22   
\                                !       (the col,lin# are in summed (output) pixels)   
\                                !     For observing regions, the "ny" is the   
\                                !         full observing region size   
\                                !     For FFI, "nx" always = 1024, 512, or 256   
\                                !     For multiple ROI FFI "ny" is width of one ROI             W114 F38 or 54 or 23   
\  integer*2     shape_sav(2)    ! 19- Image shape saved (nx by ny)                              Derived   
\                                !       (the col,lin# are in summed (output) pixels)   
\                                !     For observing regions, "ny" always = 64   
\  integer*2     corner_cmd(2)   ! 23- Commanded starting corner (x0, y0)                        W114 F27,11/21   
\                                !       (the col,lin# are in 1x1 pixels)   
\                                !       The values are CCD column numbers and are NOT   
\                                !       reversed.  The SXT images have been reversed before   
\                                !       being written to disk so CCD column 0 is to the   
\                                !       right (high indcies) in the image array   
\                                !   
\                                !       Col 0 is "image-0", col 1 is "image-1"   
\                                !       in figure on page 97 of blue book.  Neither   
\                                !       of these pixels are summed in summation mode   
\                                !     For FFI, "x0" always = 0 (but check BLS on/off)   
\                                !     For multiple ROI FFI "y0" is the start of one ROI         W114 F37 or 53 or 07   
\  integer*2     corner_sav(2)   ! 27- Starting corner saved (x0, y0)                            Derived   
\                                !       (the col,lin# are in 1x1 pixels)   
   
\  integer*2     FOV_Center(2)   ! 31- Pitch and yaw relative to the sun center                  Derived   
\                                !     of the center of the SXT FOV (in arcsec)   
\                                !     (for the PFI strip, not the OR)   
\                                !       (1) = yaw; (2) = pitch   
\                                !     (used to relate to active region list)   
\                                !       Temporary Definition:   
\                                !               yaw   = (512 - center_fov(0))*2.45   
\                                !               pitch = (center_fov(1) - 638)*2.45   
\                                !          where center_fov is pixel location in 1x1   
\                                !          pixels (not including the BLS pixels)   
\  integer*2     FOV_Ver         ! 35- Information on how solution was derived                   Ground Info   
   
\  byte          ObsRegion       ! 37- Observing region Number                                   W114 F50   
\                                !       b6:7 = FFI Seq Table # (0-3)   
\                                !               From Entry Table   
\                                !       b4:5 = PFI Seq Table # (0-3)   
\                                !       b0:3 = Observing region number (0-8)   
\                                !               Location # on the sun   
\                                !               (0-3) Updated by QT ARS   
\                                !               (4-7) Updated manually (with ART option)   
\                                !               (8)   Updated by FL ARS   
\  byte          seq_num         ! 38- Sequence Number (1-13)                                    W114 F59/55   
\                                !       b0:3 = Entry in sequence table (1-13)   
\                                !       b4:7 = Word or line sync error bits   
\  integer*2     seq_tab_serno   ! 39- Sequence table serial used                                Ground Info   
   
\  integer*4     serial_num      ! 41- Serial number of image                                    W115 F18,34,50/16,32,48   
\  integer*4     mloop           ! 45- Main loop counter                                         W115 F19,35,51/02,03   
\  byte          loops(4)        ! 49- Loop counters     (1) = loop 2                            W115 F04/01   
\                                !                       (2) = loop 3                            W115 F20/17   
\                                !                       (3) = loop 4                            W115 F36/33   
\                                !                       (4) = loop 5                            W115 F52/49   
   
\  byte          Pow_stat        ! 53- Power Status (0=off, 1=on)                                W48  F25   
\                                !       b7 = 5 Volts   
\                                !       b6 = 28 Volts   
\                                !       b5 = Filter Wheel   
\                                !       b4 = Shutter / Aspect Controller   
\                                !       b3 = Micro A Select   
\                                !       b2 = Micro B Select   
\                                !       b1 = Camera   
\                                !       b0 = Thermoelectric Cooler (TEC)   
\  byte          SW_stat         ! 54- Active Software (1=active)                                W114 F12   
\                                !       b7 = Quiet ARS on/off   
\                                !       b6 = Quiet ARS 1 or 2   
\                                !       b5 = Flare ARS on/off   
\                                !       b4 = ARS morning patrol on/off   
\                                !       b3 = AEC patrol on/off   
\                                !       b2 = ART on/off   
\                                !       b1 = ART   
\                                !       b0 = ART   
\  byte          SXT_Control     ! 55- SXT Control Status                                        W114 F32   
\                                !       b7   = Power control mode (1=auto, 0=manual)   
\                                !       b6   = SXT control mode (1=auto, 0=manual)   
\                                !       b4:5 = SXT day/night mode   
\                                !               00 = SXT day mode   
\                                !               01 = SXT evening mode   
\                                !               10 = SXT night mode   
\                                !               11 = SXT morning mode   
\                                !       b1   = SXTE-U hard reset (1=executed)   
\                                !       b0   = SXTE-U soft reset (1=executed)   
\  byte          sxtfmt          ! 56- SXT Format info 8:2 or 2:8                                W115 F00   
   
\  byte          temp_ccd        ! 57- CCD Temperature                                           W113 F52   
\                                !     Value is actually 1 MF out of sync?   
\  byte          temp_hk(20)     ! 58- House keeping temperature                                 W32 F18-26 SF2n+1   
\                                !     (See quasi-static section for conversions)   
\                                !       temp_hk(0) = TEC hot end                                W32 F18 SF2n+1   
\                                !       temp_hk(1) = CCD camera head                            W32 F19 SF2n+1   
\                                !       temp_hk(2) = Filter wheel housing                       W32 F20 SF2n+1   
\                                !       temp_hk(3) = Forward support plate                      W32 F21 SF2n+1   
\                                !       temp_hk(4) = Aspect Telescope (NOT FUNCTIONING)         W32 F22 SF2n+1   
\                                !       temp_hk(5) = Metering tube center                       W32 F23 SF2n+1   
\                                !       temp_hk(6) = Filter wheel hub (aft                      W32 F24 SF2n+1   
\                                !       temp_hk(7) = Shutter motor case                         W32 F25 SF2n+1   
\                                !       temp_hk(8) = TSA (thermal strap) S/C end                W32 F26 SF2n+1   
\                                !       temp_hk(9)  = Upper Panel Sensor 4 (UP-4)               W32 F42 SF2n+1   
\                                !       temp_hk(10) = Cemter Panel Sensor 1 (CP-1)              W32 F55 SF2n+1   
\                                !       temp_hk(11) = Center Panel Sensor 2 (CP-2)              W32 F56 SF2n+1   
\                                !       temp_hk(12) = Center Panel Sensor 3 (CP-3)              W32 F57 SF2n+1   
\                                !       temp_hk(13) = Base Panel Sensor 4 (BP-4)                W32 F61 SF2n+1   
\                                !       temp_hk(14) = (spare)   
\                                !       temp_hk(15) = (spare)   
\                                !       temp_hk(16) = (spare)   
\                                !       temp_hk(17) = (spare)   
\                                !       temp_hk(18) = (spare)   
   
\  byte          HW_error(2)     ! 78- Hardware error since last exposure                        W113 F07,23 ?   
\  byte          j_register      ! 80- Which buffer is used                                      W114 F33?   
   
\  byte          Img_Max         ! 81- Maximum intensity                                         Derived   
\                                !     (0-255, high 8 bits)   
\                                !     The image is decompressed first where necessary   
\  byte          Img_Avg         ! 82- Average intensity of whole image                          Derived   
\                                !       1x1 - first subtract 12.8 DN offset   
\                                !       2x4 - first subtract 30.7 DN offset   
\                                !       4x4 - first subtract 73.6 DN offset   
\                                !     (0-255, high 8 bits)   
\                                !     The image is decompressed first where necessary   
\  byte          Img_Dev         ! 83- Standard deviation of the whole image                     Derived   
\                                !     (0-255) - Not scaled   
\                                !     The image is decompressed first where necessary   
\  byte          PercentD        ! 84- Percentage of data present                                Derived   
\                                !     (value 255 = 100%)   
\  byte          PercentOver     ! 85- Percentage of data over [N] counts                        Derived   
\                                !     (value 255 = 100%)   
\                                !       1x1 - the # pixels over 2000 DN (decompressed)   
\                                !       2x2 - the # pixels over 3500 DN (decompressed)   
\                                !       4x4 - the # pixels over 3500 DN (decompressed)   
   
\  byte          AEC_Status      ! 86- AEC Status                                                W114 F44   
\                                !       NOTE: True only for the LAST "PFI Strip" in   
\                                !             an observing region   
\                                !       b4:7 = Maximum number of selcted regions   
\                                !              in AT ARS1 (0-4)   
\                                !       b2:3 = AEC Status of PFI-AEC   
\                                !               00b = proper   
\                                !               01b = Over exposure   
\                                !               10b = Under exposure   
\                                !       b0:1 = AEC Status of Patrol-AEC   
\                                !               (see PFI-AEC above)   
\  byte          spare(9)        ! 87- Spare bytes   
END STRUCTURE                   ! 96- Total   
\endverbatim

There is additional information available in the ground based data.  When
accessing ground based data that has been converted to the SDA format, there
is an additional index structure which follows the ``standard'' index 
structure.  The ground based structure is as follows:

\verbatim
STRUCTURE       /SXT_Gnd_Idx_Rec/   
\  integer*2     index_version /'3021'x/   
\                                ! 00- Index structure version   
   
\  character*16  filename        !  2- MicroVAX file name   
   
\  character*6   experiment      ! 18- Description of experiment   
\  character*6   source          ! 24- Description of the source   
\  character*6   ccddev          ! 30- CCD used   
   
\  integer*4     x_pos           ! 36- Translation Stage X Position   
\  integer*4     y_pos           ! 40- Translation Stage Y Position   
\  integer*4     z_pos           ! 44- Translation Stage Z Position   
   
\  real*4        az              ! 48- Azimuth of MSFC optical bench   
\  real*4        el              ! 52- Azimuth of MSFC optical bench   
\  real*4        cexp            ! 56- Commanded exposure duration (sec)   
\  real*4        aexp            ! 60- Actual exposure duration (sec)   
   
\  character*6   filta           ! 64- Filter A name (since filters were changed over testing period)   
\  character*6   filtb           ! 70- Filter B name   
   
\  character*16  soufilename     ! 76- MicroVAX source file name   
\                                !     (for cases of dark current subtraction)   
\  character*16  dcfilename      ! 92- MicroVAX dark current file name   
\                                !     (for cases of dark current subtraction)   
   
\  byte          spare(20)       !108- Spare bytes   
END STRUCTURE                   !128- Total   
\endverbatim

There will be SXT data files where processing has been performed on an image.
When processing has been performed on a file, an additional structure is 
required to track what processing is done.  The order of the index structure
entries is the order in which the operations were performed.

\verbatim
STRUCTURE       /SXT_Proc_Idx_Rec/   
\  integer*2     index_version /'3031'x/   
\                                !  0- Index structure version                                   Ground Info   
\  byte          operation       !  2- Operation performed (1=that action was performed)   
\                                !       1 = Subtraction ("other" image time   
\                                !           is for the dark current image   
\                                !       2 = Flat fielding / normalization   
\                                !       3 = Ratioing   
\                                !       4 = Registration   
\                                !       5 = Summation / Mosaic   
\                                !       6 = Extracted only a portion of FFI   
\                                !       7 = Zoom (change plate scale size)   
\  integer*2     tech_ver        !  3- Technique version   
\                                !       AAAABBBB CCCCDDDD   
\  integer*4     time            !  5- Time (millisec of day) of "other" image   
\                                !     with which the operation was performed   
\  integer*2     day             !  9- Day (since 1-Jan-79) of "other" image   
   
\  byte          spare(21)       ! 11- Spare bytes   
END STRUCTURE                   ! 32- Total   
\endverbatim

The data is a two dimensional array.  The size of the array is defined in the
index structure.  The reading routine will return a 2-D array if only one 
data set is read, or a 3-D array if many data sets are read (where the length
of the third dimension is the number of datasets extracted) 

\subsection{8.5 Instrument Optional Section}

	There are no optional sections for SXT.

\subsection{8.6 Road Map Section}

This section contains a record for every ``block'' in the Index/Data section.
The information in this section is a subset of the index structure (see that
structure for a full explanation of each field).

\verbatim
STRUCTURE       /SXT_RoadMap_Rec/   
\                                !     For a full description of the fields,   
\                                !     look at the Index_Rec definition   
   
\  integer*4     ByteSkip        ! 00- Offset in bytes from the beginning of   
\                                !     of the data file for the beginning   
\                                !     of the data set index structure.   
   
\  integer*4     time            ! 04- Major frame time (millisec of day)   
\  integer*2     day             ! 08- Major frame day (since 1-Jan-79)   
   
\  byte          DP_mode         ! 10- DP Mode   
\  byte          DP_rate         ! 11- DP Rate   
   
\  byte          pfi_ffi         ! 12- Image information   
\  byte          periph          ! 13- Aspect/Shutter/Filter information   
\  byte          ExpLevMode      ! 14- Exposure mode/level   
\  byte          imgparam        ! 15- Image parameter information   
   
\  byte          ObsRegion       ! 16- Observing region Number   
\  byte          seq_num         ! 17- Sequence Number (1-13)   
   
\  integer*2     shape_cmd(2)    ! 18- Commanded image shape (nx by ny)   
\  integer*2     FOV_Center(2)   ! 22- Pitch and yaw relative to the sun center   
\                                !     of the center of the SXT FOV (in arcsec)   
   
\  byte          Img_Max         ! 26- Maximum intensity   
\  byte          Img_Avg         ! 27- Average intensity of whole image   
\  byte          Img_Dev         ! 28- Average intensity around the max   
\  byte          PercentD        ! 29- Percentage of data present   
\  byte          PercentOver     ! 30- Percentage of data over [N] counts   
   
\  byte          Flare_Status    ! 31- Flare flag status   
   
\  integer*4     serial_num      ! 32- Serial number of image   
\                                !     ** NOT INCLUDED IN OBSERVING LOG **   
\  byte          AEC_Status      ! 36- AEC Status   
\                                !     ** NOT INCLUDED IN OBSERVING LOG **   
\  integer*2     seq_tab_serno   ! 37- Sequence table serial used   
\  byte          spare2(9)       ! 39- Spare bytes   
END STRUCTURE                   ! 48 Total   
\endverbatim

\newpage


\section{9.  WBS RAW DATA FILES (WDA)} 

\verbatim
	File Identifier:		WDA
	Record Size:			16 bytes
\endverbatim

The WDA (WBS DAta) file is one of the reformatted data files 
which is written by the reformattor.  The general layout of this and the other
reformatted data files is:

\smallskip{\parskip=0pt
	\itemitem{1.} File Information / Pointer Section
	\itemitem{2.} File Header Section
	\itemitem{3.} Quasi-Static Index Section
	\itemitem{4.} Index/Data, Index/Data, \dots\ Section
	\itemitem{5.} Road Map Section
}					% Resets \parskip

\subsection{9.1 Pointer Section}
	The pointer section is described in Section 4.1.  

\subsection{9.2 File Header}
	The File Header is described in Section 4.2.

\subsection{9.3 Quasi-Static Index Section}

	The structure QS\_General1\_Rec described in section 4.3 will be used.

\verbatim
STRUCTURE       /WBS_QS_Instr_Rec/   
\                                !       NOT IMPLEMENTED AS OF 25-Mar-92]   
   
\  integer*2     entry_type /'5011'x/   
\                                ! 00- Structure/Entry type   
   
\  integer*4     st_time         ! 02- Start time (millisec of day) entries are valid   
\  integer*2     st_day          ! 06- Start day (since 1-Jan-79)   
\  integer*4     en_time         ! 08- End time (millisec of day)   
\  integer*2     en_day          ! 12- End day (since 1-Jan-79)   
   
\  byte          gain(32)        ! 14- Gain information                                          W49 F32n+1,3,5,7,17,19,21,23   
   
\  byte          spare(18)       ! 46-   
END STRUCTURE                   ! 64- Total   
\endverbatim

\verbatim
STRUCTURE       /WBS_QS_Offset_Rec/     ! Start time (offset?) of 1st PC data   
\                                !       NOT IMPLEMENTED AS OF 25-Mar-92]   
   
\  integer*2     entry_type /'5021'x/   
\                                ! 00- Structure/Entry type   
   
\  integer*4     st_time         ! 02- Start time (millisec of day) entries are valid   
\  integer*2     st_day          ! 06- Start day (since 1-Jan-79)   
\  integer*4     en_time         ! 08- End time (millisec of day)   
\  integer*2     en_day          ! 12- End day (since 1-Jan-79)   
   
\  integer*4     sxs_pc          ! 14- SXS offset relative to the time in the main   
\                                !     index record.  The units are in increments   
\                                !     of 1 microsec.  The delay is mainly due   
\                                !     to the DP software.   
\  integer*4     hxs_pc          ! 18- hxs offset   
\  integer*4     grs_pc1         ! 22- grs1 offset   
\  integer*4     grs_pc2         ! 26- grs2 offset   
\  integer*4     rbm_pc          ! 30- rbm offset   
\  integer*4     gbd_pc          ! 34- gbd offset   
\  integer*4     dhk             ! 38- dhk offset   
   
\  integer*2     solution_ver    ! 42- Solution version   
   
\  byte          spare(20)       ! 44-   
END STRUCTURE                   ! 64 Total   
\endverbatim

\verbatim
STRUCTURE       /WBS_QS_Del_Rec/        !Time between Samples   
\                                        ![two values ? one for hi, one for med]   
   
\                                !       NOT IMPLEMENTED AS OF 25-Mar-92]   
\  integer*2     entry_type /'5031'x/   
\                                ! 00- Structure/Entry type   
   
\  integer*4     st_time         ! 02- Start time (millisec of day) entries are valid   
\  integer*2     st_day          ! 06- Start day (since 1-Jan-79)   
\  integer*4     en_time         ! 08- End time (millisec of day)   
\  integer*2     en_day          ! 12- End day (since 1-Jan-79)   
   
\  integer*4     sxs_pc          ! 14- SXS interval between samples in units of   
\                                !     microseconds.  The values include   
\                                !     corrections for satellite clock variations.   
\  integer*4     hxs_pc          ! 18- hxs interval   
\  integer*4     grs_pc1         ! 22- grs1 interval   
\  integer*4     grs_pc2         ! 26- grs2 interval   
\  integer*4     rbm_pc          ! 30- rbm interval   
\  integer*4     gbd_pc          ! 34- gbd interval   
\  integer*4     dhk             ! 38- dhk interval   
   
\  integer*2     solution_ver    ! 42- Solution version   
   
\  byte          spare(20)       ! 44-   
END STRUCTURE                   ! 64 Total   
\endverbatim

\verbatim
STRUCTURE       /WBS_QS_Conv1_Rec/      ! Conversion Factors for PH data   
\                                !       NOT IMPLEMENTED AS OF 25-Mar-92]   
\  integer*2     entry_type /'5041'x/   
\                                ! 00- Structure/Entry type   
   
\  integer*4     st_time         ! 02- Start time (millisec of day) entries are valid   
\  integer*2     st_day          ! 06- Start day (since 1-Jan-79)   
\  integer*4     en_time         ! 08- End time (millisec of day)   
\  integer*2     en_day          ! 12- End day (since 1-Jan-79)   
   
\  integer*4     sxs_ph0         ! 14- energy * 0.01 keV   
\  integer*4     sxs_phw         ! 18- width  * 0.001 keV/ch   
\  integer*4     hxs_ph0         ! 22- base   * 0.01 sq(keV)   
\  integer*4     hxs_phw         ! 26- width  * 0.01 sq(keV)/ch   
\  integer*4     hxs_chw         ! 30- Factor * 0.001   
\  integer*4     rbm_ph0         ! 34- base   * 0.01 sq(keV)   
\  integer*4     rbm_phw         ! 38- width  * 0.01 sq(keV)/ch   
\  integer*4     rbm_chw         ! 42- Factor * 0.001   
\  integer*4     grs1_ph0        ! 46- base   * 0.01 sq(keV)   
\  integer*4     grs1_phw        ! 50- width  * 0.01 sq(keV)/ch   
\  integer*4     grs1_chw        ! 54- Factor * 0.01   
\  integer*4     grs2_ph0        ! 58- base   * 0.01 sq(keV)   
\  integer*4     grs2_phw        ! 62- width  * 0.01 sq(keV)/ch   
\  integer*4     grs2_chw        ! 66- Factor * 0.01   
\  integer*4     grsh_ph0        ! 70- energy *10.0 keV   
\  integer*4     grsh_phw        ! 74- width  * 1.00 keV/ch   
   
\  integer*2     solution_ver    ! 78- Solution version   
   
\  byte          spare(48)       ! 80-   
END STRUCTURE                   !128 Total   
\endverbatim

\smallskip\noindent
The conversion equation from the PH data to energy is as follows:

\verbatim
\ SXS(ith ch):  Energy (in keV)	= 0.01*SXS_PH0 + 0.001*i*(SXS_PHW)
\ HXS(ith ch):  Energy (in keV)	= 0.01*HXS_CHW * (.01*i*HXS_PHW + HXS_PH0)**2
\ RBM(ith ch):  Energy (in keV)	= 0.01*RBM_CHW * (.01*i*RBM_PHW + RBM_PH0)**2
\ GRS(ith ch):  Energy (in keV)	= 0.01*GRS_CHW * (.01*i*GRS_PHW + GRS_PH0)**2
\ GRH(ith ch):  Energy (in keV)	= 10.0*GRSH_PH0 + i*GRSH_PHW            (i<8)
\                               = 10.0*GRSH_PH0 + (2*i-8)*GRSH_PHW	(i>7)

\endverbatim

\smallskip\noindent
The real conversion coefficients may be varied during an orbit by sending BC's;
this can be followed by tracing the change of PI-OS words in the reformatted
data.  The conversion factors corresponding to these change will be given as a
following table. 

\verbatim
STRUCTURE       /WBS_QS_Conv2_Rec/      ! Conversion Factors for AHK data   
\                                !       NOT IMPLEMENTED AS OF 25-Mar-92]   
\  integer*2     entry_type /'5051'x/   
\                                ! 00- Structure/Entry type   
   
\  integer*4     st_time         ! 02- Start time (millisec of day) entries are valid   
\  integer*2     st_day          ! 06- Start day (since 1-Jan-79)   
\  integer*4     en_time         ! 08- End time (millisec of day)   
\  integer*2     en_day          ! 12- End day (since 1-Jan-79)   
   
\  integer*2     sxs_hv0         ! 14- voltage * 0.1 volts   
\  integer*2     sxs_hvc         ! 16- voltage * 0.01 volts/chan   
\  integer*2     hxs_hv0         ! 18- voltage * 0.1 volts   
\  integer*2     hxs_hvc         ! 20- voltage * 0.01 volts/chan   
\  integer*2     grs1_hv0        ! 22- voltage * 0.1 volts   
\  integer*2     grs1_hvc        ! 24- voltage * 0.01 volts/chan   
\  integer*2     grs2_hv0        ! 26- voltage * 0.1 volts   
\  integer*2     grs2_hvc        ! 28- voltage * 0.01 volts/chan   
\  integer*2     rbm_hv0         ! 30- voltage * 0.1 volts   
\  integer*2     rbm_hvc         ! 32- voltage * 0.01 volts/chan   
\  integer*2     sxst_tm0        ! 34- temp * 0.01 degrees   
\  integer*2     sxst_tmc        ! 36- temp * 0.01 degrees/chan   
\  integer*2     hxst_tm0        ! 38- temp * 0.01 degrees   
\  integer*2     hxst_tmc        ! 40- temp * 0.01 degrees/chan   
\  integer*2     grst_tm0        ! 42- temp * 0.01 degrees   
\  integer*2     grst_tmc        ! 44- temp * 0.01 degrees/chan   
\  integer*2     rbmt_tm0        ! 46- temp * 0.01 degrees   
\  integer*2     rbmt_tmc        ! 48- temp * 0.01 degrees/chan   
   
\  integer*2     solution_ver    ! 50- Solution version   
   
\  byte          spare(12)       ! 52-   
END STRUCTURE                   ! 64 Total   
\endverbatim

The conversion equation for the high voltage is:

\verbatim
	High_Voltage (ith ch) = HV0 + i*HVC	(volts)

\endverbatim

The conversion equation for the temperature is:

\verbatim
	Temperature (ith ch) = TM0 + i*TMC 	(degrees)

\endverbatim

\subsection{9.4 Index and Data Section}
	There is one index section (and matching data section) for every two
major frames. 

NOTE: The WBS instrument uses a analog to digital converter which produces an
UNSIGNED 16 bit value.  When using certain PC data, care should be taken 
to correct for data that exceeds $2^{15}$.  These values will show up as 
negatives and can be corrected by changing the variable to an INTEGER*4 and
adding $2^{16}$.  

\verbatim
STRUCTURE       /WBS_Index_Rec/   
\  integer*2     index_version /'5011'x/   
\                                !  0- Index structure version                                   Ground Info   
\                                !       AAAABBBB CCCCDDDD   
   
\  byte          pow_stat(2)     ! 02- Power status                                              W48 F32n+2   
\                                !       b7 = WBS HV enable/disable   
\                                !       b6 = WBS on/off (set=on)   
\                                !       b5 = WBS-A on/off (set=on)   
\                                !       b4 = SXS-HV on/off (set=on)   
\                                !       b3 = HXS-HV on/off (set=on)   
\                                !       b2 = GRS-HV1 on/off (set=on)   
\                                !       b1 = GRS-HV2 on/off (set=on)   
\                                !       b0 = RBM-HV on/off (set=on)   
\  byte          gbd_status1     ! 04- [TODO - ADD INFO]                                         W50 F63   
\  byte          gbd_status2     ! 05-                                                           W50 F47   
\                                !       b5   = block 1?   
\                                !       b4   = block 0?   
\                                !       b0:3 = ?   
\                                !     [TODO - ADD INFO]   
\  byte          PIOS(8,2)       ! 06- WBS control   
\                                !       (0,*) = GRS1 Control                                    W49 F32n+1   
\                                !          b6:7 = HV control   
\                                !               00 = 750 V (default)   
\                                !               01 = 720 V   
\                                !               10 = 780 V   
\                                !               11 = 810 V   
\                                !          b4:5 = Amp-L Gain   
\                                !               00 = X1 (What is this? TODO??)   
\                                !               01 = 1.11   
\                                !               10 = 1.22   
\                                !               11 = 1.33   
\                                !          b2:3 = Amp-H Gain   
\                                !               00 = X1 (What is this? TODO??)   
\                                !               01 = 1.11   
\                                !               10 = 1.22   
\                                !               11 = 1.33   
\                                !          b1   = CAL discriminator (set=60 keV, low=30 KeV)   
\                                !          b0   = CAL disabled/enabled   
\                                !       (1,*) = GRS2 Control                                    W49 F32n+3   
\                                !          b6:7 = HV control   
\                                !               00 = 700 V (default)   
\                                !               01 = 670 V   
\                                !               10 = 730 V   
\                                !               11 = 760 V   
\                                !          b4:5 = Amp-L Gain   
\                                !               00 = X1 (What is this? TODO??)   
\                                !               01 = 1.11   
\                                !               10 = 1.22   
\                                !               11 = 1.33   
\                                !          b2:3 = Amp-H Gain   
\                                !               00 = X1 (What is this? TODO??)   
\                                !               01 = 1.11   
\                                !               10 = 1.22   
\                                !               11 = 1.33   
\                                !       (2,*) HXS Control                                       W49 F32n+5   
\                                !          b6:7 = HV control   
\                                !               00 = 730 V (default)   
\                                !               01 = 700 V   
\                                !               10 = 760 V   
\                                !               11 = 790 V   
\                                !          b4:5 = Amp Gain   
\                                !               00 = X1 (What is this? TODO??)   
\                                !               01 = 1.13   
\                                !               10 = 1.30   
\                                !               11 = 0.43   
\                                !          b2   = MD Control (high=100 keV, low=50 keV)   
\                                !          b1   = CAL discriminator (high=1.0 MeV, low=0.5 MeV)   
\                                !          b0   = CAL enable/disable   
\                                !       (3,*) = BC-DATA                                         W49 F32n+7   
\                                !       (4,*) = RBM Control                                     W49 F32n+17   
\                                !          b6:7 = HV control   
\                                !               00 = 1250 V (default)   
\                                !               01 = 1200 V   
\                                !               10 = 1300 V   
\                                !               11 = 1350 V   
\                                !          b4:5 = Amp Gain   
\                                !               00 = X1 (What is this? TODO??)   
\                                !               01 = 1.15   
\                                !               10 = 1.30   
\                                !               11 = 0.55   
\                                !          b2:3 = SSD Discrimination levels   
\                                !               00 = 20 keV (default)   
\                                !               01 = 40 keV   
\                                !               10 = 70 keV   
\                                !               11 = 90 keV   
\                                !          b1   = MD Control (high=100 keV, low=50 keV)   
\                                !          b0   = SSD off/on   
\                                !       (5,*) = SXS1 Control                                    W49 F32n+19   
\                                !          b6:7 = HV control   
\                                !               00 = 2300 V (default)   
\                                !               01 = 2250 V   
\                                !               10 = 2350 V   
\                                !               11 = 24000 V   
\                                !          b4:5 = Amp Gain   
\                                !               00 = X1 (What is this? TODO??)   
\                                !               01 = 1.11   
\                                !               10 = 1.22   
\                                !               11 = 1.33   
\                                !          b2:3 = MD1 Control   
\                                !               00 =  7.5 keV (default)   
\                                !               01 = 10.0 keV   
\                                !               10 = 12.5 keV   
\                                !               11 = 15.0 keV   
\                                !          b0:1 = MD2 Control   
\                                !               00 = 15.0 keV (default)   
\                                !               01 = 20.0 keV   
\                                !               10 = 25.0 keV   
\                                !               11 = 30.0 keV   
\                                !       (6,*) = SXS2 Control                                    W49 F32n+21   
\                                !          b7   = RBM Flag (set=on)   
\                                !          b4:5 = Amp Gain   
\                                !               00 = X1 (What is this? TODO??)   
\                                !               01 = 1.11   
\                                !               10 = 1.22   
\                                !               11 = 1.33   
\                                !          b2:3 = MD1 Control   
\                                !               00 =  7.5 keV (default)   
\                                !               01 = 10.0 keV   
\                                !               10 = 12.5 keV   
\                                !               11 = 15.0 keV   
\                                !          b0:1 = MD2 Control   
\                                !               00 = 15.0 keV (default)   
\                                !               01 = 20.0 keV   
\                                !               10 = 25.0 keV   
\                                !               11 = 30.0 keV   
\                                !       (7,*) = BC-DATA                                         W49 F32n+23   
\  byte          ahk_hv(5)       ! 22- Analog house keeping (AHK) voltages                       W32 F27,28,29,30,31   
\                                !       (0) = SXS HV (0-5 V)   
\                                !       (1) = HXS HV   
\                                !       (2) = GRS HV1   
\                                !       (3) = GRS HV2   
\                                !       (4) = RBM HV   
\  byte          ahk_temp(4)     ! 27- Analog house keeping (AHK) Temperatures                   W32 F91,92,93,94   
\                                !       (0) = SXS Temperature   
\                                !       (1) = HXS Temperature   
\                                !       (2) = GRS Temperature   
\                                !       (3) = RBM Temperature   
\  byte          bcs_a_temp      ! 31- TODO - why is this here?                                  W32 F95   
   
\  integer*2     sxs1            ! 32- SXS2 channel 1 counts per sec.  (3-15 keV)                Derived   
\                                !     Only SXS_PC21 are totaled   
\                                !     NOTE: For reformatter Ver 1.06 and before,   
\                                !           the data stored here was for PC12   
\  integer*2     sxs2            ! 34- SXS2 channel 2 counts per sec.  (15-40 keV)               Derived   
\                                !     Only SXS_PC22 are totaled   
\                                !     NOTE: For reformatter Ver 1.06 and before,   
\                                !           the data stored here was for PC21   
\  integer*2     hxs             ! 36- HXS counts per sec.  (20-600 keV)                         Derived   
\                                !     HXS_PC1 and HXS_PC2 are totaled   
\                                !     Data is decompressed first   
\  integer*2     grs1            ! 38- GRS1 counts per sec.  (0.2-0.7 MeV)                       Derived   
\                                !     GRS_PC11 and GRS_PC21 are totaled   
\                                !     Data is decompressed first   
\  integer*2     grs2            ! 40- GRS2 counts per sec.  (0.7-4 MeV)                         Derived   
\                                !     GRS_PC12 and GRS_PC22 are totaled   
\                                !     Data is decompressed first   
\  integer*2     rbmsc           ! 42- RBMSC counts per sec. (5-300 keV)                         Derived   
\                                !     PC1 and PC2 are totaled   
\  integer*2     rbmsd           ! 44- RBMSD counts per sec. (20 keV)                            Derived   
\  integer*2     unit_time       ! 46- Unit time (in .01 sec)                                    Derived   
   
\  byte          dataRecTypes    ! 48- What data follows (set bits)   
\                                !               b0 = wbs_dhk_data_rec   
\                                !               b1 = wbs_pc_data_rec   
\                                !               b2 = wbs_ph_data_rec   
\  byte          nmf             ! 49- "Which" major frames are in the following data   
\                                !               b0 = First half (even MF #s)   
\                                !               b1 = Second half (odd MF #s)   
\                                !       A value of (3) says there are 2 MF of data   
\  byte          spare(14)       ! 50   
END STRUCTURE                   ! 64- Total   
\endverbatim

	The following structures describe the possible WBS data structures. 
The data will be saved in the compressed format that is telemetered down from
the spacecraft. 

\verbatim
STRUCTURE       /WBS_DHK_Data_Rec/      !Digital House Keeping (DHK)   
\  byte          sxs_ud1(8)      !   0- [add words - elaborate]                                  W67 F16n+0   
\  byte          sxs_adct1(8)    !   8- [add words - elaborate]                                  W67 F16n+2   
\  byte          sxs_ud2(8)      !  16- [add words - elaborate]                                  W67 F16n+1   
\  byte          sxs_adct2(8)    !  24- [add words - elaborate]                                  W67 F16n+3   
\  byte          hxs_ud(8)       !  32- [add words - elaborate]                                  W67 F16n+4   
\  byte          hxs_adct(8)     !  40- [add words - elaborate]                                  W67 F16n+6   
\  byte          hxs_cal(8)      !  48- [add words - elaborate]                                  W67 F16n+5   
\  byte          grs_udh1(8)     !  56- [add words - elaborate]                                  W67 F16n+7   
\  byte          grs_adclt1(8)   !  64- [add words - elaborate]                                  W67 F16n+10   
\  byte          grs_adcht1(8)   !  72- [add words - elaborate]                                  W67 F16n+12   
\  byte          grs_udh2(8)     !  80- [add words - elaborate]                                  W67 F16n+8   
\  byte          grs_adclt2(8)   !  88- [add words - elaborate]                                  W67 F16n+11   
\  byte          grs_adcht2(8)   !  96- [add words - elaborate]                                  W67 F16n+13   
\  byte          grs_cal(8)      ! 104- [add words - elaborate]                                  W67 F16n+9   
\  byte          rbm_sc_ud(8)    ! 112- [add words - elaborate]                                  W67 F16n+14   
\  byte          rbm_sc_adct(8)  ! 120- [add words - elaborate]                                  W67 F16n+15   
END STRUCTURE                   ! 128 Total   
\endverbatim

\verbatim
STRUCTURE       /WBS_PC_Data_Rec/       !pulse count data   
\                                !     Soft X-Ray Spectrometer (SXS)   
\  integer*2     sxs_pc11(16)    ! 00- SXS1 Detector, chan 1 (3-15 keV)                          W96,W97 F8n+0   
\  integer*2     sxs_pc12(16)    ! 32- SXS1 Detector, chan 2 (15-40 keV)                         W96,W97 F8n+1   
\  integer*2     sxs_pc21(16)    ! 64- SXS2 Detector, chan 1 (3-15 keV)                          W96,W97 F8n+2   
\  integer*2     sxs_pc22(16)    ! 96- SXS2 Detector, chan 2 (15-40 keV)                         W96,W97 F8n+3   
   
\                                !     Hard X-Ray Spectrometer (HXS)   
\  byte          hxs_pc1(32)     ! 128- (20-60 keV)                                              W99 F4n+0   
\  byte          hxs_pc2(32)     ! 160- (60-600 keV)                                             W99 F4n+1   
   
\                                !     Gamma-Ray Burst Detection (GBD)   
\  byte          gbd_pc1(32)     ! 192- [add words - elaborate]                                  W99 F4n+2   
\  byte          gbd_pc2(32)     ! 224- [add words - elaborate]                                  W99 F4n+3   
   
\                                !      Gamma-Ray Spectrometer (GRS)   
\  byte          grs_pc11(16)    ! 256- (0.2-0.7 MeV)                                            W98 F8n+0   
\  byte          grs_pc12(16)    ! 272- (0.7-4.0 MeV)                                            W98 F8n+1   
\  byte          grs_pc21(16)    ! 288- (0.2-0.7 MeV)                                            W98 F8n+2   
\  byte          grs_pc22(16)    ! 304- (0.7-4.0 MeV)                                            W98 F8n+3   
\  byte          grs_pc13(8)     ! 320- (4-7 MeV)                                                W98 F16n+4   
\  byte          grs_pc14(8)     ! 328- (7-10 MeV)                                               W98 F16n+5   
\  byte          grs_pc15(8)     ! 336- (8-30 MeV)                                               W98 F16n+6   
\  byte          grs_pc16(8)     ! 344- (30-100 MeV)                                             W98 F16n+7   
\  byte          grs_pc23(8)     ! 352- (4-7 MeV)                                                W98 F16n+12   
\  byte          grs_pc24(8)     ! 360- (7-10 MeV)                                               W98 F16n+13   
\  byte          grs_pc25(8)     ! 368- (8-30 MeV)                                               W98 F16n+14   
\  byte          grs_pc26(8)     ! 376- (30-100 MeV)                                             W98 F16n+15   
   
\                                !      Radiation Belt Monitor (RBM)   
\  integer*2     rbm_sc_pc1(16)  ! 384- NaI scintillation detector (5-60 keV)                    W96,W97 F8n+4   
\  integer*2     rbm_sc_pc2(16)  ! 416- NaI scintillation detector (60-300 keV)                  W96,W97 F8n+5   
\  integer*2     rbm_sd_pc(16)   ! 448- Si detector (20 kev)                                     W96,W97 F8n+6   
END STRUCTURE                   ! 480 Total   
\endverbatim

\verbatim
STRUCTURE       /WBS_PH_Data_Rec/   
\  byte          sxs_ph1(128,2)  !   0- SXS1 pulse height data (2-30 keV)   
\                                !      Chan 0-127 for 1st MF, and 2nd MF   
\  byte          sxs_ph2(128,2)  ! 256- SXS2 pulse height data (2-30 keV)   
\                                !      Chan 0-127 for 1st MF, and 2nd MF   
\  byte          grs_phl1(128)   ! 512- GRS pulse height data for lower channels (0.2-10 MeV)   
\                                !      Chan 0-127 takes 2 MF to dump   
\  byte          grs_phl2(128)   ! 640- GRS pulse height data for lower channels (0.2-10 MeV)   
\                                !      Chan 0-127 takes 2 MF to dump   
\  byte          hxs_ph(32,4)    ! 768- HXS pulse height data (20-400 keV)   
\                                !      Chan 0-31 twice for 1st MF, and 2nd MF   
\  byte          rbm_sc_ph(32,4) ! 896- NaI scintillation detector (5-300 keV)   
\                                !      Chan 0-31 twice for 1st MF, and 2nd MF   
\  byte          grs_phh1(16)    !1024- GRS pulse height data for higher channels (8-100 MeV)   
\                                !      Chan 0-15                                                        W96   
\  byte          grs_phh2(16)    !1040- GRS pulse height data for higher channels (8-100 MeV)   
END STRUCTURE                   !1056 Total   
\endverbatim

\subsection{9.5 Instrument Optional Section}

	WBS does not use the optional data section.

\subsection{9.6 Road Map Section}

This section contains a record for every ``block'' in the Index/Data section.
The information in this section is a subset of the index structure (see that
structure for a full explanation of each field).

\verbatim
STRUCTURE       /WBS_RoadMap_Rec/   
\                                !     For a full description of the fields,   
\                                !     look at the Index_Rec definition   
   
\  integer*4     ByteSkip        ! 00- Starting byte of index rec   
   
\  integer*4     time            ! 04- Major frame time (millisec of day)   
\  integer*2     day             ! 08- Major frame day (since 1-Jan-79)   
   
\  byte          DP_mode         ! 10- DP Mode   
\  byte          DP_rate         ! 11- DP Rate   
   
\  byte          pow_stat        ! 12- [add words - elaborate]   
\  byte          flags           ! 13- [add words - elaborate]   
   
\  integer*2     sxs1            ! 32- SXS2 channel 1 counts per sec.  (3-15 keV)   
\  integer*2     sxs2            ! 34- SXS2 channel 2 counts per sec.  (15-40 keV)   
\  integer*2     hxs             ! 36- HXS counts per sec.  (20-600 keV)   
\  integer*2     grs1            ! 38- GRS1 counts per sec.  (0.2-0.7 MeV)   
\  integer*2     grs2            ! 40- GRS2 counts per sec.  (0.7-4 MeV)   
\  integer*2     rbmsc           ! 42- RBMSC counts per sec. (5-300 keV)   
\  integer*2     rbmsd           ! 44- RBMSD counts per sec. (20 keV)   
\  integer*2     unit_time       ! 28- Unit time (in .01 sec)   
   
\  byte          nmf             ! 30- "Which" major frames are in the following data   
\  byte          spare(1)        ! 31   
END STRUCTURE                   ! 32 Total   
\endverbatim

\newpage


\section{10.  ATTITUDE CONTROL FILE (ATT)}

\verbatim
	File Identifier:		ATT
	Record Size:			16 bytes
\endverbatim

The ATT (ATTitude control) file is one of the reformatted data files 
which is written by the reformattor.  The general layout of this and the other
reformatted data files is:

\smallskip{\parskip=0pt
	\itemitem{1.} File Information / Pointer Section
	\itemitem{2.} File Header Section
	\itemitem{3.} Quasi-Static Index Section
	\itemitem{4.} Index/Data, Index/Data, \dots\ Section
	\itemitem{5.} Optional Section (HXA scans)
	\itemitem{6.} Road Map Section
}					% Resets \parskip

\subsection{10.1 Pointer Section}
	The pointer section is described in Section 4.1.  

\subsection{10.2 File Header}
	The File Header is described in Section 4.2.

\subsection{10.3 Quasi-Static Index Section}

	The structure QS\_General1\_Rec described in section 4.3 will be used.

\subsection{10.4 Index and Data Section}

	All of the attitude control data is saved separately to allow for
smoothing over time and quick easy access.  There is one block per major frame.

\verbatim
STRUCTURE       /ATT_Data_Rec/   
\                                !----- Inertial Reference Unit (IRU) ----------------------   
\  byte          iru_pow_stat(2) !  0- IRU Power Status                                          W48 F32n+13   
\                                !       b7 = ??   
\                                !       b6 = Loop??   
\                                !       b5 = X Motor on/off   
\                                !       b4 = Y Motor on/off   
\                                !       b3 = Z Motor on/off   
\                                !       b2 = S Motor on/off   
\                                !       b1 = ??   
\                                !       b0 =   
\  byte          iru_LM(5,2)     !  2- IRU ??                                                    W112 F32n+0,1,2,24,25   
\                                !    (i,j)  j=two values per major frame   
\                                !       (0,*) = X voltage?? (0-3 V)   
\                                !       (1,*) = Y voltage?? (0-3 V)   
\                                !       (2,*) = Z voltage?? (0-3 V)   
\                                !       (3,*) = S voltage?? (0-3 V)   
\                                !       (4,*) = MC??   
\  byte          iru_temp        ! 12- IRU Temperature                                           W32 F52 SF2n   
\  integer*4     iru(3,8)        !  0- X roll?                                                   W17,W18,W19 F8n+5   
\                                !     Y roll?                                                   W17,W18,W19 F8n+6   
\                                !     Z roll?                                                   W17,W18,W19 F8n+7   
\                                !    (i,j)  i=0 is X, i=1 is Y, i=2 is Z   
\                                !           j=eight values per major frame   
\                                !  W17 is high 8 bits of 24 bit value   
\                                !  W18 is middle 8 bits of 24 bit value   
\                                !  W19 is low 8 bits of 24 bit value   
\                                !   
\                                !   24-bit value is the roll/pointing?   
\                                !       LSB (1 DN) = 0.08 arcsec (one "pulse")   
   
\                                !----- Geomagnetic Attitude Sensor (GAS) ----------------------   
\  byte          gas_pow_stat    ! ??- GAS Power Status                                          W48 F24   
\                                !       b2 = GAS on/off   
\                                !       b1 = GAS Sensor SA/SB (set = SB)   
\  byte          gas_A_HK        ! ??- GAS-A Analog house keeping                                W32 F36 SF2n+1   
\  byte          gas_E_HK        ! ??- GAS-A Analog house keeping                                W32 F54 SF2n   
\  byte          gas(3,4)        ! 96- X position                                                W81 F16n+8   
\                                !     Y position                                                W82 F16n+8   
\                                !     Z position                                                W83 F16n+8   
\                                !    (i,j)  i=0 is X, i=1 is Y   
\                                !           j=four values per major frame   
\                                !   8-bit value is the ?? position   
\                                !   between 0 and 512 pixels   
\                                !       LSB (1 DN) = .0390625 volts (10,000 nT/volt)   
   
\                                !----- Two-Dimensional Fine Sun Sensor (TFSS) ----------------   
\  byte          tfss_pow_stat   !???- TFSS Power status                                         W48 F24   
\                                !       b5 = TFSS on/off   
\                                !       b4 = TFSS Cal??   
\  byte          tfss_v(2)       !   - TFSS voltages??                                           W32 F13,14 SF2n   
\  byte          tfss_temp       !   - TFSS Temperature                                          W32 F55 SF2n   
\  integer*2     TFSS(2,4)       !108-X Position                                                 W82,W83 F16n+12   
\                                !    Y Position                                                 W82,W83 F16n+13   
\                                !    (i,j)  i=0 is X, i=1 is Y   
\                                !           j=four values per major frame   
\                                !  W82 is high 8 bits of 12 bit value   
\                                !  W83 b4:7 = low 8 bits of 12 bit value   
\                                !   12-bit value is the ?? position   
\                                !   between 0 and 512 pixels   
\                                !       LSB (1 DN) = 0.00054 deg   
\                                !  W83   
\                                !       b3 = x/y sun presence        (1=on, 0=off)   
\                                !       b2 = x/y quality flag        (1=on, 0=off)   
   
\                                !----- Non-Spin Type Attitude Sensor (NSAS) -----------------   
\  byte          nsas_pow_stat   !???- NSAS Power status                                         W48 F24   
\                                !       b7 = NSAS on/off   
\                                !       b6 = NSAS Cal??   
\  byte          nsas_v(2)       !   - NSAS voltages??                                           W32 F15,16 SF2n   
\  byte          nsas_temp       !   - NSAS Temperature                                          W32 F56 SF2n   
\  integer*2     nsas(2,4)       !124- NSAS X address?                                           W82,W83 F16n+14   
\                                !     NSAS Y address?                                           W82,W83 F16n+15   
\                                !     (i,j)  i=0 is X, i=1 is Y   
\                                !           j=four values per major frame   
\                                !  W82 is high 8 bits of 12 bit value   
\                                !  W83 b4:7 = low 8 bits of 12 bit value   
\                                !   12-bit value is the ?? position   
\                                !   between 0 and 512 pixels   
\                                !       LSB (1 DN) = 0.5 pixels)   
\                                !       x=0, y=0 ==> 0.025 deg   
\                                !  W83   
\                                !       b3 = x/y sun presence        (1=on, 0=off)   
\                                !       b2 = x/y edge flag           (1=on, 0=off)   
\                                !       b1 = x/y upper discriminator (1=on, 0=off)   
\                                !       b0 = x/y lower discriminator (1=on, 0=off)   
   
\                                !----- Star Tracker (STT) ----------------------   
\  byte          stt_pow_stat    !???-STT power status                                           W48 F2   
\                                !       b7 = CPU1 on/off   
\                                !       b6 = CPU2 on/off   
\                                !       b5 =   
\                                !       b4 =   
\                                !       b3 =   
\                                !       b2 =   
\                                !       b1 =   
\                                !       b0 =   
\  byte          stt_stat(3)     !?? - STT Status                                                W48 F18,34,50   
\                                !       b7 =   
\                                !       b6 =   
\                                !       b5 =   
\                                !       b4 =   
\                                !       b3 =   
\                                !       b2 =   
\                                !       b1 =   
\                                !       b0 =   
\  byte          stt_v           !?? - STT Voltages   
\                                !       For FI = 0 = STT CCD                                    W32 F17 SF4n   
\                                !       For FI = 2 = STT REG                                    W32 F17 SF4n+2   
\  byte          stt_temp(2)     !?? - STT Temperatures                                          W32 F56,58 SF2n   
   
\  integer*2     stt_H_Pos(2)    !140-STT star position (H) - horizontal?                        W82,W83 F32n+2   
\                                !    (j) j=two values per major frame   
\                                !   16-bit value is the star pixel position ?   
\                                !   between 0 and 512 pixels   
\                                !       LSB (1 DN) = 0.007812 pixels   
\  integer*2     stt_V_Pos(2)    !144-STT star position (V) - vertical?                          W82,W83 F32n+10   
\                                !    (j) j=two values per major frame   
\  integer*2     stt_int(2)      !148-STT star intensity                                         W82,W83 F32n+18   
\                                !    (j) j=two values per major frame   
\  integer*2     stt_alarm(2)    !152-STT alarm signal                                           W82,W83 F32n+26   
\                                !    (j) j=two values per major frame   
   
\                                !----- HXT 2-D Aspect Sensor ----------------------   
\  byte          hxa_pow_stat    ! ??- HXA Power Status                                          W48 F1   
\                                !       b4 = HXA on/off   
\                                !       b3 = HXA cal   
\  integer*2     hxa_addr(32,2)  !156- Address of positions below discriminator                  W33,W34,W34 F00-F63   
\                                !     (limbs and fiducial)   
\                                !    (j,i) j=32 addresses per major frame   
\                                !          i=0 is two sets of addresses per major frame   
\                                !       The variable "hxa_xnum" tells how many x adresses   
\                                !       there are in "hxa_addr" and "hxa_ynum" tells how   
\                                !       many y addresses.  The y addresses need to have   
\                                !       2048 subtracted from the value.   
\  byte          hxa_xnum(2)     !284- Number of positions along X below discrim                 W49 F32n+25   
\                                !          Two sets per major frame   
\  byte          hxa_ynum(2)     !286- Number of positions along Y below discrim                 W49 F32n+27   
\                                !          Two sets per major frame   
\  byte          hxa_gain(2)     !288- Gain for HXA                                              W49 F32n+29   
\                                !          Two sets per major frame   
\  byte          HXA_gain_cont(2)! 80- Gain control commanded                                    W49 F32+25   
\                                !       Hopefully not changed   
\                                !       TODO - what is this - same Frame/Word as "hxa_xnum"   
   
\                                !----- S/C Processed pointing info ----------------------   
\  integer*4     sc_pntg(3,2)    !290- X,Y,Z euler angles in sun pointing coordinates   
\                                !   - X Offset from sun center                                  W17,W18,W19 F32n+8   
\                                !     Y offset from sun center                                  W17,W18,W19 F32n+16   
\                                !     Z roll from solar-north                                   W17,W18,W19 F32n+24   
\                                !    (i,j)  i=0 is X, i=1 is Y, i=2 is Z   
\                                !           j=two values per major frame   
\                                !  W17 is high 8 bits of 24 bit value   
\                                !  W18 is middle 8 bits of 24 bit value   
\                                !  W19 is low 8 bits of 24 bit value   
\                                !       LSB (1 DN) = 0.1 arcsec   
   
\                                !----- Ground Processed pointing info ----------------------   
\  integer*4     pntg_angle(3)   !290- X,Y,Z euler angles in sun pointing coordinates            From Mainframe   
\                                !     1 DN = 0.1 arcsec   
\  integer*4     pntg_dev(3)     !302- X,Y,Z standard deviation of attitude                      From Mainframe   
\                                !     determination errors   
\                                !     1 DN = .01"   
\  integer*4     pntg_motion(3)  !314- X,Y,Z estimated drift rates                               From Mainframe   
\                                !     1 DN = 1.0"/hour   
\  integer*4     pntg_status     !326- Status                                                    From Mainframe   
\                                !       b15 = TFSS  0=not used, 1=used   
\                                !       b14 = NSAS  0=not used, 1=used   
\                                !       b13 = STT   0=not used, 1=used   
\                                !       b12 = GAS   0=not used, 1=used   
\                                !       b11 = IRU   0=not used, 1=used   
\                                !       b10 = ACP   0=not used, 1=used   
\                                !       b9  = Spec  0=coarse, 1=fine   
\                                !       b8  =       0=propagation, 1=renewal   
\                                !       b7  =       0=forward, 1=backward   
\                                !       b6  = sun presence 0=night, 1=day   
\                                !       b5  = earth occultation 0=occul, 1=not occul   
\  byte          pntg_Trace      ! 30- Information on how pointing was derived                   Ground Info   
\                                !     and whether there is data present   
\                                !       0 = No data present   
\                                !       1 = Original Technique used 20-Oct-91 to ??   
\                                !           The data in "pntg_angle" is the average of   
\                                !           8 raw IRU values (there are 8 values per   
\                                !           major frame).  If the time of the data   
\                                !           does not match the time of the IRU data   
\                                !           within 5 minutes, then no data is present.   
\  byte          pntg_jitter     ! 32- Magnitude of pointing change over ??sec                   Derived   
\                                !       in ??   
\                                !       scaled - TODO   
   
\  byte          spare(10)       !330-   
END STRUCTURE                   !400- Total   
\endverbatim

\subsection{10.5 Instrument Optional Section}

	The full one dimensional scan will occur once every 32 major frames. 

\verbatim
STRUCTURE       /HXA_Scan_Rec/          !HXA 2 1-D Scans   
\  integer*4     time            ! 04- Major frame time (millisec of day)   
\  integer*2     day             ! 08- Major frame day (since 1-Jan-79)   
   
\  byte          x_scan_int(2048)!   - X scan intensity   
\  byte          y_scan_int(2048)!   - Y scan intensity   
\  integer*2     nPoScan         !   - Number of points in the scan (2048 if full)   
   
\  byte          spare(8)        !   
END STRUCTURE                   !4112   
\endverbatim

\subsection{10.6 Road Map Section}

This section contains a record for every ``block'' in the Index/Data section.
The information in this section is a subset of the index structure (see that
structure for a full explanation of each field).

\verbatim
STRUCTURE       /ATT_Roadmap_Rec/   
\                                !     For a full description of the fields,   
\                                !     look at the Index_Rec definition   
   
\  integer*4     ByteSkip        ! 00- Offset in bytes from the beginning of   
\                                !     of the data file for the beginning   
\                                !     of the data set index structure.   
   
\  integer*4     time            ! 04- Major frame time (millisec of day)   
\  integer*2     day             ! 08- Major frame day (since 1-Jan-79)   
   
\  byte          DP_mode         ! 10- DP Mode   
\  byte          DP_rate         ! 11- DP Rate   
   
\  byte          Flare_Control   ! 12- Flare flag control (active triggers)   
\  byte          Flare_Status    ! 13- Flare flag status   
\  byte          RBM_Status      ! 14- Radiation Belt Montitor Status   
\  byte          Telemetry_mode  ! 15- Telemetry mode   
\  byte          cal_status      ! 16- CAL status   
   
\  byte          SXT_Pow_stat    ! 17- SXT Power Status   
\  BYTE          bcs_pow_stat    ! 18- BCS Power status   
\  byte          hxt_Pow_stat    ! 19- HXT Power status   
\  byte          wbs_pow_stat    ! 20- WBS Power status   
\  byte          SXT_Control     ! 21- SXT Control Status   
   
\  byte          telemetry       ! 22- Telemetry source information   
   
\  byte          spare(9)        ! 23-   
END STRUCTURE                   ! 32- Total   
\endverbatim

\newpage

\section{11. OBSERVING LOG}

The Yohkoh Observing Log is intended to provide a database which will allow
people to search for occasions when a given event occurs.  The database contains
information on the instrument modes as well as the signals being detected by
a variety of instruments.  The file is generated directly from the reformatted
database ROADMAP sections.  It is possible to produce WBS, HXT and BCS light
curves with four second resolution with this dataset.  It is also possible to
generate a list of all occurances of a given SXT image type (for example, return
a list of all images taken with a given resolution, filter, and signal level).
The Observing Log has the necessary information to allow the user to go 
directly to the original reformatted data and extract the raw data for
analysis.

\subsection{11.1 Organization of Observing Log}

The Observing Log file is a binary file and is organized in a manner similar
to the reformatted data files, however, the observing log does not have a
roadmap.  There is also a single file for one week of data.

\smallskip{\parskip=0pt
	\itemitem{1.} Pointer Section
	\itemitem{2.} File Header Section
	\itemitem{3.} Pointer to Start of New Orbit Section
	\itemitem{4.} Instrument Entries
}					% Resets \parskip

\pagefigure{Figure 11-1}{Solar-A Observing Log File}

\pagefigure{Figure 11-2}{Overview for Using the Solar-A Observing Log File}

\subsection{11.1.1 Pointer Section}

	The pointer section is described in Section 4.1.  

\subsection{11.1.2 File Header Section}

	The File Header is described in Section 4.2.

\subsection{11.1.3 Quasi-Static Section}

	There is no data being saved in this section

\subsection{11.1.4 New Orbit Start Pointer Section}

	Every file will hold one weeks worth of data.  Assuming 15 orbits
per day, this section will hold 105 pointers.  The optional section pointer
in the file header will point to this section.

\verbatim
STRUCTURE       /Obs_NewOrbit_Rec/   
\  integer*4     time            ! 00- Start time of orbit   
\  integer*2     day             ! 04- Stard day of orbit   
\  integer*4     StEntry         ! 06- Pointer to start of orbit of data   
\                                !     in entry number (ie 32 or 48 byte blocks)   
\                                !     from the beginning of the data section.   
\                                !     The counter starts at 1.   
\  byte          spare(6)        ! 10- Spares   
END STRUCTURE                   ! 16- Total   
\endverbatim

	There is a header record before the new orbit pointer structures 
recording how many entries there are.

\verbatim
STRUCTURE       /Obs_NewOrb_Hd_Rec/   
\  integer*4     nOrbitRec       ! 00- Number of orbit record entries   
\  byte          spare(28)       !  4- Spares   
END STRUCTURE                   ! 32- Total   
\endverbatim

\subsection{11.1.4 Data Section}

	Each observing log data entry has an ``entry\_type'' associated with
it.   The ``entry\_type'' defines what kind of data is contained in the record. 
The breakdown of this word is as follows: 

\verbatim
				!   b0:4 Entry Type
  				!	 0 = File ID entry
				!	 1 = Orbit Entry
  				!	16 = SXT
  				!	17 = WBS/HXT
  				!	18 = BCS
  				!   b5:7 Entry version number
\endverbatim

\subsection{11.2 Spacecraft Common Entries}

\subsection{11.2.1 File ID Entry}

	There will be a File ID entry for every orbit.  This entry is used to
derive the file name after search the observing log and finding a data set
to research.

\verbatim
STRUCTURE       /Obs_FileID_Rec/   
\  byte          entry_type      ! 00- Observing Log Entry Type/Version   
   
\  integer*4     time            ! 01- Major frame time (millisec of day)   
\  integer*2     day             ! 05- Major frame day (since 1-Jan-79)   
   
\  character*13  fileId          ! 07- File ID for the orbit worth of data   
   
\  integer*4     sxt_pfi         ! 20- First SXT PFI Image serial number in the FileID   
\                                !     (if zero, there are no images for that fileID)   
\  integer*4     sxt_ffi         ! 24- First SXT FFI Image serial number in the FileID   
\                                !     (if zero, there are no images for that fileID)   
   
\  integer*2     delta_min       ! 28- Number of minutes covered by this FileID   
\  byte          spare(2)        ! 30- Spare   
END STRUCTURE                   ! 32- Total   
\endverbatim

\subsection{11.2.2 Orbital Solution Entry}

	There will be a orbital solution entry approximately every week.

\verbatim
STRUCTURE       /Obs_OrbitSol_Rec/   
\  byte          entry_type      ! 00- Observing Log Entry Type/Version   
   
\  integer*4     epoch_time      ! 01- Epoch time (millisec of day)   
\  integer*2     epoch_day       ! 05- Epoch day (since 1-Jan-79)   
   
\  integer*4     sol_time        ! 07- Solution time (millisec of day)   
\  integer*2     sol_day         ! 11- Solution day (since 1-Jan-79)   
   
\  real*4        x               ! 13- (km)   
\  real*4        y               ! 17- (km)   
\  real*4        z               ! 21- (km)   
\  real*4        xdot            ! 25- (km/s)   
\  byte          spare1(3)       ! 29- Spare   
   
\  byte          cont_mark1 /255/! 32- Continuation of an entry mark   
\  real*4        ydot            ! 33- (km/s)   
\  real*4        zdot            ! 37- (km/s)   
\  real*4        pin             ! 41- (deg.n)??   
\  real*4        h               ! 45- (km)   
   
\  real*4        a               ! 49- (km)   
\  real*4        e               ! 53-   
\  real*4        i               ! 57- (deg)   
\  byte          spare2(3)       ! 61- Spare   
   
\  byte          cont_mark2 /255/! 64- Continuation of an entry mark   
\  real*4        an              ! 65- (deg)   
\  real*4        ap              ! 69- (deg)   
\  real*4        ma              ! 73- (deg)   
\  real*4        lam             ! 77- (deg.n)   
   
\  integer*4     element_no      ! 81-   
   
\  byte          spare3(11)      ! 85- Spare   
END STRUCTURE                   ! 96- Total   
\endverbatim

\subsection{11.3 Instrument Entries}

For a full explanation of the fields, consult the instrument index or
quasi-static sections of this document.

\subsection{11.3.1 WBS/HXT Instrument Entry}

There will be a WBS/HXT entry every two major frames while in HIGH and MEDIUM
telemetry rate.  Whenever the discrimator, gain, or high voltage settings
change for any of these instruments, there will be a calibration entry.  Since
there is one data set per major frame for HXT, two sets of data values will
be averaged.  Both the WBS and HXT are in counts per second and have been
compressed using a simple SQRT of the original value.

\verbatim
STRUCTURE       /Obs_WBSHXT_Rec/   
\  byte          entry_type      !  0- Observing Log Entry Type/Version   
   
\  integer*4     time            !  1- Major frame time (millisec of day)   
\  integer*2     day             !  5- Major frame day (since 1-Jan-79)   
   
\  byte          DP_mode         !  7- DP Mode   
\  byte          DP_rate         !  8- DP Rate   
\  byte          Flare_Control   !  9- Flare flag control (active triggers) W50   
\  byte          Flare_Status    ! 10- Flare flag status   
   
\  byte          HXT_Pow_stat    ! 11- HXT Power status                                  (W48 F32+1)   
\  byte          HXT_sum_L       ! 12- Low energy (cnts/sec)   
\                                !     Simple square root compression of original value   
\  byte          HXT_sum_M1      ! 13- Medium-1 energy   
\                                !     Simple square root compression of original value   
\  byte          HXT_sum_M2      ! 14- Medium-2 energy   
\                                !     Simple square root compression of original value   
\  byte          HXT_sum_H       ! 15- High energy   
\                                !     Simple square root compression of original value   
\  byte          HXT_sigma_L     ! 16- Standard deviation of 16 "Fanbeam" subcollimator   
\                                !       counts (cnts/sec) - Low energy   
\                                !     Simple square root compression of original value   
\  byte          HXT_HV_stat     ! 17- HXT HV Status                                     (W48 F32+17 (+29))   
\                                !     Total for HXT = 7   
   
\  byte          WBS_sxs1        ! 18- SXS1 counts per sec.  Only SXS_PC12 are totaled   
\                                !     Simple square root compression of original value   
\  byte          WBS_sxs2        ! 19- SXS2 counts per sec.  Only SXS_PC21 are totaled   
\                                !     Simple square root compression of original value   
\  byte          WBS_hxs         ! 20- HXS counts per sec.  HXS_PC1 + HXS_PC2   
\                                !     Simple square root compression of original value   
\  byte          WBS_grs1        ! 21- GRS1 counts per sec.  GRS_PC11 + GRS_PC21   
\                                !     Simple square root compression of original value   
\  byte          WBS_grs2        ! 22- GRS2 counts per sec.  GRS_PC12 + GRS_PC22   
\                                !     Simple square root compression of original value   
\  byte          WBS_rbmsc       ! 23- RBMSC counts per sec.  PC1 + PC2   
\                                !     Simple square root compression of original value   
\  byte          WBS_rbmsd       ! 24- RBMSD counts per sec.   
\                                !     Simple square root compression of original value   
\  byte          WBS_Pow_Stat    ! 25-   
\  byte          WBS_Stat        ! 26- To be defined/expanded   
\                                !     Total for WBS = 9   
   
\  byte          WhichInstru     ! 27- Which instruments are included and   
\                                !     how many records (data sets) were averaged   
\                                !     If the value is zero, there is no data   
\                                !       b0-3: HXT   
\                                !       b4-7: WBS   
\  byte          spare(4)        ! 28- Spare   
END STRUCTURE                   ! 32- Total   
\endverbatim

\verbatim
STRUCTURE       /Obs_HXT_Status_Rec/   
\  byte          entry_type      ! 00- Observing Log Entry Type/Version   
   
\  integer*4     time            ! 01- Major frame time (millisec of day)   
\  integer*2     day             ! 05- Major frame day (since 1-Jan-79)   
   
\  byte          HV_control(4)   ! 07-                                                           W49 F32+9,11,13,15   
\  byte          HXA_gain_cont   ! 11- gain control commanded                                    W49 F32+25   
   
\  byte          spare(20)       ! 12-   
END STRUCTURE                   ! 32- Total   
\endverbatim

\verbatim
STRUCTURE       /Obs_WBS_Status_Rec/   
\  byte          entry_type      ! 00- Observing Log Entry Type/Version   
   
\  integer*4     time            ! 01- Major frame time (millisec of day)   
\  integer*2     day             ! 05- Major frame day (since 1-Jan-79)   
   
\  real*4        hiVolt(?)       !   
\  integer*2     discriminator(?)!   
\  real*4        gain(?)         !   
   
\  byte          spare(25)       !  7-   
END STRUCTURE                   ! 32- Total   
\endverbatim

\subsection{11.3.2 BCS Instrument Entry}

There will be a BCS entry every four seconds. Whenever the discrimator, gain,
or high voltage settings change for BCS, there will be a calibration entry. 
Since there can be many data sets over those four seconds, the average will be
taken before putting the BCS information in the observing log entry.  The
``total\_cnts'' field is uncompressed and the ``all\_cnts'' and ``acc\_cnts'' have
been compressed with a simple SQRT function.

\verbatim
STRUCTURE       /Obs_BCS_Rec/   
\  byte          entry_type      !  0- Observing Log Entry Type/Version   
   
\  integer*4     time            !  1- Major frame time (millisec of day)   
\  integer*2     day             !  5- Major frame day (since 1-Jan-79)   
   
\  BYTE          blockID         ! 07- BCS Block ID   
\  BYTE          SeqID           ! 08- Observation Sequence ID   
\  BYTE          ModeID          ! 09- Mode ID (Grouper Plan)   
\  BYTE          dgi             ! 10- Data Gather Interval (125 msec units)   
\  BYTE          DP_Flags        ! 11- DP Flags received by BCS   
\  BYTE          BCS_Status      ! 12- BCS Status   
   
\  integer*2     total_cnts(4)   ! 13- Total counts in each channel for the mode   
   
\  byte          All_cnts(4)     ! 21- BCS Counts for all events   
\                                !     Simple square root compression of original value   
\  byte          Acc_cnts(4)     ! 25- BCS Accumulated counts   
\                                !     Simple square root compression of original value   
\  byte          Acc_interval    ! 29- Accumulation interval (sec)   
   
\  byte          nAveraged       ! 30- Number of spectra and DP major frames that   
\  byte          spare(1)        ! 31- Spare   
END STRUCTURE                   ! 32- Total   
\endverbatim

\verbatim
STRUCTURE       /Obs_BCS_Status_Rec/   
\  byte          entry_type      ! 00- Observing Log Entry Type/Version   
   
\  integer*4     time            ! 01- Major frame time (millisec of day)   
\  integer*2     day             ! 05- Major frame day (since 1-Jan-79)   
   
\  byte          hiVolt(2)       ! 07- High Voltage trim value (0-7)   
\  byte          HV_mon(2)       ! 09- High voltage monitor (0-255)   
\  byte          discrim(2,4)    ! 11- Low, high discriminator value (0-255)   
\  byte          relays          ! 19- Relays status   
\  byte          status_2        ! 20- Other status bits...   
   
\  byte          spare(11)       ! 21- Spare   
END STRUCTURE                   ! 32- Total   
\endverbatim

\subsection{11.3.3 SXT Instrument Entry}

There will be a SXT entry for every image taken but not more often than every
two seconds (during the 0.5 and 1.0 sec cadence modes).  One entry per
multiple ROI FFI.

\verbatim
STRUCTURE       /Obs_SXT_Rec/   
\  byte          entry_type      !  0- Observing Log Entry Type/Version   
   
\  integer*4     time            ! 01- Major frame time (millisec of day)   
\  integer*2     day             ! 05- Major frame day (since 1-Jan-79)   
   
\  byte          DP_mode         ! 07- DP Mode   
\  byte          DP_rate         ! 08- DP Rate   
   
\  byte          pfi_ffi         ! 09- Image information   
\  byte          periph          ! 10- Aspect/Shutter/Filter information   
\  byte          ExpLevMode      ! 11- Exposure mode/level   
\  byte          imgparam        ! 12- Image parameter information   
   
\  byte          ObsRegion       ! 13- Observing region Number   
\  byte          seq_num         ! 14- Entry in sequence table (1-13)   
\  integer*2     seq_tab_serno   ! 15- Sequence table serial used   
   
\  integer*2     shape_cmd(2)    ! 17- Commanded image shape (nx/4 by ny/4)   
\  integer*2     FOV_Center(2)   ! 21- Pitch and yaw relative to the sun center   
\                                !     of the center of the SXT FOV (in arcsec)   
   
\  byte          Img_Max         ! 25- Maximum intensity   
\  byte          Img_Avg         ! 26- Average intensity of whole image   
\  byte          Img_Dev         ! 27- Average intensity around the max   
\  byte          PercentD        ! 28- Percentage of data present   
\  byte          PercentOver     ! 29- Percentage of data over [N] counts   
   
\  byte          Flare_Status    ! 30- Flare flag status   
   
\  byte          spare(1)        ! 31- Spare bytes   
END STRUCTURE                   ! 32- Total   
\endverbatim

\subsection{11.4 Estimated Size of the Log}

The current observing logs are approximately 2 megabytes per week, which
comes to 100 megabytes per year.

\newpage

\section{12. POINTING LOG}

The pointing log (PNT) was established so that a reduced set of the ADA files
could be kept on-line for the whole mission.  The PNT file will eventually
contain the processed pointing information for every major frame for which the
S/C was observing.  Since the data reduction techniques are continuously
evolving, it is impracticle to try to have the best reduced pointing information
in the scientific data files.  The old instrument files would not have the
newest and most stable solutions.  Because of this, the PNT files were created.
There still is processed pointing in each instrument file, but the techniques
vary to arrive at that solution.  For movies that cover a long period, it
is necessary to use the PNT files.

\subsection{12.1 Organization of Pointing Log}

The Pointing Log file organization is almost exactly the same as that of
the Observing Log.  See section 11.1 for futhur information.

\subsection{12.1.1 Data Section}

\verbatim
STRUCTURE       /PNT_Data_Rec/   
\                                !NOTE: See ATT_STRUCT for details on definitions.   
   
\  integer*2     index_version /'A011'x/   
\                                ! 00- Index structure version   
   
   
\  integer*4     time            !  2- Major frame time (millisec of day)   
\  integer*2     day             !  6- Major frame day (since 1-Jan-79)   
   
\  integer*4     iru(3)          !  8- Inertial Reference Unit   
\  integer*2     TFSS(2)         ! 20- Two-Dimensional Fine Sun Sensor   
\  integer*2     hxa(4)          ! 24- HXT Aspect sensor   
\                                !       (0) = low address for x   
\                                !       (1) = high address for x   
\                                !       (2) = low address for y   
\                                !       (3) = high address for y   
\  integer*4     sc_pntg(3)      ! 32- X,Y,Z euler angles in sun pointing coordinates   
\  byte          status          ! 44- b0 - Set if flare mode   
\                                !     b1:2 - DP rate - "non-standard" convention   
\                                !               0 = low   
\                                !               1 = medium   
\                                !               2 = high   
\                                                3 = unknown (bad telemetry)   
\                                !     b3 - HXA data present (set if present)   
   
\  byte          spare(3)        ! 45-   
END STRUCTURE                   ! 48- Total   
\endverbatim

\section{13. SPACECRAFT EPHEMERIS LOG}

A reduced set of the spacecraft ephemeris information is available in the
FEM files.  Information contained in the FEM files are items like times for
start of S/C day, S/C night, start and end times for SAA and station contacts.
There is one file per week.  The files are generated from the AOSLOS program
which was transfered from the FACOM Mainframe to the workstations.  All values
are ground predicted times.

\subsection{13.1 Organization of S/C Ephemeris Log}

The S/C Ephemeris Log file organization is almost exactly the same as that of
the Observing Log.  See section 11.1 for futhur information.

\subsection{13.1.1 Data Section}

\verbatim
STRUCTURE       /FEM_Data_Rec/   
\  integer*2     path            ! 00- The SIRIUS mainframe path ID (only the last   
\                                !     4 characters since the date is the first   
\                                !     6 characters (yyddmm)   
\  integer*4     time            ! 00- Beginning of S/C day (Millisec of day)   
\                                !     (True predicted start time, no margin worked   
\                                !     in like the FileID has)   
\  integer*2     day             ! 04- Beginning of S/C day (days since 1-Jan-79)   
   
\  integer*2     night           ! 06- Start of S/C night in seconds from S/C day   
\  integer*2     st_saa          ! 08- Start of S/C SAA in seconds from S/C day   
\  integer*2     en_saa          ! 10- End of S/C SAA in seconds from S/C day   
   
\  integer*2     st_station(3)   ! 12- Start of station contact in seconds from S/C day   
\                                !       (i) = can be three station contacts in one day   
\  integer*2     en_station(3)   ! 16- End of station contact in seconds from S/C day   
\                                !       (i) = can be three station contacts in one day   
\  byte          st$station(3)   ! 20- Station   
\                                !               'U' = KSC   
\                                !               'C' = Canberra   
\                                !               'M' = Madrid   
\                                !               'G' = Goldstone   
\                                !       (i) = can be three station contacts in one day   
\  byte          st$antenna(3,2) ! 26- Antenna to be used (A or B)   
\                                !       (i,j)   
\                                !       (i) = can be three station contacts in one day   
\                                !       (j) = can be two antenna uses per contact   
\  integer*2     cng_antenna(3)  ! 22- Time that the antenna must be changed in   
\                                !     seconds from S/C day.  If the antenna is not   
\                                !     changed, then these values are zero   
\                                !       (i) = can be three station contacts in one day   
\  byte          use_station(3)  ! 30- Whether the station was actually used for a down   
\                                !     link or not (0=no, 1=yes)   
\                                !     DERIVED AFTER DOWNLINK BY LOOKING AT SIRIUS DATA   
   
\  integer*2     sc_rev          ! 30- Spacecraft revolution number   
\                                !     This is actually only the number of S/C day/night   
\                                !     transitions   
\  byte          week            ! 32- Week number (1-53)   
\  byte          year            ! 33- year (91,92,...)   
\  byte          iday            ! 34- Day within the week (0-6)   
\  byte          day_rev         ! 35- Revolution number within the day (1-15)   
   
\  character*13  fileid          ! 36- The master fileid for this orbit   
\                                !     The FileID time is approximately 5 minutes before   
\                                !     the true S/C day time.  This is the time used for   
\                                !     extraction to insure that data in one orbit is not   
\                                !     broken across files.   
   
\  byte          spare(1)        ! 49- Spare   
END STRUCTURE                   ! 64- Total   
\endverbatim

\newpage
\section{14. EVENT LOG}

The event log will be a compact summary of the significant ``mode-related''
events.  The input for the file will be 

\smallskip{\parskip=0pt
	\itemitem{1.} Observing Log
	\itemitem{2.} Tracking Log (active region number and coordinates)
	\itemitem{3.} CD-ROM index listing
}					% Resets \parskip

The event log will look for CHANGES of states (modes, instruments on/off,
day/night, ...) instead of making entries at a fixed cadence.

\subsection{14.1 Entry Types}

\subsection{14.1.1 Common Entry}

\verbatim
STRUCTURE       /Evn_Common_Rec/   
\  integer*2     entry_type      ! 00- Event Log Entry Type/Version   
   
\  integer*4     time            ! 02- Major Frame time (millisec of day)   
\  integer*2     day             ! 06- Major Frame day (since 1-Jan-79)   
   
\  byte          Instru_on_off   ! 08- Instrument on/off   
\                                !       0: HXT   
\                                !       1: SXT   
\                                !       2: BCS   
\                                !       3: WBS-SXS   
\                                !       4: WBS-HXS   
\                                !       5: WBS-GRS   
\                                !       6: WBS-RBM   
\  byte          mode_rate       ! 09- DP mode rate   
\                                !       0: Day/Night    (set = day)   
\                                !       1: SAA          (set = SAA active)   
\                                !       2-3: DP Mode    (FL, QT, NT, other)   
\                                !       4-5: Telemetry Rate     (Lo, Med, Hi)   
\                                !       6: FFI Exposure (set = exposure taken)   
\  byte          bcs_mode        ! 10- BCS Mode Change (What is new mode?)   
\  byte          flare_flag      ! 11- Flare flag   
\                                !       0: SXS          (set = triggered)   
\                                !       1: HXS          (set = triggered)   
\                                !       2: BCS          (set = triggered)   
\  byte          CDROM_index(2)  ! 12- CD-ROM (or other) index number   
\  byte          Telem_info      ! 14- Telemetry Coverage (Show transitions)   
\                                !       0: BDR Coverage (set = covered)   
\                                !       1: Real Time    (set = covered)   
\  byte          FFI_Expos(4)    ! 15- Full width exposure paremeters   
\                                !       (0): Compression/resolution/...   
\                                !       (1): Start Row   
\                                !       (2): End Row   
\                                !       (3): ??   
\  byte          spare(13)       ! 19-   
END STRUCTURE                   ! 32- Total   
\endverbatim

\subsection{14.1.2 SXT PFI Entry}

	For every different observing region or active region (different table
entry into the ROIT table) a summary of the number of images taken for that
region will be entered in the Event Log. 

\verbatim
STRUCTURE       /Evn_PFI_Rec/   
\  integer*2     entry_type      ! 00- Event Log Entry Type/Version   
   
\  integer*4     time            ! 02- Major Frame time (millisec of day)   
\  integer*2     day             ! 06- Major Frame day (since 1-Jan-79)   
   
\  integer*2     FOV_Center(2)   ! 08- Pitch and yaw relative to the sun center   
\                                !     of the center of the SXT FOV (in arcsec)   
   
\  integer*2     NOAA_number     ! 12- NOAA number   
\  integer*2     num_images(4)   ! 14- Summary of imagess   
\                                !       (1) = Number of images - thin filters   
\                                !       (2) = Number of images - medium filter   
\                                !       (3) = Number of images - thick filters   
\                                !       (4) = Number of images - optical filters   
   
\  byte          resolution      ! 22- Highest resolution? or one entry per res?   
\  byte          FOV             ! 23- Field of view (largest/smallest/???)   
   
\  byte          spare(8)        ! 24- Spare   
END STRUCTURE                   ! 32- Total   
\endverbatim

\subsection{14.2 Estimated Size of the Log}

\noindent
Assume every orbit will have the following number of entries required:

\verbatim

	Day/Night change	 1   per orbit
	Instrument on/off	 1.3 per orbit
	SAA			 0.3 per orbit
	BDR Coverage		10   per orbit
	DP mode change		 2   per orbit
	Telemtry Rate Change	 4   per orbit
	Flare Flag		 2   per orbit
	BCS mode change		 4   per orbit
	FFI Exposure		 2   per orbit
	--------------------------------------
				27   per orbit

\endverbatim

\smallskip\noindent
Assume every orbit will have 8 different PFI active regions.

\verbatim

	Common Entries	= 27 entries * 20 bytes = 540 bytes/orbit
	PFI Entries	=  8 entries * 20 bytes = 160 bytes/orbit
						  ---------------
						  700 bytes/orbit
\endverbatim

\smallskip\noindent
Assuming 15 orbits per day, 365 days per year, 3 years:

\verbatim

	Total (for 3 years) = 700 * 15 * 365 * 3 = 11.5 MBytes
						 = 22,000 blocks

\endverbatim

\newpage
\section{15. FLARE CATALOG}

	A flare catalog will be generated using the observing log, the
event log, ground based information, and a careful look at the data by hand.

\verbatim
	  Date        Start       End       Peak      NOAA   X-Ray   Location   Size    Solar-A   Ground 
                      Time        Time      Time     Number  Class   N/S E/W  (arcmin)  B H S W   S M
                                                                                        C X X B   O E
                                                                                        S T T S   O E
                                                                                                  N S
	dd-mmm-yy   hh:mm:ss    hh:mm:ss  hh:mm:ss   ######   n##.#  ### ###    ###     . . . .   . .
\endverbatim


\newpage
\section{16. ACCESS SOFTWARE}

There are IDL routines available to read all of the reformatted data.
In the following examples, the input is infil (the input filename) and
dsets (a vector holding the dataset numbers to be extracted).

\verbatim
	rd_fheader, infil, file_header
	rd_pointer, infil, pointer
	rd_roadmap, infil, roadmap
	rd_xda, infil, dsets, index, data

	rd_sda, infil, dsets, index, data
	rd_bda, infil, dsets, index, data
	rd_wda, infil, dsets, index, data
	rd_hda, infil, dsets, index, data
	rd_ada, infil, dsets, index, data
	rd_cba, infil, dsets, index, data
	rd_bda_dp, infil, dp_sync
\endverbatim

The Software Control Document gives a further description of the access
routines available.

\bye

