tsadar.utils.process.evaluate_background#
Functions
|
This function generates noise or background profiles to based off the data or background data. |
|
Computes the background electron and ion spectra for a given shot based on data from another shot. |
- tsadar.utils.process.evaluate_background.get_shot_bg(config, shotNum, axisyE, elecData)Source#
Computes the background electron and ion spectra for a given shot based on data from another shot. For non-angular data, the function loads background data from a specified shot, applies throughput corrections and smoothing. For angular data polynomial model is fit to the data to correct the background. If background type is not recognized, returns zeros for both backgrounds. :param config: Configuration dictionary containing parameters and processing options. :type config: dict :param shotNum: Shot number of data to evaluated for background. :type shotNum: int :param axisyE: Array representing the wavelength axis for electron data. :type axisyE: np.ndarray :param elecData: Electron data array used for background fitting in certain modes. :type elecData: np.ndarray
- Returns:
tuple – BGele (np.ndarray or int): Background electron spectrum (array or 0 if not loaded). BGion (np.ndarray or int): Background ion spectrum (array or 0 if not loaded).
- tsadar.utils.process.evaluate_background.get_lineout_bg(config, elecData, ionData, BGele, BGion, LineoutTSE_smooth, BackgroundPixel, LineoutPixelE, LineoutPixelI) Tuple[ndarray, ndarray]Source#
This function generates noise or background profiles to based off the data or background data. Electron spectra have 2 options “Fit” and “pixel”. These specify how foreground data is treated. Noise is then the sum of foreground and background noise. Ions only have one background option as the background is usually very small
“Fit” : fits a rational model against the edges of the lineout to produce a background, the model can be changed. This option functions differently for angular data and is handled by the function get_shot_bg. This option makes no attempt to remove a background shot, using both can result in double counting. This option is best for imaging data.
“pixel : the other options “ps” and “auto” are aliases for “pixel” where the background pixel is instead identified by a time (“ps”) or set to 100 pixels past the lineout (“auto”). This method uses another lint of the data that is
- smoothed to act as the background. If included a background shot is removed to prevent double counting. This option
is best for time resolved data.
- Parameters:
config (dict) – Configuration dictionary containing parameters and processing options.
elecData (np.ndarray) – Electron data array used for background fitting in certain modes.
ionData (np.ndarray) – Ion data array used for background fitting in certain modes.
BGele (np.ndarray) – Background electron spectrum from background shot (array or 0 if not loaded).
BGion (np.ndarray) – Background ion spectrum from background shot (array or 0 if not loaded).
LineoutTSE_smooth (np.ndarray) – Smoothed lineout data for electron spectra.
BackgroundPixel (int) – Pixel index for the background region.
LineoutPixelE (list) – List of pixel indices for electron lineouts.
LineoutPixelI (list) – List of pixel indices for ion lineouts.