Table of Contents Previous Chapter
The purpose of the Bad Pixel and Column Map classes are to maintain a persistent list of bad CCD pixels and columns within the instrument. Within the instrument, there is one bad pixel map, and two bad column maps. The bad column maps are respectively associated with Timed Exposure mode and Continuous Clocking mode. These lists are used by science processing to prevent flickering pixels from saturating telemetry with non-X-ray event data.
The following lists the use of the Bad Pixel and Column Map classes:
Figure 140 illustrates the class relationships used by the Bad Pixel and Column Map classes. These classes include the BadPixelMap class, which is responsible for maintaining a list of bad pixels, and a BadColumnMap class, which is responsible for maintaining a list of bad column entries. In order to prevent stray pointers from corrupting the tables, there contents are maintained within Instruction Cache RAM (I-cache). The BadPixelMap and BadColumnMap classes both use the Mongoose class to read and write to this RAM.
FIGURE 140. Bad Pixel and Column Map Class Relationships
BadPixelMap- This class represents a list of bad pixels for all CCDs in the system. This class maintains the list in I-cache and provides functions to append new entries to the end of the list (addPixel), remove all entries from the list (removeAll), retrieve an entry from the list (getPixel) and get the total number of entries currently stored in the list (getCount). In order to support dumping the list to telemetry, the class also provides a function which returns the address of the start of the list, and the number of 32-bit words contained in the list (getMapInfo).
BadColumnMap- This class represents a list of bad columns for all CCDs in the system. This class maintains the list in I-cache and provides functions to append new entries to the end of the list (addColumn), remove all entries from the list (removeAll), retrieve an entry from the list (getColumn) and get the total number of entries currently stored in the list (getCount). In order to support dumping the list to telemetry, the class also provides a function which returns the address of the start of the list, and the number of 32-bit words contained in the list (getMapInfo).
Mongoose- This class is provided by the Devices class category, and is used by the BadPixelMap and BadColumnMap classes to write and read data to and from I-cache RAM (icacheWrite, icacheRead).
In order to reduce the opportunity that writes through a corrupted data pointer will corrupt the bad pixel and column maps, these maps are maintained within Instruction Cache RAM. Each map consists of a 32-bit entry count, followed by zero or more entries. For bad pixel maps, each entry is 32-bits wide. For bad column maps, each entry is 16-bits wide. Table 25 illustrates a proposed layout for the bad pixel and column maps.
TABLE 25. I-cache Bad Pixel and Column Map Layout (TBD)
-------------------------------------------------------------------------------------- Region Address Byte Size Description-------------------------------------------------------------------------------------- Patch Area 0x800fffff 0x30400 0x800cfc00 Bad Pixel Map Entries 0x800c5c04 0x9ffc Array of bad pixel map entries (max. 10239) Count 0x800c5c00 0x4 Number of 32-bit bad pixel map entries in the table Continuous Clocking Entries 0x800c4404 0x17fc Array of bad column map entries Bad Column Map (max. 3070 entries) Count 0x800c4400 0x4 Number of 16-bit bad column map entries in the table Timed Exposure Entries 0x800c2c04 0x17fc Array of bad column map entries Bad Column Map (max. 3070 entries) Count 0x800c2c00 0x4 Number of 16 bit bad column map entries in the table Parameter Blocks 0x800c0400 0x2800 System Configuration 0x800c0000 0x400 Code 0x80080000 0x40000 --------------------------------------------------------------------------------------
The bit layout for a bad pixel entry is as follows:
---------------------------- 31 30 23 20 19 10 9 0---------------------------- 0 CCD Id Column Row ----------------------------
Where row and column specify the row and column position of the pixel within the CCD, and CCD Id specifies which CCD has the bad pixel. 0 indicates that the corresponding bits are set to 0 in a map entry.
Bad column entries are bit-packed into each 32-bit entry location within I-cache, starting with the lower 16-bits. If there are an odd number of bad column entries in the table, the last 32-bit word in the table will contain 0 in its upper 16-bits. (NOTE: There is no ambiguity since he count at the beginning of the table reflects the number of column entries, not pairs of entries). The format of a 32-bit word containing two entries is as follows:
-------------------------------------------------------------- 31 30 29 26 25 16 15 14 13 10 9 0-------------------------------------------------------------- 0 CCD Id 1 Column 1 0 CCD Id 0 Column 0 --------------------------------------------------------------
Where Column specifies the position of the column pixel within the CCD, and CCD Id specifies which CCD has the bad pixel. 0 indicates that the corresponding bits are set to 0 in a map entry.
Figure 141 illustrates the steps used by the client to append a bad pixel to the end of the bad pixel map. The steps to append a bad column are similar.
FIGURE 141. Append Bad Pixel to map
Figure 142 illustrates the steps used by the client to remove all entries from the bad pixel map. The steps to remove all entries from a bad column map are similar.
FIGURE 142. Delete contents of map
Figure 143 illustrates the steps used by the client to retrieve an entry from the bad pixel map. The steps to obtain a bad column entry.
FIGURE 143. Get Bad Pixel entry
Figure 144 illustrates the steps used by a client to obtain the address and word length of the bad pixel map. The steps to obtain the corresponding address and length of a bad column map are similar.
FIGURE 144. Get Map Address and Length
Hierarchy:
Superclasses:
none
Implementation Uses:
Mongoose
Public Interface:
Operations:
BadPixelMap() addPixel() getCount() getMapInfo() getPixel() removeAll()
Protected Interface:
Operations:
getAddress() setCount()
Private Interface:
Has-A Relationships:
Arguments:
unsigned* base
unsigned words
Documentation:
This is the constructor for the bad pixel map. base is the base address of the map in I-cache, and words is the maximum number of words that can be stored in the map. The initialization statements for the constructor set baseAddress to the passed base, and maxCount to the passed words.
Arguments:
CcdId ccdid
unsigned row
unsigned column
Documentation:
This function adds a pixel to the bad pixel map. ccdid is the CCD which contains the bad pixel. row and column identify the pixel's row and column location within the CCD. If successful, the function returns BoolTrue. If the map is full and the pixel cannot be stored, it returns BoolFalse.
Arguments:
unsigned index
Documentation:
This function obtains the I-cache for the table entry indicated by index. The function uses getCount() to obtain the number of entries in the table. If index is beyond the end of the table, this function returns 0, otherwise, it adds index + 1 to baseAddress (the plus 1 handles the count field at the beginning of the table) to form the address of the entry, and returns the computed table entry address.
Arguments:
const unsigned*& addr
unsigned& wordcnt
Documentation:
This function retrieves the base address of the bad pixel map, and the number of 32-bit words currently stored in the map. On return, addr contains the address of the map in I-cache (baseAddress), and wordcnt contains the number of words in the map (result of getCount() + 1).
Arguments:
unsigned index
CcdId& ccdout
unsigned& rowout
unsigned& colout
Documentation:
This function retrieves the bad pixel indexed by index. On return, ccdout contains the CCD which contains the bad pixel, and rowout and colout contain the row and column position within the CCD. If index is within range, the function returns BoolTrue. If index is beyond the last entry in the map, the function returns BoolFalse.
Arguments:
unsigned count
Documentation:
This function sets the number of pixels currently stored in the bad pixel map. This function uses mongoose.icacheWrite() to store count into the first location of the map.
Hierarchy:
Superclasses:
none
Implementation Uses:
Mongoose
Public Interface:
Operations:
BadColumnMap() addColumn() getColumn() getCount() getMapInfo() removeAll()
Protected Interface:
Operations:
getAddress() setCount()
Private Interface:
Has-A Relationships:
Arguments:
unsigned* base
unsigned words
Documentation:
This is the constructor for the bad column map. base is the base address of the map in I-cache, and words is the maximum number of words that can be stored in the map. The initialization statements for the constructor set baseAddress to the passed base, and maxCount to the passed words.
Arguments:
CcdId ccdid
unsigned column
Documentation:
This function adds a column to the bad column map. ccdid is the CCD which contains the bad column. column identifies the column's location within the CCD. If successful, the function returns BoolTrue. If the map is full and the column cannot be stored, it returns BoolFalse.
Arguments:
unsigned index
Documentation:
This function obtains the I-cache for the table entry indicated by index. The function uses getCount() to obtain the number of entries in the table. If index is beyond the end of the table, this function returns 0, otherwise, it adds (index/2) + 1 to baseAddress (NOTE: The divide by two is because there are two entries per 32-bit I-cache word, and the plus 1 handles the count field at the beginning of the table) to form the address of the entry, and returns the computed table entry address.
Arguments:
unsigned index
CcdId& ccdout
unsigned& colout
Documentation:
This function retrieves the bad column indexed by index. On return, ccdout contains the CCD which contains the bad column, and colout contains the column position within the CCD. If index is within range, the function returns BoolTrue. If index is beyond the last entry in the map, the function returns BoolFalse.
Arguments:
const unsigned*& addr
unsigned& wordcnt
Documentation:
This function retrieves the base address of the bad column map, and the number of 32-bit words currently stored in the map. On return, addr contains the address of the map in I-cache (baseAddress), and wordcnt contains the number of words in the map. The wordcnt is computed by dividing the result of getCount() by two, rounding up to the nearest word, and adding 1 (for the count field at the start of the table).
Arguments:
unsigned count
Documentation:
This function sets the number of columns, count, currently stored in the bad column map using mongoose.icacheWrite().