pypeit.core.qa module

Module for QA in PypeIt

pypeit.core.qa.close_qa(pypeit_file, qa_path)[source]

Tie off QA under a crash

Parameters:
  • pypeit_file (str) – PypeIt file name

  • qa_path (str) – Path to QA directory

pypeit.core.qa.gen_exp_html()[source]

Generate the HTML for an Exposure set

pypeit.core.qa.gen_mf_html(pypeit_file, qa_path)[source]

Generate the HTML for QA

Parameters:
  • pypeit_file (str) – Name of the PypeIt file, no path

  • qa_path (str) – Path to the QA folder

pypeit.core.qa.gen_qa_dir(qa_path)[source]

Make the QA directory if it doesn’t already exist

Parameters:

qa_path (str) – Path to the QA folder

pypeit.core.qa.gen_timestamp()[source]

Generate a simple time stamp including the current user

Returns:

timestamp – user_datetime

Return type:

str

pypeit.core.qa.get_dimen(x, maxp=25)[source]

Assign the plotting dimensions to be the “most square”

Parameters:
  • x (int) – An integer that equals the number of panels to be plot

  • maxp (int (optional)) – The maximum number of panels to plot on a single page

Returns:

  • pages (list) – The number of panels in the x and y direction on each page

  • npp (list) – The number of panels on each page

pypeit.core.qa.html_end(f, body, links=None)[source]

Fill in the HTML file with a proper ending

Parameters:
Returns:

end – The text written to the end of the HTML file

Return type:

str

pypeit.core.qa.html_exp_pngs(exp_name, det)[source]

Generate HTML for Exposure PNGs

Parameters:
  • exp_name (str) –

  • det (int) –

Returns:

  • links (str)

  • body (str)

pypeit.core.qa.html_header(title)[source]

Generate a simple HTML header

Parameters:

title (str) – Title for the header

Returns:

head – An HTML header as a long string

Return type:

str

pypeit.core.qa.html_init(f, title)[source]

Initialize the HTML file

Parameters:
Returns:

Initial HTML text incluing the header and links

Return type:

str

pypeit.core.qa.html_mf_pngs(idval)[source]

Generate HTML for QA PNGs

Parameters:

idval – str Key identifier of the calibration set

Returns:

  • links – HTML links to the PNGs

  • body – HTML edits for the main body

Return type:

tuple

pypeit.core.qa.set_qa_filename(root, method, det=None, slit=None, prefix=None, out_dir=None)[source]

Generate the filename for the QA file from the input parameters.

Parameters:
  • root (str) – Root name

  • method (str) – Describes the QA routine

  • det (str, optional) – The name of the detector or mosaic (e.g., DET01)

  • slit (int, optional) –

  • prefix (str, optional) – start the name of the QA file

  • out_dir (str, optional) – Path to QA/

Returns:

outfile – Filename

Return type:

str