py4py.reverb.timeseries.output ============================== .. py:module:: py4py.reverb.timeseries.output .. autoapi-nested-parse:: 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. .. autoapisummary:: py4py.reverb.timeseries.output.next_column .. autoapisummary:: py4py.reverb.timeseries.output.write_caramel_data py4py.reverb.timeseries.output.write_memecho_data py4py.reverb.timeseries.output.trailed_spectrogram py4py.reverb.timeseries.output.write_animation py4py.reverb.timeseries.output.rescaled_rfs py4py.reverb.timeseries.output.plot_spectra_rms Module Contents --------------- .. py:function:: write_caramel_data(lightcurve: astropy.table.Table, spectra: astropy.table.Table, spectra_times: astropy.table.Table, suffix: str, rescale: Optional[bool] = True) Given a lightcurve, series of spectra and time outputs to CARAMEL format, and then compresses the output into a ZIP file. :param lightcurve: Continuum values and times, in seconds and real units. :type lightcurve: Table :param spectra: Table of wavelengths and spectra. Continuum-subtracted. :type spectra: Table :param spectra_times: Table of spectrum times. :type spectra_times: Table :param suffix: Suffix appended to filename. Intended to sort outputs as e.g. caramel/qso/caramel_lightcurve_qso. :type suffix: str :param rescale: Whether or not the spectra should be rescaled to 1-100 range, defaults to yes. :type rescale: bool 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. .. py:function:: 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. :param lightcurve: Continuum values and times, in seconds and real units. :type lightcurve: Table :param spectra: Table of wavelengths and spectra. Not continuum-subtracted. :type spectra: Table :param spectra_times: Table of spectrum times. :type spectra_times: Table :param suffix: Suffix appended to file name. :type suffix: str 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 .. py:function:: trailed_spectrogram(spectra: astropy.table.Table, lightcurve: astropy.table.Table, spectra_times: astropy.table.Table, filename: str, line_wavelength: float = None, wavelength_range: Optional[Tuple[float, float]] = 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. :param spectra: Spectra (starting at column 3). :type spectra: Table :param spectra_times: Times to plot the TS for. :type spectra_times: Table :param lightcurve: The continuum lightcurve. :type lightcurve: Table :param filename: File to write to. :type filename: String :param line_wavelength: The wavelength of the line being plotted. :type line_wavelength: float :param wavelength_range: The wavelength range to plot. :type wavelength_range: [float, float] Outputs: {filename}.eps: Time series output. .. py:data:: next_column :value: None .. py:function:: 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. :param spectra: Spectra (starting at column 3). :type spectra: Table :param spectra_times: Times to plot the spectra values for :type spectra_times: Table :param times: High time-resolution interpolated continuum lightcurve. :type times: Table :param lightcurve: The continuum lightcurve. :type lightcurve: Table :param filename: File to write to :type filename: str :param is_reversed: Whether newer points should be overlaid by older ones :type is_reversed: bool Outputs: {filename}.mp4 .. py:function:: 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. :param tfs: The transfer functions to plot the response functions for. :type tfs: List[TransferFunction] :param rescale_max_time: The new 'maximum time' the TF should extend to. :type rescale_max_time: Quantity :param figure_max_time: The maximum time that should be shown on the plot (may be lower than rescale_max_time). :type figure_max_time: Quantity :param keplerian: Dictionary containing Keplerian disk profile as used by plot. :type keplerian: dict Outputs: {tf.name}_resp.eps .. py:function:: 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. :param spectra: Pairs of tables containing full and continuum subtracted (in that order) timeseries of spectra :type spectra: List[(Table, Table)] :param filenames: Filenems List of filenames for each of the pairs. :type filenames: List[str] Outputs: {filename}.eps for filename in filenames