Get data

redback provides a simple interface to getting data from the open access, Swift, and BATSE catalogs, in different formats. We also provide simple interfaces to get data from the FINK and LASAIR brokers, as well as the open access catalog. The different APIs to get data implemented in

  • Swift: Prompt, X-ray afterglow [counts, flux, flux density]

  • Open access catalog: Supernova, kilonova, tidal disruption event [photometry]

  • FINK and LASAIR Broker: Supernova, kilonova, tidal disruption event or other transient [photometry]

  • BATSE: Prompt [count rate]

For example, downloading the X-ray afterglow of GRB 070809 is as simple as

GRB = '070809'

data = redback.get_data.get_bat_xrt_afterglow_data_from_swift(grb=GRB, data_mode="flux")

Or downloading the flux_density/magnitude data of the kilonova at2017gfo

kne = 'at2017gfo'

data = redback.get_data.get_kilonova_data_from_open_transient_catalog_data(transient=kne)

Both these commands return the data, in a pandas dataframe. They also save the raw and processed data in a sensible way. In particular, the kilonova data will be saved to kilonova/at2017gfo/ and the afterglow will be saved to afterglow/GRB070809/flux/.

Please look at the API or the examples to see how we can get other data.

Before working with UV/optical/IR data from the Open Access Catalogue, you need to check whether the data are in the AB or Vega system and whether any extinction correction was applied to the data on the Open Access Catalogue. By default, Redback assumes that the data is XXX.

Basic processing and metadata

We do some basic processing to the raw data to make the files homogenous and save them in a homogenous format. We also get metadata about the transient, such as redshift, start time, photon index etc from publically available sources. Users can also provide this metadata themselves.

Private data or simulated data

We do not have to use data from the above catalogs for fitting. Redback can be used on private data or simulated data. This is described in more detail in the transient or simulation documentation.

A general example which shows the API for downloading data from any of the above catalogs is available here.

Adding filters to Redback

Redback includes many filters that are a part of the SN Cosmo distribution. You can get a full list using the following command:

from redback import filters

filters.show_all_filters()

We have implemented a few options to add additional filters. Note, SN Cosmo does not allow to permanently add a filter to its filter database. This means that you have add any non-default filter to Redback every time you start a new session. In the following we describe different methods of adding a filter.

  • Adding a filter from a text file

from redback import filters

fname        = 'Gemini_GMOS-N.u.dat'

# Unique filter label
filter_label = 'gmos-n::u'

# Label shown in the plotting
plot_label   = 'GMOS-N/u'

# If you want to overwrite any existing entry

overwrite    = True

filters.add_filter_user(fname, filter_label, PLOT_LABEL=plot_label, OVERWRITE=overwrite)
  • Adding a filter using the Spanish Virtual Observatory

The Spanish Virtual Observatory (SVO) has an extensive repository of astronomical filters of many observatories and space telescopes. The developer version of Astroquery allows accessing the SVO in a very convenient way. It is straightforward to add a filter from the SVO to Redback.

from astroquery.svo_fps import SvoFps
from redback import filters

# We want to add GROND filters to Redback
filter_table  = SvoFps.get_filter_list(facility='La Silla', instrument='GROND')

# The table has many columns. The filter ID are stored in 'filterID'.
# We use this column to construct the filter label and the plot labels.

# Unique filter labels
filter_label = ['grond::' + x.split('/')[1].split('.')[1] for x in filter_table['filterID']]

# Plot labels
plot_label   = ['GROND/' + x.split('/')[1].split('.')[1] for x in filter_table['filterID']]

[filters.add_filter_svo(filter_table[ii], filter_label[ii], plot_label[ii]) for ii in range(len(filter_table))]

We have pre-configured Redback to add a set of filters that are not a part of SN Cosmo distribution. The pre-configured list includes the Euclid Space Telescope, the GROND camera at the 2.2m MPG telescope, the EFOSC2/Gunn filters at 3.58m NTT telescope, the Spitzer Space Telescope and the WISE Space Telescope. To add them you need the developer version of Astroquery.

from astroquery.svo_fps import SvoFps
from redback import filters

filters.add_common_filters()