Swift TOO API
Swift MOC

swift_too module

Swift_Data example - querying Swift SDC data and downloading it

API version = 1.2, swifttools = 3.0.6

Author: Jamie A. Kennea (Penn State)

from swifttools.swift_too import Data
from swifttools.swift_too import ObsQuery

Introduction

We've demonstrated that with classes such as Swift_ObsQuery we can find out what Swift has observed, but what if we want to download the data associated with an observation? Before you had to go to a web interface to download the data you wanted. More confusingly, the data usually reside in one of two places: the archive or the quicklook area. Typically recent observations exist in quicklook, and older observations are in the archive.

Finding an interesting observation

Swift_Data aims to make fetching observation data automated, and somewhat abstracted, so you don't have to care about if data are from quicklook or not. Let's find a recent observation, and download it. How about the first few observations of Jan 10th, 2021? As of swifttools 2.3, you can shorten the names of the classes by removing the Swift_ so we'll use just Data and for the next example, ObsQuery.

oq = ObsQuery(begin="2022-01-10", length=0.1)
oq
Begin TimeEnd TimeTarget NameObservation NumberExposure (s)Slewtime (s)
2022-01-09 23:52:022022-01-10 00:12:58NGC5986000459070091115141
2022-01-10 00:13:022022-01-10 00:20:57PSZ1_G357.43+30.600008565100141065
2022-01-10 00:21:022022-01-10 00:51:01GRB 220101A010915270091610189
2022-01-10 00:51:022022-01-10 01:12:01OGP_4313031030180011080179
2022-01-10 01:12:022022-01-10 01:28:57MRK 81700096450022835180
2022-01-10 01:29:022022-01-10 01:36:01NGC 539803110928017275144
2022-01-10 01:36:022022-01-10 01:57:59HEN 3-110300083966007126057
2022-01-10 01:58:022022-01-10 02:23:00RX J0134.2-4258000365280601355143
2022-01-10 02:23:022022-01-10 02:44:58OGP_3952031031670031185131

OK, so that observation fo NGC 5986 is interesting, so let's check it out. The important identifier for any observation is the Observation Number (or Observation ID). In the table above, this is given in SDC format, which is a importantly, a string (those leading zeros are required). So for this observation, the obsid is 00045907009. However, we don't have to make transcription errors here, it's the first in the oq data structure, i.e...

oq[0]
Begin TimeEnd TimeTarget NameObservation NumberExposure (s)Slewtime (s)
2022-01-09 23:52:022022-01-10 00:12:58NGC5986000459070091115141

Demonstrating the Swift_Data class

So let's demonstrate use of the Swift_Data class. As usual, it can be set up by creating the class and then setting the parameters, then submitting using the submit method, or you can pass the parameters as arguments to the class. We'll do the former first.

data = Data()
data.obsid = oq[0].obsid

OK so this sets up that we want to fetch data associated with the obsid for NGC5986. Next we have a few options to set. Firstly, there are 5 types of data that can be downloaded. These are:

  • auxil : Auxillary data required to process Swift data, including Two Line Element (TLE) to calculated an ephemeris, and spacecraft housekeeping.
  • log : Log files from the SDC processing. Of interest, but usually inessential for data analysis.
  • xrt : Data for Swift's X-ray Telescope.
  • bat : Data for Swift's Burst Alert Telescope
  • uvot : Data for Swift's UV/Optical Telescope

In order to select which data you wish to download, simply set the parameter listed above to true, so if you want XRT data, set xrt = True. If you just want to get everything, you can set all = True as a shortcut. Let's get XRT, BAT and UVOT data for this observation, forget about the logs. FYI auxil data come down by default, as you always need those if you're going to run processing pipeline tools like xrtpipeline.

data.xrt = True
data.uvot = True
data.bat = True

So in terms of basic configuration, this is pretty much it. Next step is to query the existance of data. This is done by submitting the job.

data.submit()
True

OK that appeared to have worked, so let's look at the files available. In a Jupyter Notebook, just type in the name of the Swift_Data object we created.

