BatseContinuousFinder

class gdt.missions.cgro.batse.finders.BatseContinuousFinder(*args, protocol='HTTPS', **kwargs)[source]

Bases: BatseFinder

A class that interfaces with the HEASARC FTP continuous daily data directories. An instance of this class will represent the available files associated with a single day.

An instance can be created without a time, however a time will need to be set by cd(time) to query and download files. An instance can also be changed from one time to another without having to create a new instance. If multiple instances are created and exist simultaneously, they will all use a single FTP connection.

Parameters:

time (astropy.time.Time, optional) – The time object

Attributes Summary

cwd

files

The list of files in the current directory

num_files

Number of files in the current directory

Methods Summary

cd(time)

Set the time.

filter(filetype, extension)

Filters the directory for the requested filetype and extension

get(download_dir, files[, verbose])

Downloads a list of files from the current FTP directory.

get_cont(download_dir, **kwargs)

Download the LAD continuous data files.

get_discla(download_dir, **kwargs)

Download the LAD discriminator files.

get_her(download_dir[, dets])

Download the LAD high energy resolution data.

get_sher(download_dir[, dets])

Download the SD high energy resolution data.

ls(*args[, fullpath])

List the contents of a directory

ls_cont()

List the LAD continuous data files.

ls_discla()

List the the LAD discriminator files.

ls_her()

List the LAD high energy resolution data.

ls_sher()

List the SD high energy resolution data.

Attributes Documentation

cwd
files

The list of files in the current directory

Type:

(list of str)

num_files

Number of files in the current directory

Type:

(int)

Methods Documentation

cd(time)[source]

Set the time. If the object was previously associated with a different time, this will effectively change the working directory to that of the new time. If the time is invalid, an exception will be raised, and no directory change will be made.

Parameters:

time (astropy.time.Time, optional) – The time object

filter(filetype, extension)

Filters the directory 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: Union[str, Path], files: List[str], verbose: bool = True) List[Path]

Downloads a list of files from the current FTP directory. This function also returns a list of the downloaded file paths.

Parameters:
  • download_dir (str, Path) – The download directory location

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

  • verbose (bool, optional) – If True, will output the download status. Default is True.

Returns:

(list)

get_cont(download_dir, **kwargs)[source]

Download the LAD continuous data files.

Parameters:
  • download_dir (str) – The download directory

  • verbose (bool, optional) – If True, will output the download status. Default is True.

Returns:

(list) – The filenames of the downloaded files

get_discla(download_dir, **kwargs)[source]

Download the LAD discriminator files.

Parameters:
  • download_dir (str) – The download directory

  • verbose (bool, optional) – If True, will output the download status. Default is True.

Returns:

(list) – The filenames of the downloaded files

get_her(download_dir, dets=None, **kwargs)[source]

Download the LAD high energy resolution data.

Parameters:
  • download_dir (str) – The download directory

  • dets (list, optional) – The detectors’ data to download. If omitted, will download all.

  • verbose (bool, optional) – If True, will output the download status. Default is True.

Returns:

(list) – The filenames of the downloaded files

get_sher(download_dir, dets=None, **kwargs)[source]

Download the SD high energy resolution data.

Parameters:
  • download_dir (str) – The download directory

  • dets (list, optional) – The detectors’ data to download. If omitted, will download all.

  • verbose (bool, optional) – If True, will output the download status. Default is True.

Returns:

(list) – The filenames of the downloaded files

ls(*args, fullpath: bool = False)

List the contents of a directory

Parameters:
  • args (tuple) – The arguments needed to construct the remote path

  • fullpath (bool, optional) – If True, will list all files in the current with their full path.

ls_cont()[source]

List the LAD continuous data files.

Returns:

(list of str)

ls_discla()[source]

List the the LAD discriminator files.

Returns:

(list of str)

ls_her()[source]

List the LAD high energy resolution data.

Returns:

(list of str)

ls_sher()[source]

List the SD high energy resolution data.

Returns:

(list of str)