marshallEngine.lightcurves.marshall_lightcurves module

Generate the standard multi-survey lightcurve plots for the marshall transients

Author

David Young

class marshall_lightcurves(log, dbConn, settings=False, transientBucketIds=[])[source]

Bases: object

The worker class for the marshall_lightcurves module

Key Arguments

  • log – logger

  • settings – the settings dictionary

  • dbConn – the database connection for the mrshall

  • transientBucketIds – the transientBucketId(s) requiring lightcurves to be regenerated. (int or list)

Usage

To setup your logger, settings and database connections, please use the fundamentals package (see tutorial here).

To initiate a marshall_lightcurves object, use the following:

from marshallEngine.lightcurves import marshall_lightcurves
lc = marshall_lightcurves(
    log=log,
    dbConn=dbConn,
    settings=settings,
    transientBucketIds=[28421489, 28121353, 4637952, 27409808]
)
lc.plot()
_select_data_for_transient(transientBucketId)[source]

get the transient lightcurve data from the marshall database

Key Arguments

  • transientBucketId – the transientBucketId of source to get data for

_create_lightcurve_plot_file(dataset, flatdata, flatLimits, objectNames, saveLocation, saveFileName)[source]

Generate the lightcurve and save to file

Key Arguments

  • log – logger

  • dataset – the observational dataset split into filters (and then mags, limits etc)

  • flatdata – a flattened dataset to determine current magnitude

  • flatLimits – a flattened dataset of non-detection limits

  • objectNames – a single name or a list of names

  • saveLocation – the folder to save the plot file to

  • saveFileName – the filename to give the plot file (without extension)

Return

  • filepath – path to the lightcurve file

  • currentMag – a prediction of the current magnitude if there is enough recent data

  • gradient – a prediction of the gradient of recent data (on rise or decline?)

plot()[source]

generate a batch of lightcurves using multiprocessing given their transientBucketIds

Return

  • filepath – path to the last generated plot file

Usage

from marshallEngine.lightcurves import marshall_lightcurves
lc = marshall_lightcurves(
    log=log,
    dbConn=dbConn,
    settings=settings,
    transientBucketIds=[28421489, 28121353, 4637952, 27409808]
)
lc.plot()
_plot_one(transientBucketId, log, settings)[source]

plot a single transeint lightcurve

Key Arguments

  • transientBucketId – the id of the single transient to plot.

  • settings – dictionary of settings

  • dbConn – marshall database connection

Return

  • filepath – path to the plot file

  • currentMag – an estimate of the current magnitude (from slope of recent LC). -9999 if inaccurate.

  • gradient – gradient of slope of the recent LC. -9999 if inaccurate.