9. Utility Functions

pcassie.utility_functions.normalize_zero_one(spectrum)[source]
pcassie.utility_functions.split_divide_by_median(wave, flux, m)[source]

Splits the spectrum into sections based on gaps in the wavelength array, normalizes each section by dividing by its median, and returns the normalized flux, the gap indices, and the segment index pairs (start, end).

pcassie.utility_functions.split_detectors(wave, flux, m=5)[source]
pcassie.utility_functions.mask_gap_edges(wave, gaps, n)[source]

Returns a boolean mask that is True for points to be masked: - The first n points after each gap - The last n points before each gap - Optionally, the first n and last n points of the array

pcassie.utility_functions.debug_print(verbose, *args, **kwargs)[source]

General function to allow for toggleable print statements.