sherlockpipe.bayesian_fit.fit_report.FitReport
- class sherlockpipe.bayesian_fit.fit_report.FitReport(data_dir, object_id, ra, dec, v, j, h, k, candidates_df)
Bases:
objectThis class creates a fit report for the fitting module of SHERLOCK.
- __init__(data_dir, object_id, ra, dec, v, j, h, k, candidates_df)
Initializes the fit report generator.
Parameters
- data_dirstr
The directory containing the allesfitter fit results.
- object_idstr
The target object identifier.
- rafloat
Right ascension in degrees.
- decfloat
Declination in degrees.
- vfloat
V-band magnitude.
- jfloat
J-band magnitude.
- hfloat
H-band magnitude.
- kfloat
K-band magnitude.
- candidates_dfpandas.DataFrame
DataFrame containing the candidate planet parameters.
Methods
__init__(data_dir, object_id, ra, dec, v, j, ...)Initializes the fit report generator.
create_footer(canvas, doc)Draws the footer section of each PDF page including the powered-by line and page number.
create_header(canvas, doc)Draws the header section of each PDF page including the logo, report title, and date.
Generates the full PDF fit report including target parameters, global and per-companion fitted parameters with uncertainties, folded transit curves, and habitability predictions.
is_float(element)Checks whether a given element can be converted to a float.
replace_latex(content)Converts LaTeX math expressions in a string to HTML/ReportLab-friendly markup.
row_colors(df, table_object)Applies alternating row background colors to a ReportLab table.
Attributes
CANDIDATE_COLORSLOGO_IMAGEDraws the footer section of each PDF page including the powered-by line and page number.
Parameters
- canvasreportlab.pdfgen.canvas.Canvas
The ReportLab canvas to draw on.
- docreportlab.platypus.BaseDocTemplate
The document template providing page context.
- create_header(canvas, doc)
Draws the header section of each PDF page including the logo, report title, and date.
Parameters
- canvasreportlab.pdfgen.canvas.Canvas
The ReportLab canvas to draw on.
- docreportlab.platypus.BaseDocTemplate
The document template providing page context.
- create_report()
Generates the full PDF fit report including target parameters, global and per-companion fitted parameters with uncertainties, folded transit curves, and habitability predictions. The report is saved as
<object_id>_fit.pdfin the data directory.
- is_float(element: any) bool
Checks whether a given element can be converted to a float.
Parameters
- elementany
The value to check.
Returns
- bool
True if the element can be cast to float, False otherwise.
- replace_latex(content)
Converts LaTeX math expressions in a string to HTML/ReportLab-friendly markup.
Substitutions include:
\mathrm{...}to plain braces, subscripts to<sub>tags, Greek letter commands to<greek>tags, and unit macros to readable text.Parameters
- contentstr
The string containing LaTeX math markup.
Returns
- str
The converted string with HTML-compatible markup.