5.  Soft X-Ray Telescope (SXT)

5.1  Routines for Data Selection

5.1.1 SSWHERE

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

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

5.1.2 SHOW_OBS3

SHOW_OBS3 plots a time line summary of the SXT images that are in the index or roadmap. In addition to plotting a tick for each image available, it shows the DP mode, DP rate, where the S/C days are, and where SAA passages occur. Some sample calls to SHOW_OBS3 are:
IDL >  show_obs3, roadmap

IDL >  show_obs3, index
It is possible to select images using SHOW_OBS3 by clicking on diagonally opposite corners of a box surrounding the images you wish to select. The calling sequence for that is:
IDL >  show_obs3, roadmap, sel, ss
where sel is a returned logical array the same length as roadmap, and is set true for all dsets selected, and ss is the returned subscripts of the selected datasets. A few examples on how to use the sel variable are:
IDL >  ss = where(sel)

IDL >  ss = where(sel and (gt_dp_mode(roadmap) eq 9))

5.1.3 SHOW_OBS4

The calling sequence of SHOW_OBS4 is the same as SHOW_OBS3, except there are a few additional options in SHOW_OBS4. Run SHOW_OBS4 with one of the following commands:
IDL >  show_obs4, roadmap

IDL >  show_obs4, index
It is possible to click on a time range for a closer look by:

  1. Clicking with the left button at the start time
  2. Clicking with the right button at the end time
  3. Clicking with the left button on the box in the lower right
  4. If you wish to exit, click with the middle button somewhere on the plot

It is possible to select several regions using the following steps.

  1. Click with the right button on the box in the lower left (Select Option). A square box should appear on the screen.
  2. Click and hold the left button on the lower left corner of the box and drag the box to the lower left corner of the region you want to select, then release.
  3. Click and hold the middle button on the upper right corner of the box and stretch the box to encompass the images you want to select.
  4. Repeat steps 2 and 3 until you have positioned the box where you want it.
  5. Click on the right button to exit the selection option when you have successfully positioned the box.
  6. Now you can exit SHOW_OBS4 by clicking on the middle button, or you can select another set of images by running steps 1 through 5 again.

5.1.4 PLOT_FOV

It is possible to make a simple display of the sun and to overlay the box showing the field of view size and location by using PLOT_FOV. The index, roadmap or observing log entry can be used with this routine. A sample call is:
IDL >  plot_fov, index, /box

5.2  Routines for Making Time Plots

5.2.1 LCUR_IMAGE

See the description in the ``General Yohkoh Software'' chapter on page  or the description in the User's Guide.

5.3  Routines for Image Display and Enhancement

5.3.1 STEPPER

See the description in the ``General Yohkoh Software'' chapter on page  or the description in the User's Guide.

5.3.2 XY_RASTER

XY_RASTER makes a mosaic of several images and prints the times in the corner of each image. Sample calls are:
IDL >  xy_raster, index, data

IDL >  xy_raster, index, data, factor
where factor is the rebin factor (a value of 1 will perform no rebinning). If there are too many images, the program will display the number of images which will fit on a page, and will prompt the user for when to move to the next page. The keyword /notimes will inhibit the time labels, /noscale will inhibit image scaling (it will use TV instead of TV_SCL), /individual_scale will scale each image individually.

5.3.3 DISP_MONTH

The routine DISP_MONTH will display a month of SXT images in a calendar form (assuming you have the SFM database on-line). A sample call is:
IDL >  disp_month, 'oct-93'

5.3.4 UNSHARP_MASK

UNSHARP_MASK is a basic image enhancement routine which uses the unsharp mask method. The calling sequence is:
IDL >  dataout=unsharp_mask(index, data)
where data and dataout are 2D arrays, and index is the index entry that corresponds to data. If no keywords are given the defaults are used.

Optional Keyword Parameters:

