C+
C	NAME:
C		SXT_OLD_STRUCT
C	PURPOSE:
C		Define the following SXT specific database structures
C			* SXT_2301_Index_Rec 
C			* SXT_2302_Index_Rec 
C			* SXT_3011_Index_Rec
C			* SXT_3012_Index_Rec
C
C	CALLING SEQUENCE:
C		SXT_OLD_STRUCT
C	HISTORY:
C		written by Mons Morrison, Fall 90.
C
C-
C	---------------------------------------------------------------

	STRUCTURE	/SXT_2301_Index_Rec/
	  integer*2	index_version /'2301'x/
					!  0- Index structure version					Ground Info
	
	  byte		pfi_ffi		!  2- Image information						
	  				!	6:7: 1 = PFI						Derived
					!	     2 = FFI
					!	     3 = Patrol image buffer dump
	  				!	  5: For FFI 0=BLS off, 1=BLS on			W114 F00 B4
	  				!	0-3: For PFI = "OR" expsoure #				W114 F43
	  				!	0-3: For FFI = ROI# of nROI				Derived
	
					!								     PFI/FFI
	  byte		periph		!  3- Aspect/shutter/filter information				W114 F08/02
	  				!	  0: Aspect door (0=closed, 1=open)
	  				!	  1: Shutter mode (0=Frame Transfer, 1=Mech)
	  				!	2-4: Filter B position
	  				!	5-7: Filter A position
	  byte		ExpLevMode	!  4- Exposure mode/level					W114 F09/03
	  				!	0-1: Exposure mode (0=normal, 1=dark, 2=LTF)
	  				!	2-7: Mailbox exposure level
	  byte		imgparam	!  5- Image parameter information 				W114 F24/18
	  				!	0-1: Exposure cadence (0=2sec,1=1sec,2=.5sec)
	  				!	2-3: Number of ROI (0=1 ROI, 1=2 ROI, ...)
	  				!	4-5: Compression (0=Cmp, 1=Low8, 2=Hi8)
	  				!	6-7: Image resolution (0=1x1,1=2x2,3=4x4)
	  byte		flush		!  6- Flush information						W114 F40/34
	  				!	0-3: Full frame flushes
	  				!	4-7: Guard band
	  integer*2	explat		!  7- Exposure latency (mailbox value)				W114 F10,F26/04,20
	  integer*2	expdur		!  9- Exposure duration (mailbox value)				W114 F42,F58/36,52
	
	  integer*2	shape_cmd(2)	! 11- 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)	! 15- 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)	! 19- Commanded starting corner (x0, y0)			W114 F27,11/21
					!	(the col,lin# are in 1x1 pixels)
					!     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)	! 23- Starting corner saved (x0, y0)				Derived
					!	(the col,lin# are in 1x1 pixels)
	
	  integer*2	FOV_Center(2)	! 27- 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)
	  integer*2	FOV_Ver		! 31- Information on how solution was derived			Ground Info
	
	  byte		ObsRegion	! 33- Observing region Number					W114 F50
	  byte		seq_num		! 34- Sequence Number (1-13)					W114 F59/55
	  				!	4-7: Entry in sequence table (1-13)
	  				!	0-3: Word or line sync error bits
	  byte		seq_tab_entry	! 35- Entry number of sequence table (0-3)			W114 F50
					!	0-1: FFI Seq Table # (0-3)
					!	2-3: PFI Seq Table # (0-3)
	  integer*2	seq_tab_serno	! 36- Sequence table serial used                                Ground Info

	  byte		spare_temp(2)	! 38- Spare bytes to maintain structure - TODO delete

	  integer*4	serial_num	! 40- Serial number of image					W115 F18,34,50/16,32,48
	  integer*4	mloop		! 44- Main loop counter						W115 F19,35,51/02,03
	  byte		loops(4)	! 48- 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	! 52- Power Status (0=off, 1=on)				W48  F25
					!	0: 5 Volts
					!	1: 28 Volts
					!	2: Filter Wheel
					!	3: Shutter / Aspect Controller
					!	4: Micro A Select
					!	5: Micro B Select
					!	6: Camera
					!	7: Thermoelectric Cooler (TEC)
	  byte		SW_stat		! 53- Active Software (1=active)				W114 F12
					!	0: Quiet ARS on/off
					!	1: Quiet ARS 1 or 2
					!	2: Flare ARS on/off
					!	3: ARS morning patrol on/off
					!	4: AEC patrol on/off
					!	5: ART on/off
					!	6: ART
					!	7: ART
	  byte		SXT_Control	! 54- SXT Control Status					W114 F32
					!	  0: Power control mode (1=auto, 0=manual)
					!	  1: SXT control mode (1=auto, 0=manual)
					!	4-5: SXT day/night mode
					!		00 = SXT day mode
					!		01 = SXT evening mode
					!		10 = SXT night mode
					!		11 = SXT morning mode
					!	  6: SXTE-U hard reset (1=executed)
					!	  7: SXTE-U soft reset (1=executed)
	  byte		sxtfmt		! 55- SXT Format info 8:2 or 2:8				W115 F00
	
	  byte		temp_ccd	! 56- CCD Temperature						W113 F52
					!     Value is actually 1 MF out of sync?
					!     (See quasi-static section for conversions)
	  byte		temp_hk(10)	! 57- House keeping temperature					W32 F18-26 SF2n+1
					!     (See quasi-static section for conversions)

	  byte		HW_error(2)	! 67- Hardware error since last exposure			W113 F07,23 ?
	  byte		j_register	! 69- Which buffer is used					W114 F33?

	  byte		Img_Max		! 70- Maximum intensity						Derived
					!     (0-255, high 8 bits)
	  byte		Img_Avg		! 71- 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)
	  byte		Img_Dev		! 72- Standard deviation of the whole image			Derived
					!     (0-255) - Not scaled
	  byte		PercentD	! 73- Percentage of data present				Derived
	  byte		PercentOver	! 74- Percentage of data over [N] counts			Derived
	
	  byte		AEC_Status	! 75- AEC Status						W114 F44
					!	NOTE: True only for the LAST "PFI Strip" in
					!	      an observing region
					!	b0:3 = Maximum number of selcted regions
					!	       in AT ARS1 (0-4)
					!	b4:5 = AEC Status of PFI-AEC
					!		00b = proper
					!		01b = Over exposure
					!		10b = Under exposure
					!	b6:7 = AEC Status of Patrol-AEC
					!		(see above)
	  byte		spare(4)	! 76- Spare bytes
	END STRUCTURE			! 80- Total


	STRUCTURE	/SXT_2302_Index_Rec/
	  integer*2	index_version /'2302'x/
					!  0- Index structure version					Ground Info
					!     (See GEN_INDEX for explanation)
	
	  byte		pfi_ffi		!  2- Image information						
	  				!	6:7: 0 = PFI						Derived
					!	     1 = FFI
					!	     3 = Patrol image buffer dump
	  				!	  5: For FFI 0=BLS off, 1=BLS on			W114 F00 B4
	  				!	0-3: For PFI = "OR" expsoure #				W114 F43
	  				!	0-3: For FFI = ROI# of nROI				Derived
	
					!								     PFI/FFI
	  byte		periph		!  3- Aspect/shutter/filter information				W114 F08/02
	  				!	  0: Aspect door (0=closed, 1=open)
	  				!	  1: Shutter mode (0=Frame Transfer, 1=Mech)
	  				!	2-4: Filter B position
	  				!	5-7: Filter A position
	  byte		ExpLevMode	!  4- Exposure mode/level					W114 F09/03
	  				!	0-1: Exposure mode (0=normal, 1=dark, 2=LTF)
	  				!	2-7: Mailbox exposure level
	  byte		imgparam	!  5- Image parameter information 				W114 F24/18
	  				!	0-1: Exposure cadence (0=2sec,1=1sec,2=.5sec)
	  				!	2-3: Number of ROI (0=1 ROI, 1=2 ROI, ...)
	  				!	4-5: Compression (0=Cmp, 1=Low8, 2=Hi8)
	  				!	6-7: Image resolution (0=1x1,1=2x2,3=4x4)
	  byte		flush		!  6- Flush information						W114 F40/34
	  				!	0-3: Full frame flushes
	  				!	4-7: Guard band
	  integer*4	explat		!  7- Exposure latency (mailbox value)				W114 F10,F26/04,20
	  integer*4	expdur		!  9- Exposure duration (mailbox value)				W114 F42,F58/36,52
	
	  integer*2	shape_cmd(2)	! 11- 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)	! 15- 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)	! 19- Commanded starting corner (x0, y0)			W114 F27,11/21
					!	(the col,lin# are in 1x1 pixels)
					!     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)	! 23- Starting corner saved (x0, y0)				Derived
					!	(the col,lin# are in 1x1 pixels)
	
	  integer*2	FOV_Center(2)	! 27- 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		! 31- Information on how solution was derived			Ground Info
	
	  byte		ObsRegion	! 33- Observing region Number					W114 F50
                                        !       b/0:1 = FFI Seq Table # (0-3)
					!		From Entry Table 
                                        !       b/2:3 = PFI Seq Table # (0-3)
					!	b/4:7 = Observing region number (0-8)
					!		(0-3) QT ARS
					!		(4-7) Manual (with ART option)
					!		(8)   FL ARS
	  byte		seq_num		! 34- Sequence Number (1-13)					W114 F59/55
	  				!	4-7: Entry in sequence table (1-13)
	  				!	0-3: Word or line sync error bits
	  integer*2	seq_tab_serno	! 36- Sequence table serial used                                Ground Info

	  integer*4	serial_num	! 40- Serial number of image					W115 F18,34,50/16,32,48
	  integer*4	mloop		! 44- Main loop counter						W115 F19,35,51/02,03
	  byte		loops(4)	! 48- 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	! 52- Power Status (0=off, 1=on)				W48  F25
					!	0: 5 Volts
					!	1: 28 Volts
					!	2: Filter Wheel
					!	3: Shutter / Aspect Controller
					!	4: Micro A Select
					!	5: Micro B Select
					!	6: Camera
					!	7: Thermoelectric Cooler (TEC)
	  byte		SW_stat		! 53- Active Software (1=active)				W114 F12
					!	0: Quiet ARS on/off
					!	1: Quiet ARS 1 or 2
					!	2: Flare ARS on/off
					!	3: ARS morning patrol on/off
					!	4: AEC patrol on/off
					!	5: ART on/off
					!	6: ART
					!	7: ART
	  byte		SXT_Control	! 54- SXT Control Status					W114 F32
					!	  0: Power control mode (1=auto, 0=manual)
					!	  1: SXT control mode (1=auto, 0=manual)
					!	4-5: SXT day/night mode
					!		00 = SXT day mode
					!		01 = SXT evening mode
					!		10 = SXT night mode
					!		11 = SXT morning mode
					!	  6: SXTE-U hard reset (1=executed)
					!	  7: SXTE-U soft reset (1=executed)
	  byte		sxtfmt		! 55- SXT Format info 8:2 or 2:8				W115 F00
	
	  byte		temp_ccd	! 56- CCD Temperature						W113 F52
					!     Value is actually 1 MF out of sync?
					!     (See quasi-static section for conversions)
	  byte		temp_hk(10)	! 57- House keeping temperature					W32 F18-26 SF2n+1
					!     (See quasi-static section for conversions)

	  byte		HW_error(2)	! 67- Hardware error since last exposure			W113 F07,23 ?
	  byte		j_register	! 69- Which buffer is used					W114 F33?

	  byte		Img_Max		! 70- Maximum intensity						Derived
					!     (0-255, high 8 bits)
	  byte		Img_Avg		! 71- 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)
	  byte		Img_Dev		! 72- Standard deviation of the whole image			Derived
					!     (0-255) - Not scaled
	  byte		PercentD	! 73- Percentage of data present				Derived
	  byte		PercentOver	! 74- Percentage of data over [N] counts			Derived
	
	  byte		AEC_Status	! 75- AEC Status						W114 F44
					!	NOTE: True only for the LAST "PFI Strip" in
					!	      an observing region
					!	b0:3 = Maximum number of selcted regions
					!	       in AT ARS1 (0-4)
					!	b4:5 = AEC Status of PFI-AEC
					!		00b = proper
					!		01b = Over exposure
					!		10b = Under exposure
					!	b6:7 = AEC Status of Patrol-AEC
					!		(see above)
	  byte		spare(3)	! 76- Spare bytes
	END STRUCTURE			! 80- Total
	
	
	STRUCTURE	/SXT_3011_Index_Rec/
	  integer*2	index_version /'3011'x/
					!	Retired on 8-Mar-92 in order to add more 
					!	house keeping temperatures to the index structure

					!  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		!  9- Exposure duration (mailbox value)				W114 F42,F58/36,52
	
	  integer*2	shape_cmd(2)	! 11- 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)	! 15- 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)	! 19- 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)	! 23- Starting corner saved (x0, y0)				Derived
					!	(the col,lin# are in 1x1 pixels)
	
	  integer*2	FOV_Center(2)	! 27- 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		! 31- Information on how solution was derived			Ground Info
	
	  byte		ObsRegion	! 33- 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		! 34- 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	! 36- Sequence table serial used                                Ground Info

	  integer*4	serial_num	! 40- Serial number of image					W115 F18,34,50/16,32,48
	  integer*4	mloop		! 44- Main loop counter						W115 F19,35,51/02,03
	  byte		loops(4)	! 48- 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	! 52- 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		! 53- 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	! 54- 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		! 55- SXT Format info 8:2 or 2:8				W115 F00
	
	  byte		temp_ccd	! 56- CCD Temperature						W113 F52
					!     Value is actually 1 MF out of sync?
	  byte		temp_hk(10)	! 57- 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) = Spare

	  byte		HW_error(2)	! 67- Hardware error since last exposure			W113 F07,23 ?
	  byte		j_register	! 69- Which buffer is used					W114 F33?

	  byte		Img_Max		! 70- Maximum intensity						Derived
					!     (0-255, high 8 bits)
	  byte		Img_Avg		! 71- 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)
	  byte		Img_Dev		! 72- Standard deviation of the whole image			Derived
					!     (0-255) - Not scaled
	  byte		PercentD	! 73- Percentage of data present				Derived
	  byte		PercentOver	! 74- Percentage of data over [N] counts			Derived
	
	  byte		AEC_Status	! 75- 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(3)	! 76- Spare bytes
	END STRUCTURE			! 80- Total


	STRUCTURE	/SXT_3012_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
