[iFit-users] iFit
Emmanuel FARHI
farhi at ill.fr
Sat Jun 25 10:04:15 CEST 2011
Hi Linda,
On Fri, June 24, 2011 21:44, Linda Udby wrote:
> Hi Emmanuel,
>
> I now got some more time to try out the plotting and fitting routine.
> First of all: how do I specify the marker I want for several plots in the
> same figure?
The easiest is to get the return value from plot, which is an array of
handles:
h = plot(objects, 'r_+')
set(h(2),'marker','o','color','b')
>
> Secondly: Are you planning do do an easier access to the errors on the
> fitted parameters? ... this is quite essential for the usability!
There is no generic method to get the error bars. The one used
traditionally with MFit spec1d only applies to Marquardt-Levenberg and
assumes that parameter distributions are gaussians.
In short, yes I'll find a method, but this a math problem, not a
programming one. In the mean time, use the method explained in
<http://ifit.mccode.org/Fit.html#mozTocId179895>
>
> Thirdly: I seem to only be able to fit functions with one peak, others
> like ngauss and nlorz give the same error message about argument "p":
>
> s0717=load(iData, [dp '070717'])
> plot(s0717)
>>> p0717 =fits(s0717,'ngauss',[1 -0.1 0.1 1 0.1 0.1 0],[0 0 0 0 0 0 0])
> ??? Warning: Struct field assignment overwrites a value with class
> "double".
> See MATLAB 7.0.4 Release Notes, Assigning Structures to Nonstructures
> for
> details.
>> In iData.fits at 172
> ??? Input argument "p" is undefined.
>
> Error in ==> ngauss at 14
> ngss = (length(p)-1)/3;
>
> Error in ==> iData.ieval at 59
> Info = feval(model,'identify'); % get identification Info, esp. for
> Dimension
>
> Error in ==> iData.fits at 180
> [dummy, info] = ieval(a, model,'identify'); % model info
The MFit/spec1d function can not be used as-is within iFit as they can not
be extended to higher dimensionalities.
Instead of the old syntax fun(x, p) iFit uses fun(p, x,y,...)
also, as mentioned earlier, new functions have a generic mechanism for
auto guess for starting parameters and function identification and self
plotting.
If you want to create a 2 gaussians function, use e.g.
>> h=ififmakefunc('gaussx2','Two Gaussians',...
'Amplitude1 Centre1 HalfWidth1 Background1 Amplitude2 Centre2 HalfWidth2
Background2',...
'gauss(p,x)+gauss(p,x)',[1 -0.1 0.1 1 0.1 0.1 0]);
creates the gaussx2.m function and returns its handle. You may use both as
argument for the function during fits.
See <http://ifit.mccode.org/iFuncs.html#mozTocId210092> for more
informations.
You can do that within a Dialog with
>> ifitmakefunc
and fill-in the required informations.
Cheers, Emmanuel.
>
>
> cheers
> Linda
>
> P.S. I will report stuff on the mailing list once I get just a little more
> started so my questions won't be as stupid
>
>
>
> On Fri, 24 Jun 2011, Emmanuel FARHI wrote:
>
>> And if you wish to redefine the axis type in :
>> setaxis(s,1,'A4') or s{1}='A4'
>> E.
>> On Fri, June 24, 2011 17:45, Linda Udby wrote:
>>> Ah, OK, thanks alot!:)
>>> L
>>>
>>> On Fri, 24 Jun 2011, Emmanuel FARHI wrote:
>>>
>>>> s0690.A4 or get(s0690, 'A4')
>>>>
>>>> should do it... as aliases are created for all columns in the data
>>>> block.
>>>>
>>>> To get all this information, type disp(s0690) or get(s0690) which both
>>>> display a list of defined axes and aliases available for
>>>> further use when importing the file.
>>>>
>>>> E.
>>>>
>>>> On 06/24/2011 05:24 PM, Linda Udby wrote:
>>>> Hi Emmanuel,
>>>>
>>>> I must be stupid since I can't figure out how to pick which
>>>> variables I want to go in my 'spec1d' object frome the
>>>> datafile.
>>>> Doing something like this
>>>>
>>>> get(s0690,'Data.VARIA.A4')
>>>>
>>>> only gives me the first value of the parameter in the datafile,
>>>> even though it changes throughout the scan.
>>>>
>>>> How do I do it?
>>>>
>>>> best,
>>>> Linda
>>>>
>>>>
>>>> --
>>>> Emmanuel FARHI,www.ill.eu/computing/people/emmanuel-farhi \|/ ____ \|/
>>>> CS-Group ILL4/221, Institut Laue-Langevin (ILL) Grenoble ~@-/ oO \-@~
>>>> 6 rue J. Horowitz, BP 156, 38042 Grenoble Cedex 9,France /_( \__/ )_\
>>>> Work :Tel (33/0) 4 76 20 71 35. Fax (33/0) 4 76 48 39 06 \__U_/
>>>>
>>>>
>>>
>>
>>
>> --
>> FARHI Emmanuel <farhi at ill.fr>
>> Groupe DS/CS, ILL4/156, Tel 04 76 20 71 35
>> ILL, Grenoble
>>
>
--
FARHI Emmanuel <farhi at ill.fr>
Groupe DS/CS, ILL4/156, Tel 04 76 20 71 35
ILL, Grenoble
More information about the ifit-users
mailing list