smooth Size of smoothing box, integer.
lowdelt Lower d cutoff, a percentage of minimum, decimal 0.xx.
updelt Upper d cutoff, a percentage of maximum, decimal 0.xx.
lowint Saturation cutoff, don't add back when signal is BELOW
a given percentage of the saturation value, decimal 0.xx.
upint Saturation cutoff, don't add back when signal is ABOVE
a given percentage of the saturation value, decimal 0.xx.
deltcoef Multiplier for d field, float x.x.

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

5.3.5 DE_SPIKER

The DE_SPIKER function returns a cleaned image by removing spikes at a specified input level. The technique used is to difference a smoothed image and the input image and find all pixels that deviate by more than a given threshold.
IDL >  clean_img = de_spiker(image, thresh)

IDL >  clean_img = de_spiker(image, thresh, /neg)

IDL >  clean_img = de_spiker(image, thresh, indices=indices)
where, image is the input data array, thresh is the specified spike amplitude to remove. Optional input/output parameter indices contains the indices of spikes at the level specified, and optional input switch /neg requests that ``dark holes'' be removed.

5.3.6 SXT_GRID

Draws heliocentric grid over an image. It reads the ATT file to get information on the spacecraft pointing, and also calls GET_RB0P to get the solar radius. A sample call could be:
IDL >  tvscl, data(*,*,0)

IDL >  sxt_grid, index(0)
The keyword option /read will allow the user to move the cursor around the image and to display the heliocentric coordinates. If /angle is used with /read, then the value displayed is the angle relative to the sun center, which is useful to be used with SXT_PREP.

5.4  Routines for Data and Information Extraction

5.4.1 GET_INFO

See the description in the ``General Yohkoh Software'' chapter on page 2.4.5

5.4.2 EXT_SUBSET [*]

EXT_SUBSET extracts a subset (in x and y) of a data cube and creates a new data and index array (data_out and index_out) by typing:
IDL >  ext_subset,index_in,data_in,index_out,data_out
It is a mouse driven program.

5.4.3 GT_FILTA

GT_FILTA uses an index or roadmap structure to determine the setting of the A filter:
IDL >  a = gt_filta(index)
The filter setting will be returned as an integer (1-6) where

1 Open Op Op
2 Optical - narrow band NaBan NB
3 Quartz defocusing lens Quart Qz
4 Diffuser Diffu Df
5 Optical - Wide band WdBan WB
6 8% neutral density X-ray filter NuDen ND

The last two columns show what GT_FILTA returns when using the /string and /short options. The routine GET_INFO uses the /string option. It is possible to get a string type description of the filters used by typing:
IDL >  b = gt_filta(roadmap, /string)
You can get a listing of these at any time by typing the following:
IDL >  print,gt_filta()

5.4.4 GT_FILTB

GT_FILTB works exactly like GT_FILTA but works for the X-ray filters

1 Open Open Op
2 Thin Aluminum (1265 Å) Al.1 A1
3 Dagwood Sandwich AlMg AM
4 Beryllium (119 mm) Be119 Be
5 Thick Aluminum (11.5 mm) Al12 A2
6 Magnesium (2.5 mm) Mg3 Mg

The last two columns show what GT_FILTB returns when using the /string and /short options. The routine GET_INFO uses the /string option.

5.4.5 GT_PFI_FFI

GT_PFR_FFI extracts the information on whether the image is a partial frame image (PFI) or a full frame image (FFI). Even values are PFI, odd values are FFI in general.

0 PFI
1 FFI
2 PFI Observing Region
3 FFI Patrol Image

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

5.4.6 GT_RES

GT_RES extracts what resolution each SXT image was taken at by typing:
IDL >  res = gt_res(roadmap)
It outputs the resolution as a integer where:

0 full resolution
1 half resolution
2 quarter resolution

It is possible to get a string type description of the resolution by typing:
IDL >  res = gt_res(roadmap, /string)

5.4.7 GT_COMP

GT_COMP extracts what compression was used for each SXT image was taken at by typing:
IDL >  comp = gt_comp(roadmap)
It outputs the compression as a integer where:

