The Neil Gehrels Swift Observatory

Filtering Swift Data for Good Attitude

Overview:

It is essential to make sure Swift data are obtained during times of good spacecraft attitude in order to get reliable positions and good quality images. This thread describes the procedure to filter event data based on columns in the spacecraft attitude file.

Read this thread if you want to: Filter swift data on attitude information.

Last update: Sept 17, 2007

Introduction:

Swift filter files (swOBSIDs.mkf) contain information about the status of the onboard star trackers that report whether the satellite is "locked" on target, as well as the quality of the aspect solution. The spacecraft reports whether it is slewing, settling or pointed in the status bit and the quality of the aspect solution is reported in the loss function.

It is important to keep in mind that even if the star tracker claims to be "locked", it may have a poor aspect solution. The result is that the spacecraft is not pointed at the reported position. Filtering data on the star tracker "loss function" described below insures that only data during reliable attitude periods is included in the cleaned file.

The Swift team expects this condition to occur more frequently during the time period of spacecraft gyro recalibrations which began on 10August2007. The UVOT has been off during this time, but any data taken with BAT or XRT could suffer from either a loss of lock or a poor aspect solution. The filtering described here is meant to exclude data during these periods.

For best results, we recommend the following filtering criteria:

Filtering on the SETTLED Flag

This filter assures that the spacecraft reports that it has "settled" onto the target position after a slew. For BAT and XRT event data, the pipeline already creates cleaned event lists with this filter in place. This flag is available as a column in the swOBSIDs.mkf file which can be found in each observations's /auxil directory.

To filter on this quantity, include the expression

SETTLED==1 

when producing cleaned event lists.

Filtering on Star Tracker Status Bit

Most versions of the SDC processing pipeline include in the swOBSIDs.mkf file a star tracker status word. Bit 5 of this word reports whether the star tracker is locked.

To filter on this quantity, include the expression

(SAC_MODESTAT / 32) % 2 == 1

when producing cleaned event lists.

In very early versions of the SDC data processing pipeline, this column was not included in the .mkf file. In these cases the information can be found in the spacecraft housekeeping extension "hk011x001".

Star tracker estimated attitude error

Most versions of the SDC processing pipeline include in the swOBSIDs.mkf file a crude estimate of the attitude error in radians.

To filter on this quantity, include the expression

SAC_ADERR < 0.2 

when producing cleaned event lists.

In very early versions of the SDC data processing pipeline, this column was not included in the .mkf file. In these cases the information can be found in the spacecraft housekeeping extension "hk011x001".

Star tracker loss function

The swOBSIDs.mkf file includes a column called STAST_LOSSFN containing the mean-squared star tracker solution error in square radians. In early versions of the SDC pipeline, erroneous scale factors were applied to the values in this column. Therefore, it is necessary to check for values both with and without the proper scale factors.

This quantity can be converted to degrees by computing

sqrt(STAST_LOSSFCN)*180/#PI

Occasionally the telemetry has a bad value (raw value=65535) which must be removed.

In very early versions of the SDC data processing pipeline, this column was not included in the .mkf file. In these cases the information can be found in the spacecraft housekeeping extension "hk014x001".

(a) The filter expression to remove the bad values is:

     (STAST_LOSSFCN != 65535)&&(! NEAR(STAST_LOSSFCN,65535E-12,1e-12))

(b) Use the GTI expression below to remove times when loss function is too large. The example uses the recommended threshold value of 1.0E-9:

$stlossfcn_thresh = 1.0E-9

     ((STAST_LOSSFCN < 1.0)?(STAST_LOSSFCN < $stlossfcnthresh):(STAST_LOSSFCN*1E-12 < $stlossfcnthresh))

The recommended threshold of 1e-9 has been shown to reject about 1% of the data in a 100 day BAT test data set from 2005. The threshold is equivalent to a 6.5 arcsec r.m.s. error in the star tracker solution.

The table below shows the trade between loss function threshold and fraction of data kept in the test data set.

Fraction Kept    Log10 (Loss Function)
   >50%              -10.3
   >90%              -9.7
   >95%              -9.5
   >99%              -9.0