goodman_focus package

Submodules

goodman_focus.goodman_focus module

class goodman_focus.goodman_focus.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)

Bases: object

property fwhm
get_focus_data(group)

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.

Parameters
  • group (DataFrame) – The group refers to a set of images obtained

  • likely in series and with the same configuration. (most) –

Returns

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']
goodman_focus.goodman_focus.get_args(arguments=None)
goodman_focus.goodman_focus.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.

Parameters
  • 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

  • `range

  • 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

Returns

The FWHM, mean FWHM or None.

goodman_focus.goodman_focus.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.

Parameters
  • ccd (object) – Image to get peaks from

  • file_name (str) – Name of the file used. This is optional and is used

  • for debugging purposes. (only) –

  • plots (bool) – Show plots of the profile, background and

  • profile (background-subtracted) –

Returns

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.

goodman_focus.goodman_focus.run_goodman_focus(args=None)

Entrypoint

Parameters

args (list) – (optional) a list of arguments and respective values.

goodman_focus.version module

Module contents