Generic
This module gathers different and unrelated functions.
- class generic.Logger(log_path)
Save the content of the console inside a txt file.
Class allowing to save the content of the console inside a txt file. Found on the internet, source lost.
To stop the log in the file, use the command sys.stdout.close().
- close()
Close the log file.
Close the log file and print in the terminal is back to default settings.
- flush()
Present for python 3 compatibility.
This flush method is needed for python 3 compatibility. This handles the flush command by doing nothing. You might want to specify some extra behavior here.
- write(message)
Print the content in the terminal and in the log file.
- Parameters:
message (str) – message to print and log
- generic.get_zeta_coeff(path, wl_scale, plot=False, **kwargs)
Interpolate the zeta coefficients for the requested wavelengths.
Parameters
- pathstring
Path to the zeta coefficients’ file.
- wl_scalearray
List of wavelength for which we want the zeta coefficients.
- plotbool, optional
If True, the plot of the interpolated zeta coefficients curve is displayed. The default is False.
- **kwargsextra keyword arguments
wl_bounds prunes the zeta coeff arrays for them to all have the same wavelength scale.
Returns
- coeff_newdict
Dictionary of the interpolated zeta coefficients.