[{ALLOW edit EISMainUsers}]
[{ALLOW view Anonymous}]
In the documentation says that to fit the lines we can use that command:

{{{
  IDL> objm = obj_new('eis_moment', obj, iwin=iwin, fit='gauss')
}}}

But I find two problems, the first of them comes when I try to fit more than one line in the same window.  
It starts to appear error messages like that:

{{{
  % MCURVEFIT: Too many repeats, silly lambda value.
  % MCURVEFIT: Failed to converge, done 8 iterations
  % CFIT_BLOCK_POINT: Failed at (302,29,0,0,0,0), chi^2 set to zero
}}}

and I cannot find a way to extract from objm the values for the different lines that had been fitted.  Any idea to do it? or I should cut the window in sub-windows? or there are any other way to do it (maybe without objects..)?   Also, is there any way to see the values of wavelength in the xcfit window?

The other problem appears when I want to extract the wavelength, and I do in that way:
{{{
  IDL> wavel=obj->getlam(iwin)
  IDL> help,data,wavel
  DATA            FLOAT     = Array[104, 512, 41]
  WAVEL           DOUBLE    = Array[105]
}}}
Why am I getting one value more than the number of pixels?

--[David Pérez-Suárez|DavidPS],
[{CurrentTimePlugin format='dd MMM yyyy' }]

----\\

* I didn't use 'gauss' option before in moment object. I am using 'moment' option, maybe you could try it to see if it works. 
* The second problem is caused by some typoes. It will be fixed soon.
To get the right wavelenght, it could be used like this (in your case):
{{{
IDL> wavel=obj->getlam(iwin)
IDL> n_wavel=n_elements(wavel) ;get the number of wavel
IDL> wavel=wavel[0:n_wavel-2]  ;cut the last element of the 'wavel'
}}}

Hope this helpful.

-- [Jian|],[{CurrentTimePlugin format='dd MMM yyyy' }]


----

Problem nr 1) "and I cannot find a way to extract from objm the values for the different lines that had been fitted. Any idea to do it? or I should cut the window in sub-windows? or there are any other way to do it (maybe without objects..)? Also, is there any way to see the values of wavelength in the xcfit window?"

Answer: We have not yet written software to deal with multiple lines in a given window, I suggest you extract the relevant window from the object and work directly with xcfit/cfit to fit the lines you need.

Problem nr 2) "Why am I getting one value more than the number of pixels?" 

Answer: Yes, this is a bug, the last element should not be included. I have now fixed the method.


--[ViggoHanst|http://null], 19-Jun-2007


----

Of course you can use 'traditional' methods and once you have your wavelength and intensity simply use a routine like gauss_fit...


--[Louise Harra|http://null], 19-Jun-2007