[{ALLOW edit EISMainUsers}]
[{ALLOW view Anonymous}]
!!! Using eis_auto_fit

The IDL routine eis_auto_fit is available in the EIS part of the Solarsoft tree, and performs single Gaussian fitting to calibrated EIS data.

In order to use eis_auto_fit you must first calibrate your EIS data with eis_prep. You should then extract the data window that you are interested in with eis_getwindata(). E.g., for Fe XII 195:

IDL> wd=eis_getwindata(level1_filename,195.12)

You can then use eis_auto_fit as follows:

IDL> eis_auto_fit,wd,fit,refwvl=195.12

it is necessary to specify the reference wavelength in order to compute a velocity array from the measured centroid positions.  The output 'fit' is an IDL structure with a number of tags including ones for intensity, line width, centroid and velocity, each of which has an associated 1-sigma error array.

If you do not want to use all of the wavelength window in the fit, you can use either the wvlpix= or pix_all= keywords. Please check the routine header for details on how to use these keywords.

eis_auto_fit uses the [MPFIT procedures|http://astrog.physics.wisc.edu/~craigm/idl/idl.html] of C. Markwadt for fitting.

!!Missing data

Particular CCD pixels can be flagged by eis_prep as being 'missing'. This indicates that the pixel is bad in some way, e.g., a CCD warm/hot pixel, cosmic ray, dust. Missing pixels are flagged as having an error value of -100 in the level-1 FITS file, but the intensity value is obtained through interpolation of neighbouring good pixels.

By default, eis_auto_fit ignores all missing pixels in the fitting. Thus, e.g., if the central pixel in a line profile is missing, then eis_auto_fit will ignore this pixel and try to fit a Gaussian to the remaining pixels.

If you want to include the interpolated pixels in fitting, you should use the /INTERP_MISS keyword in the call to eis_auto_fit. Please check the routine header for information about how the error value for interpolated pixels is obtained.