data
PathFilenameDescription
00045907009/auxilSWIFT_TLE_ARCHIVE.txt.22018.37267907.gzAuxillary TLE file
''sw00045907009pat.fits.gzAuxillary attitude file
''sw00045907009pjb.par.gzAuxillary file
''sw00045907009pob.cat.gzAuxillary catalog
''sw00045907009ppr.par.gzAuxillary file
''sw00045907009s.mkf.gzAuxillary file
''sw00045907009sao.fits.gzAuxillary file
''sw00045907009sat.fits.gzAuxillary attitude file
''sw00045907009sen.hk.gzAuxillary housekeeping
''sw00045907009sti.fits.gzAuxillary file
''sw00045907009uat.fits.gzAuxillary attitude file
''sw00045907009x.mkf.gzAuxillary file
00045907009/xrt/eventsw00045907009xpcw3po_cl.evt.gzXRT pointed cleaned PC event file
''sw00045907009xpcw3po_uf.evt.gzXRT pointed unfiltered PC event file
''sw00045907009xwtw2sl_cl.evt.gzXRT slew cleaned WT event file
''sw00045907009xwtw2sl_uf.evt.gzXRT slew unfiltered WT event file
''sw00045907009xwtw2sl_ufre.evt.gzXRT slew unfiltered WT event file
''sw00045907009xwtw2st_cl.evt.gzXRT settling cleaned WT event file
''sw00045907009xwtw2st_uf.evt.gzXRT settling unfiltered WT event file
''sw00045907009xwtw2st_ufre.evt.gzXRT settling unfiltered WT event file
00045907009/xrt/hksw00045907009xbf_rw.img.gzXRT raw housekeeping data
''sw00045907009xen.hk.gzXRT housekeeping file
''sw00045907009xhd.hk.gzXRT housekeeping file
''sw00045907009xtr.hk.gzXRT housekeeping file
00045907009/xrt/productssw00045907009x_skim.gifXRT sky GIF preview
''sw00045907009xpc_ex.img.gzXRT exposure map PC data
''sw00045907009xpc_sk.img.gzXRT sky PC data
00045907009/bat/hksw00045907009bdecb.hk.gzBAT housekeeping file
''sw00045907009bdp.hk.gzBAT housekeeping file
''sw00045907009ben.hk.gzBAT housekeeping file
''sw00045907009bgocb.hk.gzBAT housekeeping file
''sw00045907009bhd.hk.gzBAT housekeeping file
00045907009/bat/masktagsw00045907009bmt00010003.lc.gzBAT mask tagged lightcurve
''sw00045907009bmt00010003_rw.lc.gzBAT raw mask tagged lightcurve
''sw00045907009bmt00010029.lc.gzBAT mask tagged lightcurve
''sw00045907009bmt00010029_rw.lc.gzBAT raw mask tagged lightcurve
''sw00045907009bmt00010051.lc.gzBAT mask tagged lightcurve
''sw00045907009bmt00010051_rw.lc.gzBAT raw mask tagged lightcurve
00045907009/bat/ratesw00045907009brt1s.lc.gzBAT rate lightcurve
''sw00045907009brtmc.lc.gzBAT rate lightcurve
''sw00045907009brtms.lc.gzBAT rate lightcurve
''sw00045907009brtqd.lc.gzBAT rate lightcurve
00045907009/bat/surveysw00045907009bsvpbo2b4dg0919.dph.gzBAT survey DPH
''sw00045907009bsvpbo2b6cg0920.dph.gzBAT survey DPH
00045907009/uvot/hksw00045907009uac.hk.gzUVOT housekeeping file
''sw00045907009uaf.hk.gzUVOT housekeeping file
''sw00045907009uct.hk.gzUVOT housekeeping file
''sw00045907009uen.hk.gzUVOT housekeeping file
''sw00045907009uer.hk.gzUVOT housekeeping file
''sw00045907009ues.hk.gzUVOT housekeeping file
00045907009/uvot/imagesw00045907009uuu_ex.img.gzUVOT exposure map u data
''sw00045907009uuu_rw.img.gzUVOT raw u data
''sw00045907009uuu_sk.img.gzUVOT sky u data
00045907009/uvot/productssw00045907009u.cat.gzUVOT catalog
''sw00045907009u_ex.img.gzUVOT exposure map data
''sw00045907009u_sk.img.gzUVOT sky data
''sw00045907009uuuskim.gifUVOT sky u GIF preview

