GoodmanFocus(data_path='/home/docs/checkouts/readthedocs.org/user_builds/goodman-focus/checkouts/latest/docs', file_pattern='*.fits', obstype='FOCUS', features_model='gaussian', plot_results=False, debug=False)¶
Collects all the relevant data for finding best focus
It is important that the data is not very contaminated because there is no built-in cleaning process.
group (DataFrame) – The group refers to a set of images obtained
likely in series and with the same configuration. (most) –
a pandas.DataFrame with three columns. file, fwhm and focus.
keywords= ['INSTCONF', 'FOCUS', 'CAM_TARG', 'GRT_TARG', 'CAM_FOC', 'COLL_FOC', 'FILTER', 'FILTER2', 'GRATING', 'SLIT', 'WAVMODE', 'EXPTIME', 'RDNOISE', 'GAIN', 'OBSTYPE', 'ROI']¶
get_fwhm(peaks, values, x_axis, profile, model, sigma=3, maxiter=3)¶
Finds FWHM for an image by fitting a model
For Imaging there is only one peak (the slit itself) but for spectroscopy there are many. In that case a 3-sigma clipping 1-iteration is applied to clean the values and then the mean is returned. In case that a FWHM can’t be obtained a None value is returned.
This function allows the use of Gaussian1D and Moffat1D models to be fitted to each line. Gaussian1D produces more consistent results though Moffat1D usually fits better the whole line profile.
peaks (numpy.ndarray) – An array of peaks present in the profile.
values (numpy.ndarray) – An array of values at peak location.
x_axis (numpy.ndarray) – X-axis for the profile, usually is equivalent to
profile (numpy.ndarray) – 1-dimensional profile of the image being analyzed.
model (Model) – A model to fit to each peak location. Gaussian1D and
are supported. (Moffat1D) –
sigma (int) – Number sigmas to use on sigma-clipping
maxiter (int) – Maximum number of sigma-clipping iterations
The FWHM, mean FWHM or None.
get_peaks(ccd, file_name='', plots=False)¶
Identify peaks in an image
For Imaging and Spectroscopy the images obtained for focusing have lines that in the first case is an image of the slit and for the second is the spectrum of lamp, strategically selected for a good coverage of lines across the detector.
A list of peak values, peak intensities as well as the x-axis and the background subtracted spectral profile. For Imaging is the same axis as the spectral axis.