Introduction to LASCO LEB Image Processing Software

Updated: 24 Nov 1998 - DW

a) Image Processing Flow

After an image is taken it is sitting in a section of computer memory which can then be processed in various ways before being transmitted to the ground. The user can specify up to 20 tasks to be performed on the image through the use of tables to specify parameters and tasks.

The most important of these tables is the image processing control table (IPC table). The IPC table consists of 20 rows with 20 elements in each row. Each element of a row is a integer specifying a task for the image processing software to perform on the image. Each row is a sequence of tasks to perform on the image. When a user specifys an exposure a row of the IPC table is specified to handle the completed image. The row of the table should be filled in prior to taking the exposure. We have tentatively divided the rows of the table up into groups for use by the various cameras.

Sequence 0 - 5   Reserved Common
         6 - 8   C1
         9 - 11  C2
         12 - 14 C3
         15 - 17 EIT
         18 - 19 Free

The Reserved Common sequences are basic image processing sequences that all telescopes can use and cover the basic image processing to get an image to the ground. These sequences will rarely change and only by general agreement.

The sequences for each telescope are for specific campaigns or sequences or studies by each set of telescope users. They should not be changed without the permission of the investigator using that telescope.

The last catagory is for use by any observer and should always be assumed to be different from the state that you left it. You should always setup these sequences before using them as some other observer may have altered them. These sequences would also be used for engineering tests.

b) Image Processing and Data Tables The following image processing tasks use data from other data tables:

IP task   		Data Table
-------			----------
1. Radial Spoke     	Solar Position and Spacecraft Attitude
2. Transient Watch      Transient Detect Array
3. Occulter Mask        Occulter table
4. Masking              Mask Table
The following image processing tasks set data in data tables:
1. Transient Watch      Inter-Instrument Table
			Transient Detect Array

b) Specific Issues

i) Data Correction

These routines are present to correct possible problems such as bad pixels and cosmic ray hits. These routines are: bad column averaging, inter min, camera and line sync strip. Bad column averaging is used to replace a bad column with the average of the adjacent good columns. The bad column average is controlled by the bad column map which is an uploadable table. The inter-min function is used to compare two images pixel by pixel and to generate a final image by taking the pixel with the minimum value. This is useful if there are many cosmic ray hits. Camera and line sync stripping is useful if there are errors in the camera or line sync. This routine is not need if the camera is acting properly. If the camera is skipping pixels or parts of lines, errors will appear in the 15th and 16th bit of each pixel value. This routine will attempt to realign lines of pixels by looking for the sync bits.

ii) Inter Instrument Flags

LASCO/EIT sets the inter-instrument flag using either of two methods. When the flag is set, a solar event ID and a set of solar coordinates are reported. Presently we have defined only two solar event IDs. The actual image used for the pixel search is not changed in any way and can still be sent to the ground or stored in the summing buffers after the search. The image used for the search can be the current image or from either summing buffer.

The first method (solar event ID = 1) is a delta search with a threshold. This is like a brightest pixel search except that an absolute value is taken prior to determining the brightest pixel. This is supposed to be applied to differenced images. This method would detect changes (plus or minus) above a threshold value.

The second method (solar event ID = 2) is simply a brightest pixel search above a threshold. The threshold is just a value that is uploaded. The inter-instrument flag is not triggered unless the brightest pixel is above the threshold. If more than one pixel is the "brightest" pixel i.e. have the same value then the position of the first one (closest to the readout port of the CCD) is reported.

Pixel coordinates are reported in units of 2 arc seconds with values of plus or minus 511 units in the X and Y coordinates. The values are reported as twos complement numbers. If either coodinate is 511 or -511 then the bright point is outside the range +/- 1024 arc seconds from sun center in that coordinate and is off the disk of the sun.

In our tests, there are a few important notes. It is important to have the proper sun center coordinates and roll angle uploaded for the telescope being used. Also cosmic ray hits can cause spurious results. One of our bright pixel searchs found a cosmic ray with a pixel value of 13000. This was about 3 times the "normal" pixel value.

iii) Occulters and Masks

These tasks set flags for the usage of the Region of Interest (ROI) and occulter masks. The masks save telemetry by not transmitting blocks of the image where there is no information or no information is desired. The image area consists of 1024 blocks arranged in a 32 x 32 array. The ROI and occulter mask tables consists of 64 words (1024 bits) for each camera. A bit set to one indicates a block that will or will NOT be will not be transmitted (not inverted/inverted). The mask flag controls the use of the mask table. The default is not to use the mask table.

If the mask table is not in use then the occulter flag is checked. The occulter mask is normally used.

iv) Data Compression and Transmit

These are the most important routines since they must be called in order to get an image into the telemetry. The routines may be divided into two classes, those that transmit and those that do not transmit. The routines that do data compression and then transmit are those that alter the image so much that no further manipulation of the image can be done. These routines are : Rice compression, ADCT compression, Hcompress, and the transmit uncompressed image mode. The uncompressed image mode is normally used only for debugging.

The remaining data compression routines are typically used with Rice compression: radial spoke, square root, divide by 2. These routines reduce the number of bits per pixel in a systematic method before being sent to the data compression routines which transmit the data.

v) Image Summing and Differencing

The image summing and differencing routines are designed to be used in conjunction with the summing and differencing observing program. The summing program will add together images with a weighting factor that is specified in the default table. There are two differencing routines . The first type (Inter diff with fixed reference) differences successive images against a reference image taken earlier. The second type differences images with the immediately preceeding image. For the details of how to sum and difference images see the description of the observing programs.

