ContinuousFtp

class gdt.missions.fermi.gbm.finders.ContinuousFtp(*args, **kwargs)[source]

Bases: ContinuousFinder

Class providing backwards compatibility for code written prior to v2.0.5 where the ContinuousFtp handled interactions with continuous data.

Parameters:
  • args – The set of parameters needed to define the data path

  • **kwargs – Options passed to ContinuousFinder class

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)

Change directory to new date.

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_all(download_dir, **kwargs)

Download all files within a daily directory.

get_cspec(download_dir[, dets])

Download the CSPEC files.

get_ctime(download_dir[, dets])

Download the CTIME files.

get_poshist(download_dir, **kwargs)

Download the poshist file.

get_spechist(download_dir[, dets])

Download the spechist files.

get_tte(download_dir[, dets, full_day])

Download all TTE files associated with a time.

ls(*args[, fullpath])

List the contents of a directory

ls_cspec()

List all CSPEC files.

ls_ctime()

List all CTIME files.

ls_poshist()

List the poshist file

ls_spechist()

List all spechist files.

ls_tte([full_day])

List all TTE files.

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)

Change directory to new date.

Parameters:

time (astropy.time.Time) – The time

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_all(download_dir, **kwargs)

Download all files within a daily directory.

Note

Use at your own risk. Unless you have a high-bandwidth connection and can handle downloading several GBs, this function is not recommended for use.

Parameters:
  • download_dir (str) – The download directory

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

Returns:

(list of Path)

get_cspec(download_dir, dets=None, **kwargs)

Download the CSPEC files.

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 of Path)

get_ctime(download_dir, dets=None, **kwargs)

Download the CTIME files.

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 of Path)

get_poshist(download_dir, **kwargs)

Download the poshist file.

Parameters:
  • download_dir (str) – The download directory

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

Returns:

(list of Path)

get_spechist(download_dir, dets=None, **kwargs)

Download the spechist files.

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 of Path)

get_tte(download_dir, dets=None, full_day=False, **kwargs)

Download all TTE files associated with a time.

Note

Unless you have a high-bandwidth connection and can handle downloading several GBs, it is not recommended to download the full day of TTE data.

Parameters:
  • download_dir (str) – The download directory

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

  • full_day (bool, optional) – If True, will download the TTE files for the full day. If False, will return the TTE files for the covering the specified time. Default is False.

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

Returns:

(list of Path)

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_cspec()

List all CSPEC files.

Returns:

(list of str)

ls_ctime()

List all CTIME files.

Returns:

(list of str)

ls_poshist()

List the poshist file

Returns:

(list of str)

ls_spechist()

List all spechist files.

Returns:

(list of str)

ls_tte(full_day=False)

List all TTE files.

Parameters:

full_day (bool, optional) – If True, will return the TTE files for the full day. If False, will return the TTE files for the hour covering the specified time. Default is False.

Returns:

(list of str)