OK so what you should see above is a list of all the files, including the subdirectories they will exist in, along with basic description of each file. Importantly, at this stage, the data are not yet downloaded. Let's look in depth at one of these files.

data[0]
ParameterValue
filenameSWIFT_TLE_ARCHIVE.txt.22018.37267907.gz
path00045907009/auxil
urlhttps://heasarc.gsfc.nasa.gov/FTP/swift/data/obs/2022_01/00045907009/a
uxil/SWIFT_TLE_ARCHIVE.txt.22018.37267907.gz
quicklookFalse
typeAuxillary TLE file

OK so a few things here. Firstly, from the url you can see where the data reside online. As this is a nasa.gov address, this is the US data center. If you wanted to retrieve from the UK data center, simply pass the parameter uksdc = True. Similarly if you wish to use the Italian SDC, use itsdc = True.

Secondly, this is quicklook data. By default Swift_Data looks in the archive first, but if the data is recent, it will look in quicklook. Note that quicklook data are by their nature preliminary, and can evolve with time. For US and Italian SDC you'll see that the URL has a version number ('009') included, this number increments when the data are changed. For UK SDC, this does not happen, however, you can just redownload data to get the most up-to-date value.

For published papers, we recommend using data from the archive if available.

Downloading the data

Final step is to download the data to disk, so we can process the data using our HEAsoft tools. This is perfomed utilizing the download() method. If we want to specify the directory to download, simply use the outdir parameter, either as a class parameter, or an argument to download. Let's put in in our computer's Downloads directory.

data.download(outdir="~/Downloads")
Downloading files:   0%|          | 0/57 [00:00<?, ?files/s]

True

If you have tqdm installed, you should have seen a progress bar showing how many files were downloaded. If not, then you'll just see a simple text message. Now the data should be in the Downloads directory, in a directory named after the obsid of the data we requested. Note that the files inside are gzipped by default, but do not need to be decompressed to be used with the HEAsoft tools, so you can save some disk space!

Download data in one line

Next thing we'll demonstrate is downloading data in one line of code. This is very simple, just pass the arguments when you intiate the class, and it will download the data itself. If you want to do this, and not download the data automatically, pass the argument fetch=False. We'll fetch the 3rd observation above, but just the XRT data:

newdata = Data(obsid=oq[2].obsid, xrt=True, outdir="~/Downloads")
Downloading files:   0%|          | 0/27 [00:00<?, ?files/s]

That should have downloaded the auxil and xrt data for that observation in into your Downloads directory. Let's look at the file structure.

newdata
PathFilenameDescription
01091527009/auxilSWIFT_TLE_ARCHIVE.txt.22020.02942007.gzAuxillary TLE file
''sw01091527009pat.fits.gzAuxillary attitude file
''sw01091527009pjb.par.gzAuxillary file
''sw01091527009pob.cat.gzAuxillary catalog
''sw01091527009ppr.par.gzAuxillary file
''sw01091527009s.mkf.gzAuxillary file
''sw01091527009sao.fits.gzAuxillary file
''sw01091527009sat.fits.gzAuxillary attitude file
''sw01091527009sen.hk.gzAuxillary housekeeping
''sw01091527009sti.fits.gzAuxillary file
''sw01091527009uat.fits.gzAuxillary attitude file
''sw01091527009x.mkf.gzAuxillary file
01091527009/xrt/eventsw01091527009xpcw3po_cl.evt.gzXRT pointed cleaned PC event file
''sw01091527009xpcw3po_uf.evt.gzXRT pointed unfiltered PC event file
''sw01091527009xwtw2sl_cl.evt.gzXRT slew cleaned WT event file
''sw01091527009xwtw2sl_uf.evt.gzXRT slew unfiltered WT event file
''sw01091527009xwtw2sl_ufre.evt.gzXRT slew unfiltered WT event file
''sw01091527009xwtw2st_cl.evt.gzXRT settling cleaned WT event file
''sw01091527009xwtw2st_uf.evt.gzXRT settling unfiltered WT event file
''sw01091527009xwtw2st_ufre.evt.gzXRT settling unfiltered WT event file
01091527009/xrt/hksw01091527009xbf_rw.img.gzXRT raw housekeeping data
''sw01091527009xen.hk.gzXRT housekeeping file
''sw01091527009xhd.hk.gzXRT housekeeping file
''sw01091527009xtr.hk.gzXRT housekeeping file
01091527009/xrt/productssw01091527009x_skim.gifXRT sky GIF preview
''sw01091527009xpc_ex.img.gzXRT exposure map PC data
''sw01091527009xpc_sk.img.gzXRT sky PC data