vi) Debug Images

Calling these routines generate test images entirely within the LEB. The image generated overwrites the actual camera image. This capability was included primarily for software and telemetry engineering tests.

The C2 and C3 model images were generated by taking a radial slice of actual C2 and C3 images and then setting the pixel value according to radius. The resulting image has a typical proper intensity roll off with radius and shows the diffraction around the occulter..

vii) Summing Buffers

Two summing buffers are provided for image processing. Each can hold one image. Summing buffers and useful for summing and differencing images. Each buffer should be cleared prior to use. The Use Summing Buffer N command is used to send the contents of the buffer; it sets a flag which tells the software that when No Compression, Rice, Hcompress or ADCT is called to send the contents of the buffer instead of the current image. If you wanted both the current image and the contents of the summing buffer you could use a sequence like "Rice,Use Sum Buffer 1, Rice". The Use Summing Buffer N command also is used by the Inter-instrument search routines and the ROI Mask Fill by Threshold routines to command use of a summing buffer rather than the current image as input. By default the current image is normally used, unless the Use Summing Buffer N command is sent.

An example of using the summing buffers is shown in the description of the "Take Sum" LP.

Note that it is also possible to difference the two summing buffers and store the result in buffer 1. You can sum reference images in buffer 2, source images in buffer 1 and then transmit the difference. Note that differencing single images is done more efficently in the Take Sum LP.

c) List of Codes for Image Processing Tasks

        0 = No op (signals end of sequence)
        1 = Bad Column Averaging
        2 = Inter Min
        3 = Shift Right 1 Bit (divide by 2)
        4 = Intra Sum (Pixel summing)
        5 = Radial Spoke
        6 = Square Root
        7 = Pyramid (Super Pixels for Transient Detect)
        8 = Inter Sum
        9 = Inter Diff (fixed base)
        10 = Inter Diff (moving base)
        11 = No Compression
        12 = Rice (lossless compression)
        13 = ADCT (lossy compression)
        14 = DCMP (lossy compression)
        15 = Camera and line sync strip
        16 = Inter-instrument bright pixel search
        17 = Inter-instrument delta pixel search
        18 = Fabry Perot Image Summing
        19 = Transmit Image as Raw Telemetry
        20 = Transmit Header Only
        21 = Debug Image 0 - Linear Gradient - occulter off
        22 = Debug Image 1 - Inverse Radial Gradient- occulter off
        23 = Debug Image 2 - Radial Gradient - 2 DN - occulter off
        24 = Debug Image 3 - Radial Gradient - 256 DN - occulter on
        25 = Use Image Mask Table
        26 = Do Not Use Image Mask Table
        27 = Do Not Use Occulter Mask (default = use Occulter mask)
        28 = Debug Image 4   - full Scale Linear Grad
        29 = Invert is_masked[] table when masking image
        30 = Do not invert is_masked[] table when masking image
        31 = Transmit Transient Detect Array
        32 = Reset Science Circular Buffer 
        33 = Clear ROI mask table for current camera
        34 = Set ROI by threshold 
        35 = Use Image Buffer
        36 = Use Summing Buffer 1
        37 = Clear Summing Buffer 1
        38 = Add Current Image to Summing Buffer 1 (Sum Buff 1 Plus)
        39 = Subtract Current Image from Summing Buffer 1 (Sum Buff 1 Minus)
        40 = Use Summing Buffer 2
        41 = Clear Summing Buffer 2
        42 = Add Current Image to Summing Buffer 2 (Sum Buff 2 Plus)
        43 = Subtract Current Image from Summing Buffer 2 (Sum Buff 2 Minus)
        44 = Subtract Sum Buff 2 from Sum Buff 1 (SB1 = SB1 - SB2)
        45 = Debug Image 5 - C2 Model
        46 = Debug Image 6 - C3 Model
        47 = H-compress - scale_factor[0] (lossless)
        48 = H-compress - scale_factor[1]
        49 = H-compress - scale_factor[2]
        50 = H-compress - scale_factor[3]
        51 = H-compress - scale_factor[4]
        52 = H-compress - scale_factor[5]
        53 = H-compress - scale_factor[6]
        54 = H-compress - scale_factor[7]
        55 = H-compress - scale_factor[8]
        56 = H-compress - scale_factor[9]

d) Power-Up Default IPC Table

Sequence	Tasks
--------	-----
0		Transmit
1		Radial Spoke, Rice Compress & Transmit
2		Rice Compress & Transmit
3		ADCT Compress & Transmit
4		Transmit Science header only
5		Generate Linear Gradient, Transmit
6		Generate Linear Gradient, Rice Compress & Transmit
7		Generate Linear Gradient, ADCT Compress & Transmit
8		Debug (Lockheed) Transmit
8		Inter-Instrument Bright Pixel, Rice Compress & Transmit
10		Generate 256 DN Radial Gradient , Transmit
11		Generate 256 DN Radial Gradient , Rice Compress & Transmit
12		Generate 256 DN Radial Gradient , ADCT Compress & Transmit
13		Pixel Sum , Rice Compress & Transmit
14		Generate Full Scale Linear Gradient, Occ off, Rice & Transmit
15		Occulter off, Rice & Transmit
16		Occulter off, Fixed Base Diff, Rice & Transmit
17		No op
18		Generate Full Scale Linear Gradient, Occ off, ADCT & Transmit
19		Occulter off, Rice Compress & Transmit