threeML.utils.data_download.Fermi_LAT.download_LAT_data module

class threeML.utils.data_download.Fermi_LAT.download_LAT_data.DivParser(desiredDivName)[source]

Bases: HTMLParser

Extract data from a <div></div> tag

handle_data(data)[source]
handle_endtag(tag)[source]
handle_starttag(tag, attributes)[source]
class threeML.utils.data_download.Fermi_LAT.download_LAT_data.LAT_dataset[source]

Bases: object

extract_events(roi, zmax, irf, thetamax=180.0, strategy='time', data_quality=True)[source]
make_LAT_dataset(ra: float, dec: float, radius: float, trigger_time: float, tstart: float, tstop: float, data_type: str = 'Photon', destination_directory: str = '.', Emin: float = 30.0, Emax: float = 1000000.0)[source]
threeML.utils.data_download.Fermi_LAT.download_LAT_data.download_LAT_data(ra: float, dec: float, radius: float, tstart: float, tstop: float, time_type: str, data_type: str = 'Photon', destination_directory: str = '.', Emin: float = 30.0, Emax: float = 1000000.0) Path[source]

Download data from the public LAT data server (of course you need a working internet connection). Data are selected in a circular Region of Interest (cone) centered on the provided coordinates.

Example:

` > download_LAT_data(195.6, -35.4, 12.0, '2008-09-16 01:00:23', '2008-09-18 01:00:23', time_type='Gregorian', destination_directory='my_new_data') `

Parameters:
  • ra – R.A. (J2000) of the center of the ROI

  • dec – Dec. (J2000) of the center of the ROI

  • radius – radius (in degree) of the center of the ROI (use a larger radius than what you will need in the

analysis) :param tstart: start time for the data :param tstop: stop time for the data :param time_type: type of the time input (one of MET, Gregorian or MJD) :param data_type: type of data to download. Use Photon if you use Source or cleaner classes, Extended otherwise. Default is Photon. :param destination_directory: directory where you want to save the data (default: current directory) :param Emin: minimum photon energy (in MeV) to download (default: 30 MeV, must be between 30 and 1e6 MeV) :param Emax: maximum photon energy (in MeV) to download (default: 1e6 MeV, must be betwen 30 and 1e6 MeV ) :return: the path to the downloaded FT1 and FT2 file

threeML.utils.data_download.Fermi_LAT.download_LAT_data.merge_LAT_data(ft1s, destination_directory: str = '.', outfile: str = 'ft1_merged.fits', Emin: float = 30.0, Emax: float = 1000000.0) Path[source]