0 Compressed (see routine SXT_DECOMP)
1 Low 8 bits (of 12 bits)
2 High 8 bits (of 12 bits)

5.4.8 GT_DPE

GT_DPE extracts what DP exposure (DPE) level was used. The DPE is a function of the shutter exposure level (MBE) and the neutral density filter use. It is possible to return the effective exposure duration in milliseconds by using the /conv switch).
IDL >  dpe = gt_dpe(index)

IDL >  msec = gt_dpe(roadmap, /conv)
The effective exposure for each of the DPE values are shown in the following table. For DPE values above 22, the effective exposure is

                exposure = (DPE-21) * 0.25 seconds
DPE Effective MBE Mask DPE Effective MBE Mask
Exposure Exposure
0 0.08 msec 0 with ND 19 668.00 msec 12
1 0.23 1 with ND 20 948.00 13
2 0.96 0 21 1.338 sec 14
3 1.37 2 with ND 22 1.888 15
4 2.88 1 23 2.668 16
5 3.06 4 with ND 24 3.778 17
6 4.67 5 with ND 25 5.338 18
7 6.28 6 with ND 26 7.548 19
8 9.50 7 with ND 27 10.678 20
9 17.00 2 28 15.108 21
10 28.00 3 29 21.358 22
11 38.00 4 30 30.208 23
12 58.00 5 31 42.718 24
13 78.00 6 32 60.418 25
14 118.00 7 33 85.438 26
15 168.00 8 34 120.828 27
16 238.00 9 35 170.878 28
17 338.00 10 36 241.668 29
18 468.00 11

5.4.9 GT_MBE

GT_MBE extracts what mail box exposure (MBE) level was used. This is the actual shutter exposure level commanded. It is possible to convert to commanded shutter duration in milliseconds by using the /conv switch).
IDL >  mbe = gt_mbe(index)

IDL >  shutdur = gt_mbe(roadmap, /conv)

5.4.10 GT_EXPDUR

GT_EXPDUR will calculate the effective exposure duration (not the commanded DPE) of a series of images given an index structure to work with. You can get an array of exposures (exps) in msec by typing one of the following. In the second example, it returns the shutter duration (which is also the CCD integration period). For dark images the value returned is the number of milliseconds the CCD integrated for which is in multiples of 8 msec (8 msec is the minimum for dark current images).
IDL >  expos = gt_expdur(index)

IDL >  expos = gt_expdur(index, /shut_dur)

5.4.11 GT_EXPLAT

GT_EXPLAT will calculate the latency time between the time which is stored in the index and the actual time the integration started. The value returned is in milliseconds and is typically between 50 and 100.
IDL >  explat = gt_explat(index)

5.4.12 GT_EXPMODE

GT_EXPMODE routine returns the exposure mode. The values it can return are:

0 Normal shuttered exposure
1 Dark image (shutter stays closed)
2 Calibration image (shutter open during readout)
 


IDL >  expmode = gt_expmode(index)

5.4.13 GT_CORNER

GT_CORNER will return the full resolution IDL (FRE) coordinates of the center of the pixel in the lower left hand corner.
IDL >  corners = gt_corner(roadmap)

IDL >  x0 = gt_corner(index, /x)

5.4.14 GT_CENTER

The output from GT_CENTER can be the location of the center of the field of view in (a) full resolution IDL (FRE) pixels, (b) heliocentric coordinates, (c) the angle E/W and N/S from the center of the sun in arcseconds, or (d) the HXT equivalent pixel coordinates. The default is to read the ATT S/C pointing database for the true de-jittered S/C pointing. It is possible to use the commanded S/C pointing information by using the /CMD option, which is much faster and only of slightly reduced accuracy.
IDL >  pix = gt_center(index)

IDL >  helio = gt_center(index, /helio)

IDL >  helio = gt_center(index, /helio, /cmd)

