SLTimer

SLTimer is an aggregator to enable several different strong lens time delay estimation algorithms to be run on the same dataset, principally by the Strong Lens Time Delay Challenge Evil Team as part of their work preparing and analyzing the second Time Delay Challenge.

API

class desc.sltimer.worker.SLTimer

Simple class for ingesting strong lens light curve data, and measuring the time .

add_polynomial_microlensing()

To add polynomial microlensing to each lightcurve.

add_spline_microlensing()

To add spline microlensing to each light curve.

delete_old_files()

To delete the old files from prior runs through the data.

display_light_curves(filename=None, jdrange=None)

To display the lightcurves.

download(url, format='rdb', and_read=False)

Download method to get the datafile from a url.

estimate_time_delays(method='pycs', microlensing='spline', agn='spline', error=None)

Provides both polynomial and spline time delays.

initialize_time_delays(method=None, pars=None)

Initialize the curve shifts by specifying 1 or 3 time delays.

make_mock_light_curves(n=None, npkl=None)

To make mock lightcurves to provide an basis for the estimate uncertainties.

make_plain_copies(n=None, npkl=None)

To make copies of the data.

read_in(datafile='self', format=None)

Read in method to specify which type of datafile will be read in.

desc.sltimer.io.read_in_rdb_data(datafile)

Reads in the datafiles in the rdb format. This format is used in the original PyCS tutorial.

desc.sltimer.io.read_in_tdc2_data(datafile, whiten=False)

Reads in the datafiles that will be used for the Time Delay Challenge 2. Has an option to take the data from multiple filters and “whiten” it to look like it came from a single filter.

desc.sltimer.io.tdc2import(filepath, object='Unknown', magcolname='flux', magerrcolname='flux_err', telescopename='Unknown', plotcolour='red', mhjdcolname='MJD', flagcolname=None, propertycolnames=['band'], verbose=True, units='ABmags')

A way to import lightcurves using tdc2 data files. Column indices and delimeters do not matter, just provide the column headers that you want to read.

Propertycolnames is a list of column names that can be added as properties. Possible settings : None : Will not import any properties [“property1”, “property2”] : Provide a list of properties to import.

The default column names are “MJD”, “flux”, “flux_err”, “mask”.

Flexibleimport is used under the hood.

desc.sltimer.io.flexibleimport(filepath, jdcol=1, magcol=2, errcol=3, startline=8, flagcol=None, propertycols=None, telescopename='Unknown', object='Unknown', plotcolour='red', verbose=True, units='ABmags')

The general form of file reading. We read only one lightcurve object. To comment a line in the input file, start the line with # like in python.

Parameters:
  • jdcol – The column number containing the MHJDs. First column is number 1, not 0 !
  • magcol – The column number containing the magnitudes.
  • errcol – The column number containing the magnitude errorbars.
  • flagcol – (default : None) The colum containing a mask (if available). This one should contain False (= will be masked) or True (not masked).
  • propertycols (dictionary) – (default : None) is a dict : propertycols = {"fwhm":7, "skylevel":8} means that col 7 should be read in as property “fwhm” and 8 as “skylevel”.
desc.sltimer.io.flux2magnitude(x, xerr)

Only used if the units are nmgy Arguments x and xerr are inputs from the original datafile Make sure to convert flux to magnitude before whitening to increase precision

desc.sltimer.io.whiten(lcs)

Function to whiten the lightcurve data in the case of multiple filters.