Swift TOO API
Swift MOC

swift_too module

Swift_SAA example - Querying times when Swift is passing through the South Atlantic Anomaly

API version = 1.2, swifttools version 2.4.2

Author: Jamie A. Kennea (Penn State)

This is a class to determine when Swift will be inside the South Atlantic Anomaly (SAA). During SAA passages, all instruments are turned off. There are two SAA definitions, the default is the Spacecraft SAA definition which is used by the Swift X-ray Telescope (XRT) and UV/Optical Telescope (UVOT). The second is an approximation of the Burst Alert Telescope (BAT) SAA time. As BAT self determines if it is in the SAA based on rates, the BAT SAA is based on a model that predicts when this should happen.

from swifttools.swift_too import SAA

Querying SAA times

In order to query when Swift will be going through the SAA on a particular day, just call as follows:

saa = SAA('2022-03-30')
saa
#BeginEnd
02022-03-30 00:00:002022-03-30 00:14:52
12022-03-30 10:30:562022-03-30 10:38:45
22022-03-30 12:07:362022-03-30 12:29:02
32022-03-30 13:46:032022-03-30 14:10:57
42022-03-30 15:24:522022-03-30 15:51:18
52022-03-30 17:04:512022-03-30 17:31:00
62022-03-30 18:46:352022-03-30 19:10:39
72022-03-30 20:28:382022-03-30 20:50:18
82022-03-30 22:10:302022-03-30 22:29:49
92022-03-30 23:53:012022-03-31 00:00:00

As can be seen able, the returned value is a table of SAA begin and end times. The default first parameter passed to SAA above is begin. For this request length defaults to 1 day, so the value of end is automatically set to 2022-03-30. You can set begin, end and length by hand if you wish.

So an alternative way to do the above could be:

SAA('2022-03-29','2022-03-30')
#BeginEnd
02022-03-29 00:07:092022-03-29 00:24:03
12022-03-29 12:15:502022-03-29 12:35:52
22022-03-29 13:54:102022-03-29 14:18:32
32022-03-29 15:32:572022-03-29 15:59:06
42022-03-29 17:12:222022-03-29 17:38:55
52022-03-29 18:53:522022-03-29 19:18:31
62022-03-29 20:36:012022-03-29 20:58:14
72022-03-29 22:17:532022-03-29 22:37:45
82022-03-29 23:59:552022-03-30 00:00:00

or

SAA('2022-03-29',length=1)
#BeginEnd
02022-03-29 00:07:092022-03-29 00:24:03
12022-03-29 12:15:502022-03-29 12:35:52
22022-03-29 13:54:102022-03-29 14:18:32
32022-03-29 15:32:572022-03-29 15:59:06
42022-03-29 17:12:222022-03-29 17:38:55
52022-03-29 18:53:522022-03-29 19:18:31
62022-03-29 20:36:012022-03-29 20:58:14
72022-03-29 22:17:532022-03-29 22:37:45
82022-03-29 23:59:552022-03-30 00:00:00

BAT SAA passage times

In order to estimate SAA passage times for the BAT instrument, simply set the parameter bat = True, e.g.:

saa = SAA('2022-03-29',bat=True)
saa
#BeginEnd
02022-03-29 00:07:232022-03-29 00:22:15
12022-03-29 01:52:222022-03-29 01:52:40
22022-03-29 01:52:512022-03-29 01:57:44
32022-03-29 12:16:362022-03-29 12:21:49
42022-03-29 12:21:552022-03-29 12:24:13
52022-03-29 13:52:482022-03-29 14:11:21
62022-03-29 15:32:122022-03-29 15:53:08
72022-03-29 17:12:312022-03-29 17:35:01
82022-03-29 18:54:062022-03-29 19:14:14
92022-03-29 20:36:232022-03-29 20:55:09
102022-03-29 22:18:122022-03-29 22:34:33

You will notice that the times for entry and exit differ for BAT, and the passages are usually shorter.

Accessing the pass information

In order to access information on an individual pass, you can see in the tables above the first column gives the array index of each entry, therefore you can access the information about the SAA pass @ 18:54:06 by the following command:

saa[8]
BeginEnd
2022-03-29 18:54:062022-03-29 19:14:14

The above is a instance of the Swift_SAA_Entry class, which is a simple container class that contains two entries, begin and end, which give the beginning and end times of the SAA passage.

print(saa[8].begin)
2022-03-29 18:54:06
print(saa[8].end)
2022-03-29 19:14:14

A note about clock correction

Note that all times in the Swift_SAA class are times in UTC. However, if you want to know when the SAA times will happen in either Mission Elapsed Time (seconds since 2001-01-01 as measured by Swift's onboard clock) or Swift Time (a simple conversion of MET to a UTC-like date format, without leap second or clock drift adjustments), you can perform a clock correction using the clock_correct() method, e.g.:

saa.clock_correct()
saa
#Begin (UTC)End (UTC)
02022-03-29 00:07:232022-03-29 00:22:15
12022-03-29 01:52:222022-03-29 01:52:40
22022-03-29 01:52:512022-03-29 01:57:44
32022-03-29 12:16:362022-03-29 12:21:49
42022-03-29 12:21:552022-03-29 12:24:13
52022-03-29 13:52:482022-03-29 14:11:21
62022-03-29 15:32:122022-03-29 15:53:08
72022-03-29 17:12:312022-03-29 17:35:01
82022-03-29 18:54:062022-03-29 19:14:14
92022-03-29 20:36:232022-03-29 20:55:09
102022-03-29 22:18:122022-03-29 22:34:33

As you can see now the columns are explicitly listed as being UTC. You can convert to Swift Time easily, like so:

saa.to_swifttime()
saa
#Begin (Swift)End (Swift)
02022-03-29 00:07:51.8644212022-03-29 00:22:43.864481
12022-03-29 01:52:50.8648472022-03-29 01:53:08.864848
22022-03-29 01:53:19.8648492022-03-29 01:58:12.864869
32022-03-29 12:17:04.8673792022-03-29 12:22:17.867400
42022-03-29 12:22:23.8674002022-03-29 12:24:41.867410
52022-03-29 13:53:16.8677692022-03-29 14:11:49.867844
62022-03-29 15:32:40.8681722022-03-29 15:53:36.868257
72022-03-29 17:12:59.8685792022-03-29 17:35:29.868670
82022-03-29 18:54:34.8689912022-03-29 19:14:42.869073
92022-03-29 20:36:51.8694062022-03-29 20:55:37.869482
102022-03-29 22:18:40.8698192022-03-29 22:35:01.869885

or access the MET times of individual SAA passage times, by using the met attribute:

saa[8].begin.met
670272874.868991

Swift Mission Operations Center

The Pennsylvania State University
301 Science Park Road,
Building 2 Suite 332,
State College, PA 16801
USA
☎ +1 (814) 865-6834
📧 swiftods@swift.psu.edu

Swift MOC Team Leads

Mission Director: John Nousek
Science Operations: Jamie Kennea
Flight Operations: Mark Hilliard
UVOT: Michael Siegel
XRT: Jamie Kennea