py4py.reverb.timeseries.output

Timeseries output module

This module contains the output code for the timeseries analysis. This is intended to output to the formats the CARAMEL and MEMEcho team analyse & plot.

next_column

write_caramel_data(lightcurve, spectra, spectra_times, ...)

Given a lightcurve, series of spectra and time outputs to CARAMEL format, and then

write_memecho_data(lightcurve, spectra, spectra_times, ...)

Given a lightcurve, series of spectra and time outputs to MEMECHO format, outputs them

trailed_spectrogram(spectra, lightcurve, ...[, ...])

Generate a trailed spectrogram of both the time series of spectra and difference relative to the mean,

write_animation(spectra, lightcurve, spectra_times, ...)

Given a lightcurve and table containing a time series of spectra,

rescaled_rfs(tfs, rescale_max_time, figure_max_time[, ...])

Outputs response functions for rescaled versions of the input.

plot_spectra_rms(spectra, filenames)

Given a list of timeseries of spectra (full and continuum subtracted), produce a trailed

Module Contents

py4py.reverb.timeseries.output.write_caramel_data(lightcurve: astropy.table.Table, spectra: astropy.table.Table, spectra_times: astropy.table.Table, suffix: str, rescale: bool | None = True)

Given a lightcurve, series of spectra and time outputs to CARAMEL format, and then compresses the output into a ZIP file.

Parameters:
  • lightcurve (Table) – Continuum values and times, in seconds and real units.

  • spectra (Table) – Table of wavelengths and spectra. Continuum-subtracted.

  • spectra_times (Table) – Table of spectrum times.

  • suffix (str) – Suffix appended to filename. Intended to sort outputs as e.g. caramel/qso/caramel_lightcurve_qso.

  • rescale (bool) – Whether or not the spectra should be rescaled to 1-100 range, defaults to yes.

Outputs:

caramel/{suffix}/caramel_lightcurve_{suffix}.txt: Continuum lightcurve. caramel/{suffix}/caramel_spectra_{suffix}.txt: Values of the mock observations. caramel/{suffix}/caramel_spectra_times_{suffix}.txt: Times of the mock observations. caramel/caramel_{suffix}.zip: Zip of all the outputs.

py4py.reverb.timeseries.output.write_memecho_data(lightcurve: astropy.table.Table, spectra: astropy.table.Table, spectra_times: astropy.table.Table, suffix: str)

Given a lightcurve, series of spectra and time outputs to MEMECHO format, outputs them to files and zips them up for distribution.

Parameters:
  • lightcurve (Table) – Continuum values and times, in seconds and real units.

  • spectra (Table) – Table of wavelengths and spectra. Not continuum-subtracted.

  • spectra_times (Table) – Table of spectrum times.

  • suffix (str) – Suffix appended to file name.

Outputs:

memecho/{suffix}/prepspec_{suffix}_{timestep}.txt: The mock observations for each timestep memecho/{suffix}/prepspec_times.txt: The times of each mock observation, and spectra file associated with each. memecho/{suffix}/memecho_lightcurve.txt: The driving continuum lightcurve. memecho/memecho_{suffix}.zip: Zip of all the outputs

py4py.reverb.timeseries.output.trailed_spectrogram(spectra: astropy.table.Table, lightcurve: astropy.table.Table, spectra_times: astropy.table.Table, filename: str, line_wavelength: float = None, wavelength_range: Tuple[float, float] | None = None)

Generate a trailed spectrogram of both the time series of spectra and difference relative to the mean, with the continuum as an adjacent line plot.

Parameters:
  • spectra (Table) – Spectra (starting at column 3).

  • spectra_times (Table) – Times to plot the TS for.

  • lightcurve (Table) – The continuum lightcurve.

  • filename (String) – File to write to.

  • line_wavelength (float) – The wavelength of the line being plotted.

  • wavelength_range ([float, float]) – The wavelength range to plot.

Outputs:

{filename}.eps: Time series output.

py4py.reverb.timeseries.output.next_column = None
py4py.reverb.timeseries.output.write_animation(spectra: astropy.table.Table, lightcurve: astropy.table.Table, spectra_times: astropy.table.Table, times: astropy.table.Table, filename: str, is_reversed: bool = False)

Given a lightcurve and table containing a time series of spectra, generate an animation that shows how the output spectrum changes over time.

Parameters:
  • spectra (Table) – Spectra (starting at column 3).

  • spectra_times (Table) – Times to plot the spectra values for

  • times (Table) – High time-resolution interpolated continuum lightcurve.

  • lightcurve (Table) – The continuum lightcurve.

  • filename (str) – File to write to

  • is_reversed (bool) – Whether newer points should be overlaid by older ones

Outputs:

{filename}.mp4

py4py.reverb.timeseries.output.rescaled_rfs(tfs: List[py4py.reverb.TransferFunction], rescale_max_time: astropy.units.Quantity, figure_max_time: astropy.units.Quantity, keplerian: dict = None)

Outputs response functions for rescaled versions of the input. Different mass SMBHs scale straightforwardly; accretion disks are generated at locations with the same doppler shifts, so the only thing you need to do to scale the mass is to rescale the time delays.

Parameters:
  • tfs (List[TransferFunction]) – The transfer functions to plot the response functions for.

  • rescale_max_time (Quantity) – The new ‘maximum time’ the TF should extend to.

  • figure_max_time (Quantity) – The maximum time that should be shown on the plot (may be lower than rescale_max_time).

  • keplerian (dict) – Dictionary containing Keplerian disk profile as used by plot.

Outputs:

{tf.name}_resp.eps

py4py.reverb.timeseries.output.plot_spectra_rms(spectra: List[Tuple[astropy.table.Table, astropy.table.Table]], filenames: List[str])

Given a list of timeseries of spectra (full and continuum subtracted), produce a trailed spectrogram of each, plus the RMS spectra.

Parameters:
  • spectra (List[(Table, Table)]) – Pairs of tables containing full and continuum subtracted (in that order) timeseries of spectra

  • filenames (List[str]) – Filenems List of filenames for each of the pairs.

Outputs:

{filename}.eps for filename in filenames