3. After The Fact: Diagnostic Modules.

3.1. make_html

make_html.find_orig_preview(ufr, orig_files)

Given aunique file root (ufr, which includes the IPPPSSOOT ID), this function matches that to the list of original preview files from CADC to determine if an original preview exists for this ufr.

Parameters:
  • ufr (str) – Unique file root to test (this is equivalent to the IPPPSSOOT ID from MAST).

  • orig_files (numpy.ndarray) – Array of original preview file names in which to find a match.

Returns:

int – The index in orig_files that matches the specified ufr, if there is no match then returns None.

make_html.make_html(idir, odir='html/plot_previews/', ofile='plot_previews', orig_dir=None, plot_display_width=512)

Creates diagnostic HTML page showing the generated preview plots (thumb and large) as well as the original MAST version of these plots (the one’s from CADC, provided they can be located in the expected location).

Parameters:
  • idir (str) – Input directory containing the set of preview images generated by spec_plots.

  • odir (str) – Output path for the HTML files. Default = html/plot_previews/`

  • ofile (str) – Base file name of the output HTML files. Default = plot_previews`

  • orig_dir (str) – [Optional] Directory containing the original preview plots from CADC. If provided, these will be included in the HTML pages for comparison purposes.

  • plot_display_width (int) – [Optional] The width of the preview plots in the HTML tables (specified through the <img> tag), in pixels. Default = 512.

Raises:

OSError, IOError, ValueError