IDL >  ang = gt_center(roadmap)
where ang(0,*) is arcseconds east/west with east being negative and ang(1,*) is arcseconds north/south with north being positive. helio is in degrees, and pix is in full resolution pixels. It is possible to get the heliocentric coordinates in a string of the form ``N12W23'' by using the /STRING option.

5.4.15 GT_SXT_AXIS

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

                      Optical Axis (CCD Full-Res Pixels)
                             x             y

      X-ray                 515           633
      Narrow Band (NaBan)   514.64        634.47
      Wide Band   (WdBan)   515.24        634.26
The values can be quickly acquired on line using GT_SXT_AXIS. The next three lines will reproduce the values in the table above. Note that the routine also accepts an index or roadmap data structure and that the filter will be determined from the SXT structure.
; 0=X-ray

; 1=NaBan

; 2=WdBan

; NaBan relative to X-ray
The sign convention can be understood if you remember that the NaBan image is Northeast of the X-ray image.


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

The /rel_xray keyword option can be used to return the relative offset to the X-ray axis.

5.4.16 GT_PIX_SIZE

The angular size of the SXT full-resolution pixel was determined from pre-launch focal length measurements to be 2.45280 arc sec for the X-ray telescope. Half- and quarter-resolution images are twice and four times this value, respectively. A routine to provide this number is GT_PIX_SIZE which is called as:
IDL >  print,gt_pix_size()

IDL >  print,gt_pix_size(index)
If the SXT index or roadmap is passed in, the routine will return the appropriate pixel size in arc sec for the resolution of the data. The pixel size of the optical images is thought to be within 1% of the X-ray pixel size.

5.4.17 GT_TEMP_CCD

GT_TEMP_CCD returns the temperature of the CCD in degrees Celsius.
IDL >  temp = gt_temp_ccd(index)

5.4.18 GT_TEMP_HK

GT_TEMP_HK returns the temperature measured by the platinum resistance thermometer (PRT) on the spacecraft and SXT instrument. There are 16 temperatures saved in the SXT index.
IDL >  temp = gt_temp_hk(index, 0, title=title)

5.4.19 SXTPNT_SUM

The routine SXTPNT_SUM will read the observing log and give a summary of the unique PFI pointing for a given time period. It groups the summary listing based on each unique pointing location over time. See the User's Guide for a sample listing. For the command:
IDL >  sxtpnt_sum, '5-oct-93 13:00', '6-oct-93 1:00'
it will produce a file in your home directory with the name ``sxtpnt_sum.txt'' (unless you specify the output file name with the outfil keyword option).

5.4.20 PR_SXTOBS

The routine PR_SXTOBS will read the observing log and list each and every FFI and PFI image taken for the times requested. The format of the output is simply the output of GET_INFO which is described in detail in the Reference Guide. See the User's Guide for a sample listing. The keyword /long changes the formatting and information displayed.
IDL >  pr_sxtobs,'15-nov-91 22:00','15-nov-91 22:05'

IDL >  pr_sxtobs,'15-nov-91 22:00','15-nov-91 22:05',/long

5.4.21 PFI_LOC

PFI_LOC will display the SXT PFI location. There are two modes which can be used when calling PFI_LOC. If the first parameter is a date and time string, it will read the observing log and make a simple plot showing the location relative to the sun's limbs. If the first parameter is an SXT index, then it assumes that you have displayed this full frame image, and it reads the observing log and puts a box on the image where the PFI is located. Some sample calls are:
IDL >  pfi_loc, '23-jun-93 1:00'

IDL >  pfi_loc, timstr, hours=2

IDL >  pfi_loc, index

IDL >  pfi_loc, index, pfi_struct=sxtp

IDL >  pfi_loc, index, '6-nov-93 3:30'

IDL >  pfi_loc, index, '6-nov-93 3:30', /hour
It is possible to use the hours keyword option to specify the number of hours plus and minus the full frame time for which you wish to have PFI locations displayed. The pfi_struct option exists so that you can pass a PFI roadmap or index structure directly to the PFI_LOC to be displayed over the image. If a second positional parameter is passed, the routine will get the PFI locations for that time and overlay them on the image.

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

