SwiftTemporalFinder

class gdt.missions.swift.finders.SwiftTemporalFinder(tstart, tstop=None)[source]

Bases: object

Find Swift data that covers a given time or time range.

Swift data are not stored as continuous and contiguous time series, therefore finding Swift data corresponding to a time or time range is not a trivial exercise. The data files are divided into observation IDs on given dates, and the files with a given observation ID and date can in fact contain data beyond that date. This class queries the Swift Master catalog to find all observation IDs that are contained within a specified time range. The files for each observation ID are stored in different directories, so this class interfaces with a SwiftObsFinder class (or derived) to perform all finder operations over multiple directories.

Note

Even though an observation ID spans a time range that contains a time of interest, this does not mean that a data file corresponding to that ID will contain data at that time. For example, a query at a particular time may return 10 different observation IDs (and thus 10 different directories), however, only one observation ID will actually contain data at the given time. Unfortunately there is no way to determine which file contains the desired data without opening each file and checking for data availability at that time, an activity that is beyond the scope of this class.

This is a base clase. Inherited classes must set the class variable _base_obs_finder to the respective finder.

Parameters:
  • tstart (astropy.Time) – A time of interest or start time for a time range of interest

  • tstop (astropy.Time, optional) – The stop time for a time range of interest.

Attributes Summary

cwd

The current working directory for each observation ID

files

The files that might contain data during the time or time range of interest

num_files

Number of files

Methods Summary

cd(tstart[, tstop])

Changes the directories based on a time or time range of interest.

filter(filetype, extension)

Filters the directories for the requested filetype and extension

get(download_dir, files[, verbose])

Downloads files to a directory and returns the downloaded file paths

Attributes Documentation

cwd

The current working directory for each observation ID

Type:

(list)

files

The files that might contain data during the time or time range of interest

Type:

(list)

num_files

Number of files

Type:

(int)

Methods Documentation

cd(tstart, tstop=None)[source]

Changes the directories based on a time or time range of interest.

Parameters:
  • tstart (astropy.Time) – A time of interest or start time for a time range of interest

  • tstop (astropy.Time, optional) – The stop time for a time range of interest.

filter(filetype, extension)[source]

Filters the directories for the requested filetype and extension

Parameters:
  • filetype (str) – The type of file, e.g. ‘cspec’

  • extension (str) – The file extension, e.g. ‘.pha’

Returns:

(list)

get(download_dir, files, verbose=True)[source]

Downloads files to a directory and returns the downloaded file paths

Parameters:
  • download_dir (str) – The download directory

  • files (list) – The list of files to download

  • verbose (bool, optional) – Set to False to turn off download status

Returns:

(list) – The downloaded file paths