Downloading data without using the Data class

You don't actually need to use the Swift_Data AKA Data class to download data. Any API class that has an associated obsid as of swifttools 3.0.6 has a download() method. This method takes the same arguments as Data to download data, automatically downloads data to local disk, and returns a Data class as a result. Here's a demonstration:

A reminder, we did an ObsQuery earlier, let's look at that again:

oq
Begin TimeEnd TimeTarget NameObservation NumberExposure (s)Slewtime (s)
2022-01-09 23:52:022022-01-10 00:12:58NGC5986000459070091115141
2022-01-10 00:13:022022-01-10 00:20:57PSZ1_G357.43+30.600008565100141065
2022-01-10 00:21:022022-01-10 00:51:01GRB 220101A010915270091610189
2022-01-10 00:51:022022-01-10 01:12:01OGP_4313031030180011080179
2022-01-10 01:12:022022-01-10 01:28:57MRK 81700096450022835180
2022-01-10 01:29:022022-01-10 01:36:01NGC 539803110928017275144
2022-01-10 01:36:022022-01-10 01:57:59HEN 3-110300083966007126057
2022-01-10 01:58:022022-01-10 02:23:00RX J0134.2-4258000365280601355143
2022-01-10 02:23:022022-01-10 02:44:58OGP_3952031031670031185131

The 5th observation up there is Mrk 817, we can access that entry individually like this:

oq[4]
Begin TimeEnd TimeTarget NameObservation NumberExposure (s)Slewtime (s)
2022-01-10 01:12:022022-01-10 01:28:57MRK 81700096450022835180

So to download the data for that observation, you can simply do the following. We're going to request XRT and UVOT data for this:

