This page (revision-83) was last changed on 02-Feb-2017 13:19 by David R Williams

This page was created on 27-Jan-2009 03:17 by David R Williams

Only authorized users are allowed to rename pages.

Only authorized users are allowed to delete pages.

Page revision history

Version Date Modified Size Author Changes ... Change note
83 02-Feb-2017 13:19 43 KB David R Williams to previous
82 19-Mar-2009 13:50 41 KB David R Williams to previous | to last
81 18-Mar-2009 21:12 40 KB David R Williams to previous | to last

Page References

Incoming links Outgoing links

Version management

Difference between version and

At line 94 added one line
The 1st step returns missing pixels, but they aren't filled in by other values. To do this, you have to allow the CR option (step 2?).
At line 96 added 2 lines
PRY: If I don't use /DEFAULT what happens?
AG: If you don't select default, it should ask you to choose the DC file.
At line 99 added 15 lines
Computation of moments is available in XFILES -> XCONTROL -> Line Fit
Can't construct moments in anything other than absolute units. Also doesn't work with negative values retained.
Can then, in XFILES, use moments OR the Gaussian fitting routine supplied by PRY.
HEM: This is assuming no blends and a single line per window?
AG: When you select a line, you have to then specify the line and continuum interactively. If you have two lines very close to each other, you can choose only a few pixels plus continuum to choose just that line. But if there is a blend then it won't work.
After the line and contin. are selected, the 0th, 1st, and 2nd order moments are computed. The last term 2*ln(2) is necessary to turn sigma into the FWHM. That's it.
XFILES also gives you the errors on these moments for intensity and velocity. The error on the line width hasn't been implemented yet.
HEM: is there documentation for this yet? What you said is really useful, but is there a written version of it.
Brief discussion followed about the desire for tutorials and guides.
At line 117 added 62 lines
EIS_AUTO_FIT and EIS_AUTO_FIT_GEN (newer) both available.
When you want to fit multiple gaussians the latter is better (?)
You might want to add many spatial pixels together to make a total or mean spectrum.
You can select sub-regions of the array.
{{eis_auto_fit, windata, fitdata, refwvl=195.12}}
# First choose the FITS file I want to look at.
# I then choose a pre-calibrated file
# extract the window data with EIS_GET_WINDATA
# choose one at 264 Å
# {{eis_mk_fit_template}} averages the spectrum over space
# go to the window, select the lines roughly and the continuum
# wanted to speed up the fitting for this talk, so...
# have a routine that takes the windata and rebins it by some factor which gives you that factor^2 less pixels to fit
# then read fit template {{eis_read_fit_template}}
# then start the fitting process, which takes a while, meantime...
The fit template stores the initial guesses as a text file which you can modify if you want to.
GAD: How accurate does it have to be?
PRY: Not too accurate. In this case the lines are quite widely spaced,
GAD: But how about if they're close together
PB: in the case where there is a blend, then in some cases I found I had to restrict the parameters, e.g. fixing the widths to be the same
PRY: You could try the lines having a narrow range of width?
PB: what I did was to force the widths to be equal, which meant I had to change the code a bit
PRY: sometimes you have to write a more specialised routine, because it's difficult to write something completely general?
YKK: Is the continuum fixed as linear?
PRY: yes, linear or constant
okay, the fit has finished:
# when yo do the orbital correction, have to specify a line -- in this case line 1.
# you can then view the quality of the fit with {{FIT_VIEWER}}
# see the I, V and dl maps. Click on a position and you see the spectrum AND fit.
It's available in SSW, and there's a tutorial on the web to show you how to use it.
That was the Gaussian fitting.
I also mentioned that sometimes you see a BP, for example, and you want to add all the pixels' spectra together. Arbitrary spatial pixels. It's complicated by the grating tilt and inter-channel offset, but that can be taken care of with this software.
I'll use the same dataset as before. Have a simple routine that makes an image in the specified line. {{eis_make_image}}
{{eis_pixel_mask}} to make the mask...
__how is the pixel mask stored?__
This performs the averaging and gives you a Channel A (long) and Channel B (short) spectrum.
In {{spec_gauss}} you can see the data quality with the yellow line (something to do with number of missing pixels?)
Just wanted to show the Gaussian fitting routines I wrote.
*Auto fits single
*Auto fits multiple
*Spatially averaged spectra
uses EIS_CCD_OFFSET for each wavelength in the spectrum to compensate for intra-channel vertical offsets.