5.5  Routines for Calibration and Analysis

5.5.1 SXT_PREP

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

The input specifying which images to process can be either an index and data, or it can be the filenames infil and dataset numbers dset_arr. Some sample calling sequences are:
IDL >  sxt_prep, input1, input2, index_out, data_out

IDL >  sxt_prep, index, data, index_out, data_out

IDL >  sxt_prep, infil, dset_arr, index_out, data_out, $

IDL >   helio=[-9.8,-20.3], date_helio='14-JUN-92 02:37:41'

IDL >  sxt_prep, index, data, index_out, data_out, /helio, ref_image=10

IDL >  sxt_prep, index, data, index_out, data_out, ref_image=spr_index(0)

IDL >  sxt_prep, index, data, index_out, data_out, /roll

A description of some of the keywords follows:

------- Calibration Parameters -------
nocorrections If set, then LEAK_SUB, and therefore DARK_SUB, are not called.
dc_scalar If set, then a simple scalar value is used for dark current subtraction. Default is to take the image closest in exposure.
dc_interpolate If set, then perform interpolation on the dark frame images to get a better background subtraction. Default is to take the image closest in exposure.
upper_only If set, only flag +1 pixels above (in a column) the saturated area (not the -1 pixels) [see call to SXT_SATPIX].
sfd_corr If set, then the input image is an SFD image. Use the SFD decompression, perform the registration, and recompress using the SFD compression.

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

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

fill_gap A gap can exist between two PFI strips for a single observing region because of a change in S/C pointing. If this variable is set, then the gap between the PFI strips is filled by interpolating the lines above and below.
roll_do If set, then perform the corrections for the roll offset.
normalize If set, perform exposure normalization.

------- Miscellaneous Parameters ----
force_read If set, read all datasets at once even if input was specified with INFIL/DSET. This is available because doing LEAK_SUB on all images at once if the input is PFI is more efficient.
outfil If specified, the data will not be passed back in INDEX_OUT and DATA_OUT. Instead, it will be saved in an SDA file with the name specified by this parameter. If ``uncert" and ``satpix" are included in the procedure call, they will be saved with the same file name with a ``_unc" and a ``_sat" appended to the file name.

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

5.5.2 XSXT_PREP

XSXT_PREP was under development as this volume was being written. See the User's Guide for a overview of the capabilities of XSXT_PREP.

5.5.3 SXT_DECOMP

The SXT data are normally compressed from a 12-bit word to an 8-bit word via a pseudo-square-root compression algorithm. SXT_DECOMP takes the compressed data array (data) and creates an integer array (ndat) of the decompressed numbers by typing:
IDL >  ndat = sxt_decomp(data)

5.5.4 SXT_COMP

It is possible to re-compress the data. The routine SXT_COMP will compress integer data which is in the range between 0 and 4095 into byte data using the SXT compression algorithm.
IDL >  bdat = sxt_comp(data)

5.5.5 RESTORE_LOW8

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

5.5.6 SFD_COMP

The SFD (SXT Full-frame Desaturated) images use a logarithmic compression in order to save the data as byte type. SXT_COMP compresses the data into byte type. The compression algorithm assumes that the data input is in DN/sec/HR pixel and the values range between 0 and 106.
IDL >  data_out = sfd_comp(data_in)

5.5.7 SFD_DECOMP

The SFD (SXT Full-frame Desaturated) images use a logarithmic compression in order to save the data as byte type. The decompression algorithm is data_out = 10.(data_in/255.*6). The routine SFD_DECOMP will do this decompression for you. Beware: the output are floating type numbers and therefore, require four times as much memory.
IDL >  data_out = sfd_decomp(data_in)

5.5.8 EXP_NORM

EXP_NORM 2 takes a data array and produces an exposure and summation mode normalized floating point array. Note the floating array takes four times more room so don't use too big an array to start with. You need to give it an index array - make sure that the two correspond exactly or else the results will be meaningless. To run it, type:
IDL >  ndat = exp_norm(data,index)