oq[4].download(xrt=True,uvot=True, outdir="~/Downloads")
Downloading files:   0%|          | 0/60 [00:00<?, ?files/s]
PathFilenameDescription
00096450022/auxilSWIFT_TLE_ARCHIVE.txt.22020.02942007.gzAuxillary TLE file
''sw00096450022pat.fits.gzAuxillary attitude file
''sw00096450022pjb.par.gzAuxillary file
''sw00096450022pob.cat.gzAuxillary catalog
''sw00096450022ppr.par.gzAuxillary file
''sw00096450022s.mkf.gzAuxillary file
''sw00096450022sao.fits.gzAuxillary file
''sw00096450022sat.fits.gzAuxillary attitude file
''sw00096450022sen.hk.gzAuxillary housekeeping
''sw00096450022sti.fits.gzAuxillary file
''sw00096450022uat.fits.gzAuxillary attitude file
''sw00096450022x.mkf.gzAuxillary file
00096450022/xrt/eventsw00096450022xpcw3po_cl.evt.gzXRT pointed cleaned PC event file
''sw00096450022xpcw3po_uf.evt.gzXRT pointed unfiltered PC event file
''sw00096450022xwtw2sl_cl.evt.gzXRT slew cleaned WT event file
''sw00096450022xwtw2sl_uf.evt.gzXRT slew unfiltered WT event file
''sw00096450022xwtw2sl_ufre.evt.gzXRT slew unfiltered WT event file
''sw00096450022xwtw2st_cl.evt.gzXRT settling cleaned WT event file
''sw00096450022xwtw2st_uf.evt.gzXRT settling unfiltered WT event file
''sw00096450022xwtw2st_ufre.evt.gzXRT settling unfiltered WT event file
00096450022/xrt/hksw00096450022xbf_rw.img.gzXRT raw housekeeping data
''sw00096450022xen.hk.gzXRT housekeeping file
''sw00096450022xhd.hk.gzXRT housekeeping file
''sw00096450022xtr.hk.gzXRT housekeeping file
00096450022/xrt/productssw00096450022x_skim.gifXRT sky GIF preview
''sw00096450022xpc_ex.img.gzXRT exposure map PC data
''sw00096450022xpc_sk.img.gzXRT sky PC data
00096450022/uvot/hksw00096450022uac.hk.gzUVOT housekeeping file
''sw00096450022uaf.hk.gzUVOT housekeeping file
''sw00096450022uct.hk.gzUVOT housekeeping file
''sw00096450022uen.hk.gzUVOT housekeeping file
''sw00096450022uer.hk.gzUVOT housekeeping file
''sw00096450022ues.hk.gzUVOT housekeeping file
00096450022/uvot/imagesw00096450022ubb_ex.img.gzUVOT exposure map b data
''sw00096450022ubb_rw.img.gzUVOT raw b data
''sw00096450022ubb_sk.img.gzUVOT sky b data
''sw00096450022um2_ex.img.gzUVOT exposure map uvm2 data
''sw00096450022um2_rw.img.gzUVOT raw uvm2 data
''sw00096450022um2_sk.img.gzUVOT sky uvm2 data
''sw00096450022uuu_ex.img.gzUVOT exposure map u data
''sw00096450022uuu_rw.img.gzUVOT raw u data
''sw00096450022uuu_sk.img.gzUVOT sky u data
''sw00096450022uvv_ex.img.gzUVOT exposure map v data
''sw00096450022uvv_rw.img.gzUVOT raw v data
''sw00096450022uvv_sk.img.gzUVOT sky v data
''sw00096450022uw1_ex.img.gzUVOT exposure map uvw1 data
''sw00096450022uw1_rw.img.gzUVOT raw uvw1 data
''sw00096450022uw1_sk.img.gzUVOT sky uvw1 data
''sw00096450022uw2_ex.img.gzUVOT exposure map uvw2 data
''sw00096450022uw2_rw.img.gzUVOT raw uvw2 data
''sw00096450022uw2_sk.img.gzUVOT sky uvw2 data
00096450022/uvot/productssw00096450022u.cat.gzUVOT catalog
''sw00096450022u_ex.img.gzUVOT exposure map data
''sw00096450022u_sk.img.gzUVOT sky data
''sw00096450022ubbskim.gifUVOT sky b GIF preview
''sw00096450022um2skim.gifUVOT sky uvm2 GIF preview
''sw00096450022uuuskim.gifUVOT sky u GIF preview
''sw00096450022uvvskim.gifUVOT sky v GIF preview
''sw00096450022uw1skim.gifUVOT sky uvw1 GIF preview
''sw00096450022uw2skim.gifUVOT sky uvw2 GIF preview

That makes downloading data for archival observations quick and easy!

Updating data, fetching additional instruments

OK, so what if you want to update directory, say the data has been updated. Well we would recommend that you delete the old data, and redownload, and to encourage this, if you try to download again, you'll get an error:

newdata = oq[2].download(xrt=True, outdir="~/Downloads")
Downloading files:   0%|          | 0/27 [00:00<?, ?files/s]

