pypeit.scripts.chk_noise_1dspec module
This script explores the noise in a slit or spectrum for one of the outputs of PypeIt
- class pypeit.scripts.chk_noise_1dspec.ChkNoise1D[source]
Bases:
ScriptBase
- classmethod get_parser(width=None)[source]
Construct the command-line argument parser.
Derived classes should override this. Ideally they should use this base-class method to instantiate the ArgumentParser object and then fill in the relevant parser arguments
Warning
Any argument that defaults to the string
'current working directory'
will be replaced by the result ofos.getcwd()
when the script is executed. This means help dialogs will include this replacement, and parsing of the command line will useos.getcwd()
as the default. This functionality is largely to allow for PypeIt’s automated documentation of script help dialogs without the “current working” directory being that of the developer that most recently compiled the docs.- Parameters:
description (
str
, optional) – A short description of the purpose of the script.width (
int
, optional) – Restrict the width of the formatted help output to be no longer than this number of characters, if possible given the help formatter. If None, the width is the same as the terminal width.formatter (argparse.HelpFormatter) – Class used to format the help output.
- Returns:
Command-line interpreter.
- Return type:
- pypeit.scripts.chk_noise_1dspec.get_basename(header, extract_type, pypeit_name=None, maskdef_objname=None, maskdef_extract=False)[source]
- pypeit.scripts.chk_noise_1dspec.plot(args, line_wav_z: ndarray, line_names: ndarray, flux: ndarray, err: ndarray, mask: ndarray, input_mask: ndarray, ratio: ndarray, lbda: ndarray, basename: str, folder: str = None, z: float = None, plot_shaded=True)[source]
Plot the 1D spectrum
- Parameters:
args (argparse.ArgumentParser) – Command-line argument parser.
line_wav_z (numpy.ndarray) – Array of wavelength of spectral features to be plotted.
line_names (numpy.ndarray) – Array of names of spectral features to be plotted.
flux (numpy.ndarray) – Flux of the spectrum.
err (numpy.ndarray) – Sig of the spectrum.
lbda (numpy.ndarray) – Wavelength values of the spectrum.
mask (numpy.ndarray)
input_mask (numpy.ndarray)
ratio (numpy.ndarray) – Chi values
basename (
str
) – Basenamefolder (
str
, optional) – Output folder, if saving. Defaults to None.z (
float
, optional) – Redshift of the object that we want to plot. Defaults to None.plot_shaded (
bool
, optional) – Do you want to plot the shaded area that shows the wavelength range used in the analysis? Defaults to True.