IDL >  ndat = exp_norm(data,index,0)
To do this it follows the following steps:

5.5.9 SXT_COMPOSITE

SXT_COMPOSITE combines two or three SXT images with different exposures into a ``composite'' image. The longest exposure is used as the basis for the final exposure. SXT_COMPOSITE uses the results of SXT_SATPIX to identify the locations of saturated pixels and replaces them with equivalent pixels from the shorter exposure images, scaled for the long exposure image. This routine uses the algorithm that is used to produce the ``sfd'' images in the standard SXT movie. Example calls are:
IDL >  cimg = sxt_composite(index,data)

IDL >  cimg = sxt_composite(index,data,satpix=satpix)

IDL >  cimg = sxt_composite(index,data,dc_data,sx=[1,2,3],sd=[0,2,1])
By default, SXT_COMPOSITE will do dark and leak frame subtraction if data is byte-type. The user may optionally specify the dark-frame images in dc_data and will default to data-dc_data unless the explicit X-ray and Dark-frame indices are given in sx and sd, respectively.

Note that the replaced pixels are box-car smoothed with a smoothing window of 5 pixels.

5.5.10 MK_SFD

MK_SFD creates a desaturated set of images from a series of long and short exposures by typing:
IDL >  mk_sfd,infil,outfil,filpref
where infil is a string array of one or more SFR filenames (and locations), outfil is the string array containing the name of directory where you want the file to be created, and filpref is a string array which contains the three letter file prefix name (usually SFD). The desaturated image is compressed such that:

                      0 =         1 dn/sec/5 arcsec pixel
                    255 = 1,000,000 dn/sec/5 arcsec pixel
Use the routine SFD_DECOMP to restore the data from compressed bytes to real numbers.

5.5.11 DARK_SUB

It is possible to have the dark current removed from PFI and FFI images by using the following command:
IDL >  data_out = dark_sub(index,data)
The routine can interpolate between two reference images to simulate the input exposure duration by using the /interpolate option. It will call the routine GET_DC_IMAGE to get the proper image and take the subsection for the PFI cases. The SDC data files for the time period being calibrated must be in the directory $DIR_SXT_SDC.

The /interpolate option can be turned on and run automatically every time DARK_SUB is run by setting the environment variable ys_dark_interp. An example of how to turn this on and off is:
# will enable automatic interplation

# will disable automatic interplation
LEAK_SUB calls DARK_SUB if the input data is BYTE type, so normally a user does not need to call DARK_SUB directly.

5.5.12 GET_DC_IMAGE

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

It is possible to extract the dark frames manually using a command similar to the following example:
IDL >  get_dc_image, xxx,dc_index, dc_data, times='1-sep-92 1:00', res=0, dpe=15
The SDC data files for the time period being calibrated must be in the directory $DIR_SXT_SDC (and the SDW data files must be in $DIR_SXT_SDW when calibrating images which were taken when the TEC is off).

5.5.13 LEAK_SUB

On 13-Nov-92, there was an entrance filter failure which caused visible light to contaminate the X-ray images. It is possible to have the leak image removed from PFI and FFI images by using the following command:
IDL >  data_out = leak_sub(index,data)
The routine will call DARK_SUB if it comes in as byte type. The technique at the time of writing this guide was to find the sunset leak image which matched the following criteria

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

The leak image files must be in the directory $DIR_SXT_SFC.

5.5.14 INTERP_IMG

To linearly interpolate two images to a specified time type:
IDL >  interp_img, index1, img1, index2, data2, time, index_out, img_out

IDL >  interp_img, idx(10),img(*,*,10),idx(12),img(*,*,12), time, nidx, nimg
where the two input images to be interpolated are specified by the paired variables index and img. The input interpolation variable time can be in any Yohkoh standard time format. The returned parameters index_out and img_out refer to the interpolated index information and the interpolated image data respectively.

5.5.15 SXT_FSP and SXTBOX_FSP [*]