WARNING: SWIFT_TLE_ARCHIVE.txt.22020.02942007.gz exists and not overwritten (set clobber=True to override this).
WARNING: sw01091527009pat.fits.gz exists and not overwritten (set clobber=True to override this).
WARNING: sw01091527009pjb.par.gz exists and not overwritten (set clobber=True to override this).
WARNING: sw01091527009pob.cat.gz exists and not overwritten (set clobber=True to override this).
WARNING: sw01091527009ppr.par.gz exists and not overwritten (set clobber=True to override this).
WARNING: sw01091527009s.mkf.gz exists and not overwritten (set clobber=True to override this).
WARNING: sw01091527009sao.fits.gz exists and not overwritten (set clobber=True to override this).
WARNING: sw01091527009sat.fits.gz exists and not overwritten (set clobber=True to override this).
WARNING: sw01091527009sen.hk.gz exists and not overwritten (set clobber=True to override this).
WARNING: sw01091527009sti.fits.gz exists and not overwritten (set clobber=True to override this).
WARNING: sw01091527009uat.fits.gz exists and not overwritten (set clobber=True to override this).
WARNING: sw01091527009x.mkf.gz exists and not overwritten (set clobber=True to override this).
WARNING: sw01091527009xpcw3po_cl.evt.gz exists and not overwritten (set clobber=True to override this).
WARNING: sw01091527009xpcw3po_uf.evt.gz exists and not overwritten (set clobber=True to override this).
WARNING: sw01091527009xwtw2sl_cl.evt.gz exists and not overwritten (set clobber=True to override this).
WARNING: sw01091527009xwtw2sl_uf.evt.gz exists and not overwritten (set clobber=True to override this).
WARNING: sw01091527009xwtw2sl_ufre.evt.gz exists and not overwritten (set clobber=True to override this).
WARNING: sw01091527009xwtw2st_cl.evt.gz exists and not overwritten (set clobber=True to override this).
WARNING: sw01091527009xwtw2st_uf.evt.gz exists and not overwritten (set clobber=True to override this).
WARNING: sw01091527009xwtw2st_ufre.evt.gz exists and not overwritten (set clobber=True to override this).
WARNING: sw01091527009xbf_rw.img.gz exists and not overwritten (set clobber=True to override this).
WARNING: sw01091527009xen.hk.gz exists and not overwritten (set clobber=True to override this).
WARNING: sw01091527009xhd.hk.gz exists and not overwritten (set clobber=True to override this).
WARNING: sw01091527009xtr.hk.gz exists and not overwritten (set clobber=True to override this).
WARNING: sw01091527009x_skim.gif exists and not overwritten (set clobber=True to override this).
WARNING: sw01091527009xpc_ex.img.gz exists and not overwritten (set clobber=True to override this).
WARNING: sw01091527009xpc_sk.img.gz exists and not overwritten (set clobber=True to override this).

However, we can overwrite the existing data, by (as the error message suggests), setting clobber = True.

newdata.clobber = True
newdata.download()
Downloading files:   0%|          | 0/27 [00:00<?, ?files/s]

True

Use of clobber can be useful also if you decide to you really wanted that UVOT data to go along with your XRT data on that observation. Remember auxil is fetched by default, so as we already have it, we'll turn it off. This isn't necessary, but if you don't turn it off the data will be redownloaded and overwrite the old data, which wastes bandwidth.

newdata = obsid=oq[2].download(uvot=True, auxil=False, outdir="~/Downloads", clobber=True)
Downloading files:   0%|          | 0/17 [00:00<?, ?files/s]

So the looking in the directory listing will show the UVOT data files that you just downloaded to add to your XRT and Auxillary data.

Selecting individual files using filename matching

If you want to specify exactly what sort of data you want to download, then you can use pattern matching to filter on only the files you want. Here's how that works. Firstly, let's use a GUANO dump as an example, for these we are primarily interested in the BAT event data file.

from swift_too import GUANO

g = GUANO(begin='2021-01-01',limit=1)
g
Trigger TypeTrigger TimeOffset (s)Window Duration (s)Observation ID
GBM GRB2021-01-01 14:53:065020000048753206

Let's take a look at the data associated with this GUANO trigger. I'll use the download() method, but set fetch = False so that no actual data is downloaded, this will return the directory listing.

