pypeit.qa module
Module for QA in PypeIt
- pypeit.qa.arc_tilts_2d_qa(tilts_dspat, tilts, tilts_model, tot_mask, rej_mask, spat_order, spec_order, rms, fwhm, slitord_id=0, setup='A', outfile=None, show_QA=False, out_dir=None)[source]
..todo.. this method needs docs
- Parameters:
tilts_dspat
tilts
tilts_model
tot_mask
rej_mask
spat_order
spec_order
rms
fwhm
slitord_id
setup
outfile
show_QA
out_dir
Returns:
- pypeit.qa.arc_tilts_spat_qa(tilts_dspat, tilts, tilts_model, tilts_spec_fit, tot_mask, rej_mask, spat_order, spec_order, rms, fwhm, setup='A', slitord_id=0, outfile=None, show_QA=False, out_dir=None)[source]
NEEDS A DOC STRING!
- pypeit.qa.arc_tilts_spec_qa(tilts_spec_fit, tilts, tilts_model, tot_mask, rej_mask, rms, fwhm, slitord_id=0, setup='A', outfile=None, show_QA=False, out_dir=None)[source]
Generate a QA plot of the residuals for the fit to the tilts in the spectral direction one slit at a time
- pypeit.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.qa.get_dimen(x, maxp=25)[source]
Assign the plotting dimensions to be the “most square”
- Parameters:
- Return type:
- 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.qa.html_end(f, body, links=None)[source]
Fill in the HTML file with a proper ending
- Parameters:
f (io.TextIOWrapper)
body (str)
links (str, optional)
- Returns:
end – The text written to the end of the HTML file
- Return type:
- pypeit.qa.html_init(f, title)[source]
Initialize the HTML file
- Parameters:
f (io.TextIOWrapper) – file object to write to
title (str) – title
- Returns:
Initial HTML text incluing the header and links
- Return type:
- pypeit.qa.set_qa_filename(root, method, det=None, slit=None, prefix=None, mode=None, out_dir=None)[source]
Generate the filename for the QA file from the input parameters.
- Parameters:
root (
str) – Root name for the output filemethod (
str) – Describes the QA routinedet (
str|None) – The name of the detector or mosaic (e.g., DET01)prefix (
str|None) – Start the name of the QA file (used for multiple-PNG PCA plots)mode (
str|None) – Additional differentiating information (e.g.,gloablvslocalflexure correction)
- Return type:
- Returns:
Output filename
- pypeit.qa.spat_flexure_qa(img, slits, shift, gpm=None, vrange=None, outfile=None)[source]
Generate QA for the spatial flexure
- Parameters:
img (numpy.ndarray) – Image of the detector
slits (
pypeit.slittrace.SlitTraceSet) – Slits objectshift (
float) – Shift in pixelsgpm (numpy.ndarray, optional) – Good pixel mask (True = Bad)
vrange (
tuple, optional) – Tuple with the min and max values for the imshow plotoutfile (
str, optional) – Path to the output file where the QA is saved. If None, the QA is shown on screen and not saved.
- pypeit.qa.spec_flexure_corrQA(ax, this_flex_dict, cntr, name)[source]
Spectral Flexure QA Plot
Creates one panel of the spectral felxure QA plot, with the overall figure container being handled by the calling function.
- Parameters:
ax (
Axes) – Axes onto which to draw the plotthis_flex_dict (
dict) – Dictionary of flexure-related information needed for the plotcntr (
int) – The index intothis_flex_dict’s arrays corresponding to the particular object, trace, or location of interest.name (
str) – Object, trace, or location name to be printed in the plot
- pypeit.qa.spec_flexure_qa(slitords, bpm, basename, flex_list, specobjs=None, out_dir=None)[source]
Generate QA for the spectral flexure calculation
- Parameters:
slitords (numpy.ndarray) – Array of slit/order numbers
bpm (numpy.ndarray) – Boolean mask; True = masked slit
basename (str) – Used to generate the output file name
flex_list (list) – list of
dictobjects containing the flexure informationspecobjs (
SpecObjs, optional) – Spectrally extracted objectsout_dir (str, optional) – Path to the output directory for the QA plots. If None, the current is used.