SXT_FSP is the same as HXS_FSP, but for SXT spectra, you now have the option to fit temperatures and emission measures using more than two filters.
IDL >  SXT_FSP, index, data, fit_pars
SXTBOX_FSP fits spectra to a given box, chosen by LCUR_IMAGE, for a set of SXT images.
IDL >  SXTBOX_FSP, index, data, fit_pars [, sc_par, ch_dta, sdel=sdel, $

IDL >   outfile=outfile, pfile=pfile, same_bx=same_bx, boxq=boxq]

5.5.16 SXTHXT_FSP and SXTHXTBOX_FSP [*]

See the description under in the HXT chapter.

5.5.17 SXT_TEEM

SXT_TEEM enables you to derive a temperature map (Te) from two filters taken of the same region. Some sample calls are:
IDL >  sxt_teem,index1,data1,index2,data2,Te

IDL >  sxt_teem,index1,data1,index2,data2,Te,EM,dTe,dEM,subs=subs

IDL >  sxt_teem,index1,data1,index2,data2,Te,EM,dTe,dEM,$

IDL >   sat1=sat1,sat2=sat2,unc1=unc1,unc2=unc2

IDL >  sxt_teem,index1,data1,index2,data2,Te,EM,dTe,dEM,$

IDL >   sat1=sat1,sat2=sat2,unc1=unc1,unc2=unc2,/average
index1,data1 should contain data for a single SXT filter. index2,data2 should contain data for a single SXT filter which is different from that contained in index1 and data1.

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

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

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

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

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

5.5.18 SXT_ERG_PER_DN

SXT_ERG_PER_DN returns the log of the radiative energy per DN assuming a coronal spectral model with temperature, Te. The units of the result are log10(erg/DN), where DN is assumed to be the decompressed and background subtracted value that is read out of the CCD camera. Example calling statements are:
IDL >  log10_erg_dn = sxt_erg_per_dn(log10_Te,filter)

IDL >  log10_erg_dn = sxt_erg_per_dn(log10_Te,filter,date='1-dec-92')
and log10_Te and filter are input variables which may be vectors. log10_Te is the log of the electron temperature (K), of the solar plasma and filter is the SXT filter number. For example, to compute log10(erg/DN) for all filters over the range of temperatures between log10(Te) between 5.5 and 8.0 use the following calling sequence:
; Generate a temperature vector

IDL >  log10_erg_dn = sxt_erg_per_dn(Te,indgen(6)+1)
The purpose of the date keyword option is to allow the post-November 1992 SXT response functions to be used. This can be invoked by specifying any date later than ``14-Nov-92'', the day after a hole in the entrance filter appeared, and caused the SXT response function to change.

5.5.19 SXT_VIGNETTE

The SXT vignette function was determined from pre-launch calibration data obtained at White Sands Missile Range (WSMR) and was further refined using flight data. The vignette function is approximated by two non-concentric cones. The routine SXT_VIGNETTE computes the SXT vignette function for a given SXT image as described in the scalar SXT index as follows:
; SXT Index should be a scalar

IDL >  vignette = sxt_vignette(array)

IDL >  vignette = sxt_vignette(index,energy)
If array is given then array = [x0,y0,Nx,Ny,Mode] and Mode = 0, 1, or 2, for full, half and quarter resolution. The second argument, energy will specify whether to use the low-energy results (derived from C-K and Al-K test data) or the high-energy results (derived from Ag-L test data). SXT_VIGNETTE is called by SXT_OFF_AXIS to correct SXT images. A quick summary is available by typing:
; Display SXT vignette function

5.5.20 SXT_OFF_AXIS

The X-ray vignetting function can be approximately removed with the routine SXT_OFF_AXIS. Example calling statements are:
IDL >  data_out = sxt_off_axis(index, data, index_out)

IDL >  data_out = sxt_off_axis(index, data, /update_index)