g[0].download(bat=True,fetch=False)
PathFilenameDescription
00048753206/auxilSWIFT_TLE_ARCHIVE.txt.21007.72373844.gzAuxillary TLE file
''sw00048753206pat.fits.gzAuxillary attitude file
''sw00048753206pjb.par.gzAuxillary file
''sw00048753206pob.cat.gzAuxillary catalog
''sw00048753206ppr.par.gzAuxillary file
''sw00048753206s.mkf.gzAuxillary file
''sw00048753206sao.fits.gzAuxillary file
''sw00048753206sat.fits.gzAuxillary attitude file
''sw00048753206sen.hk.gzAuxillary housekeeping
''sw00048753206sti.fits.gzAuxillary file
''sw00048753206x.mkf.gzAuxillary file
00048753206/bat/eventsw00048753206bevshpo_uf.evt.gzBAT pointed unfiltered event event file
00048753206/bat/hksw00048753206bdecb.hk.gzBAT housekeeping file
''sw00048753206bdp.hk.gzBAT housekeeping file
''sw00048753206bdqcb.hk.gzBAT housekeeping file
''sw00048753206ben.hk.gzBAT housekeeping file
''sw00048753206bevtlsp.hk.gzBAT housekeeping file
''sw00048753206bevtssp.hk.gzBAT housekeeping file
''sw00048753206bgocb.hk.gzBAT housekeeping file
''sw00048753206bhd.hk.gzBAT housekeeping file
00048753206/bat/masktagsw00048753206bmt00010051.lc.gzBAT mask tagged lightcurve
''sw00048753206bmt00010051_rw.lc.gzBAT raw mask tagged lightcurve
''sw00048753206bmt00010067.lc.gzBAT mask tagged lightcurve
''sw00048753206bmt00010067_rw.lc.gzBAT raw mask tagged lightcurve
''sw00048753206bmt00010069.lc.gzBAT mask tagged lightcurve
''sw00048753206bmt00010069_rw.lc.gzBAT raw mask tagged lightcurve
00048753206/bat/ratesw00048753206brt1s.lc.gzBAT rate lightcurve
''sw00048753206brtmc.lc.gzBAT rate lightcurve
''sw00048753206brtms.lc.gzBAT rate lightcurve
''sw00048753206brtqd.lc.gzBAT rate lightcurve
00048753206/bat/surveysw00048753206bsvpbo2a19g08cf.dph.gzBAT survey DPH

So we're interested in just fetching the BAT event file. That file is called sw00048753206bevshpo_uf.evt.gz in the listing above. To fetch this only, we could use the match argument, and do the following:

g[0].download(bat=True,fetch=False,match='*bev*.evt.gz')
PathFilenameDescription
00048753206/bat/eventsw00048753206bevshpo_uf.evt.gzBAT pointed unfiltered event event file

Here we used standard unix/dos style wildcards to only select files that are BAT event files ('b' for BAT, 'ev' for event). However, we probably want those files in the auxil directory too, so let's make sure we get those also with our match, by adding a second match clause.

g[0].download(bat=True,fetch=False,match=['*bev*.evt.gz','*/auxil/*'])
PathFilenameDescription
00048753206/auxilSWIFT_TLE_ARCHIVE.txt.21007.72373844.gzAuxillary TLE file
''sw00048753206pat.fits.gzAuxillary attitude file
''sw00048753206pjb.par.gzAuxillary file
''sw00048753206pob.cat.gzAuxillary catalog
''sw00048753206ppr.par.gzAuxillary file
''sw00048753206s.mkf.gzAuxillary file
''sw00048753206sao.fits.gzAuxillary file
''sw00048753206sat.fits.gzAuxillary attitude file
''sw00048753206sen.hk.gzAuxillary housekeeping
''sw00048753206sti.fits.gzAuxillary file
''sw00048753206x.mkf.gzAuxillary file
00048753206/bat/eventsw00048753206bevshpo_uf.evt.gzBAT pointed unfiltered event event file

That's pretty much all there is to it! Enjoy your data.

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