TriggerFinder¶
- class gdt.missions.fermi.gbm.finders.TriggerFinder(*args, protocol='HTTPS', **kwargs)[source]¶
Bases:
GbmFinderA class that interfaces with the HEASARC trigger directories. An instance of this class will represent the available files associated with a single trigger.
An instance can be created without a trigger number, however a trigger number will need to be set by
cd(tnum)to query and download files. An instance can also be changed from one trigger number to another without having to create a new instance. If multiple instances are created with the keyword protocol=’FTP’ and exist simultaneously, they will all use a single FTP connection.- Parameters:
tnum (str, optional) – A valid trigger number
Attributes Summary
The list of files in the current directory
Number of files in the current directory
Methods Summary
cd(tnum)Change directory to new trigger.
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_cat_files(download_dir, **kwargs)Download all catalog files for the trigger.
get_cspec(download_dir[, dets])Download the CSPEC files for the trigger.
get_ctime(download_dir[, dets])Download the CTIME files for the trigger.
get_healpix(download_dir, **kwargs)Download the healpix localization file for the trigger.
get_lightcurve(download_dir, **kwargs)Download the lightcurve plots for the trigger.
get_localization(download_dir, **kwargs)Download all localization files for the trigger.
get_rsp(download_dir[, ctime, cspec, dets])Download the response Type-I files for the trigger.
get_rsp2(download_dir[, ctime, cspec, dets])Download the response Type-I files for the trigger.
get_trigdat(download_dir, **kwargs)Download the trigger data (trigdat) file for the trigger.
get_tte(download_dir[, dets])Download the TTE files for the trigger.
ls(*args[, fullpath])List the contents of a directory
List all catalog files for the trigger.
ls_cspec()List all CSPEC files for the trigger.
ls_ctime()List all CTIME files for the trigger.
List all lightcurve plots for the trigger.
List all localization files for the trigger.
ls_rsp([ctime, cspec])List all response Type-I files for the trigger.
ls_rsp2([ctime, cspec])List all response Type-II files for the trigger.
List the trigger data (trigdat) file for the trigger.
ls_tte()List all TTE files for the trigger.
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
- 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_cat_files(download_dir, **kwargs)[source]¶
Download all catalog files for the trigger.
- 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)[source]¶
Download the CSPEC files for the trigger.
- 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)[source]¶
Download the CTIME files for the trigger.
- 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_healpix(download_dir, **kwargs)[source]¶
Download the healpix localization file for the trigger.
- 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_lightcurve(download_dir, **kwargs)[source]¶
Download the lightcurve plots for the trigger.
- 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_localization(download_dir, **kwargs)[source]¶
Download all localization files for the trigger.
- 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_rsp(download_dir, ctime=True, cspec=True, dets=None, **kwargs)[source]¶
Download the response Type-I files for the trigger.
- Parameters:
download_dir (str) – The download directory
ctime (bool, optional) – If True, download the ctime responses. Default is True.
cspec (bool, optional) – If True, download the cspec responses. Default is True.
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_rsp2(download_dir, ctime=True, cspec=True, dets=None, **kwargs)[source]¶
Download the response Type-I files for the trigger.
- Parameters:
download_dir (str) – The download directory
ctime (bool, optional) – If True, download the ctime responses. Default is True.
cspec (bool, optional) – If True, download the cspec responses. Default is True.
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_trigdat(download_dir, **kwargs)[source]¶
Download the trigger data (trigdat) file for the trigger.
- 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_tte(download_dir, dets=None, **kwargs)[source]¶
Download the TTE files for the trigger.
- 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)
- 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_rsp(ctime=True, cspec=True)[source]¶
List all response Type-I files for the trigger.
- Parameters:
ctime (bool, optional) – If True, list the ctime responses. Default is True.
cspec (bool, optional) – If True, list the cspec responses. Default is True.
- Returns:
(list of str)