IDL >  vignette = sxt_off_axis(index, /vignette_only)
SXT_OFF_AXIS calls SXT_VIGNETTE to calculate the SXT X-ray vignette function. See SXT Calibration Note 37 and the Instrument Guide of this manual for more information. Two Vignette functions have been determined: the high-energy function is applied to the Al12 and Be119 filters and the low-energy function is applied to all other filters. Note that this approach is somewhat approximate and care should be used when applying this correction to SXT data.

5.5.21 WL_PROCESS [*]

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

5.6  Routines for Image Alignment

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

5.6.1 SXT_PREP

See the earlier section describing the details of SXT_PREP.

5.6.2 SXT_CENTER [*]

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

5.6.3 GET_GBO_PFI [*]

Given a SXT PFI image and either the file name of a ground-based image, or the ground-based image itself, GET_GBO_PFI will extract the portion of the GBO image corresponding to the SXT PFI. The routine (a modification of the routine GBO_PFI written by Alan McAllister) determines the PFI corners from index, rotates these to the time of the GBO image, and extracts the section of the GBO image. You can either pass in the GBO image itself, in which case you MUST also supply the time for it, or a string with the path/filename using the Yohkoh file name convention. Some sample calls are:
IDL >  gbo_img = get_gbo_pfi(index, gbo_fullimg, gbo_time)

IDL >  gbo_img = get_gbo_pfi(index, '/yd5/gbo91_46a/gkm911116.1958')

5.6.4 OCENTER

OCENTER will obtain the center of the Sun from a optical full frame image. It makes a ``silhouette image'' consisting of 1's and 0's, then calculates the centroid to determine x and y. The area is used to determine the image radius. The input image can be compressed or decompressed, and in any summation mode. The output is in SXT full resolution pixels unless /noscale is set.
IDL >  ocenter, image, x, y, radius

IDL >  ocenter, image, x, y, radius, /noscale, cut=0.3
where image is the 2-D input image, and x and y are the E/W and N/S position of the sun. radius is the solar radius in pixels and cut is the fraction of image maximum to define the limb (default is 0.2)

5.7  Routines for Accessing Secondary Database Files

5.7.1 GTAB_COMM, GTAB_ENTRY, GTAB_ROI

It is possible to get information on what was used in an SXT table by using one of these routines. GTAB_COMM returns information on the common table, GTAB_ENTRY returns information on the entry tables, and GTAB_ROI returns information on the ROI location and image shape tables. Some sample calls:
IDL >  print, gtab_comm(index)

IDL >  print, gtab_comm('15-nov-91')

5.7.2 GTAB_PFI and GTAB_FFI

These routines allow a user to print information on the partial-frame and full-frame observing sequence being used. There are four possible sequences for PFI and four more for FFI. Which sequence is used is determined by the DP mode and telemetry rate. If the SXT index for an image is passed, then it will figure out which of the four sequences was running at that time.
IDL >  print, gtab_ffi(index)

IDL >  print, gtab_pfi('15-nov-91', 2)
If a time is passed, it will default to show sequence number 0. It is possible to specify which sequence table by passing it as a second parameter.

5.8  Routines for Engineering Plots

5.8.1 PLOT_SOT

PLOT_SOT will plot out the aspect sensor degradation as a function of time by typing:
IDL >  .run plot_sot
It will produce plots for both the narrow-band and wide-band filters.

5.8.2 PLOT_TEMPS2 [*]

PLOT_TEMPS2 plots the SXT instrument temperatures. This program can only be run after the variable index exists which came from an SXT file. A common practice is to run PLOT_SOT which gets images over the whole mission.
IDL >  .run plot_temps2
A mosaic of time histories of the various instrument temperatures will be plotted.

5.8.3 PLOT_SSL

PLOT_SSL will plot the SXT summary log (SSL) information. A series of plots are made which include:

Sample calls are:
IDL >  plot_ssl

IDL >  plot_ssl, [0,1]

IDL >  plot_ssl, 3
where the second example only plots the first two series of plots (exposure levels and SXT temperatures), and the last example only plots percentage of data received.