Reports¶
Note
Class and additional functions for making reports with analysis results.
Base Report class¶
- class fast_response.reports.ReportGenerator.ReportGenerator(analysis)[source]¶
Generate report from a FastResponseAnalysis object
- generate_report()[source]¶
Generate the report! This function does most of the heavy lifting. Starts making the source LaTeX file (named r.tex), queries runs, makes detector status plots, includes all plots for the analysis, makes all tables for analysis parameters, runs, events, etc.
- get_report_source()[source]¶
Find base path of the general report TeX document Looks for the directory location fast_response, returns fast_response/latex/report_general.tex
- make_coinc_events_table(f)[source]¶
Make a table of ontime events, in LaTeX format
- Parameters:
f (I/O file object) – Opened file that is being written to
- make_new_command(f, name, command)[source]¶
Define a new command, in LaTeX, for the report
- Parameters:
f (I/O file object) – Opened file that is being written to
name (str) – Name of the command being defined
command (str) – Value of the command being defined
- make_pdf()[source]¶
Makes the PDF compiled version of the LaTeX report using pdflatex, and saves to the analysis folder
- static ontime_table(query_dict)[source]¶
Makes a DataFrame of events, queried from IceCube Live
- Parameters:
query_dict (dict) – Queried events in a particular time window
- Returns:
Event parameters for the given events
- Return type:
pandas DataFrame
- query_db_runs(time_window)[source]¶
Queries IceCube Live for the ontime window, plus 8 hours on either side (or as much as possible, if in realtime)
- Parameters:
time_window (tuple of astropy.time Time objects) – (start, stop) for the analysis, in mjd
- Returns:
table of runs loaded, and status of the runs
- Return type:
dict
- write_table(file, name, header, table, prefix='')[source]¶
Write a table in latex format for the generated reports
- Parameters:
file (I/O file object) – Opened file that is being written to
name (str) – Name of the table
header (list) – Headers for each column (can be empty if none)
table (array of tuples) – set of values to put in the table. tuples give individual rows
prefix (str) – prefix to latex command, if needed (default “”)
Analysis-specific report classes¶
- class fast_response.reports.ReportGenerator.FastResponseReport(analysis)[source]¶
Generates a general FastResponse Report for a point source. Includes additional plots of the 1D LLH ns scan
- class fast_response.reports.ReportGenerator.AlertReport(analysis)[source]¶
Generates a FastResponse Report for an Alert event.
Additional report functions¶
- fast_response.reports.report_utils.interptime(tstr)[source]¶
Check time format of a given input
- Parameters:
tstr (str) – time value to check. Expects either a unit at the end (allowed units are sec, s, min, hr, mjd, d) or to have an ISO time
- Returns:
Formatted time value
- Return type:
Time, TimeDelta, or None
- fast_response.reports.report_utils.get_times(trig, sta, sto)[source]¶
Get correctly formatted start, stop, and trigger times
- Parameters:
trig (str) – trigger time, with unit at end, or ISO format
sta (str) – start time, with unit at end, or ISO format
sto (str) – stop time, with unit at end, or ISO format