[neutron-mc] Simple Question

Emmanuel FARHI farhi at ill.fr
Wed Jan 10 21:54:28 CET 2007


Hi again Aaron,

the difference comes from the way the axis is generated. Consider that the
data is stored into bins which have a given extent dx. The first left bin
value is min, the right last bin value is max. This means that the axis
values should better be the center of the bins for data analysis and
plotting. That's the way McStas plot the data. So you should generate the
bins between  min+dx/2 and max-dx/2, with dx=(max-min)/bins.

E.



> Emmanuel,
>
> Your suggestion worked.  I was able to convert the data file from Matlab
> format to the McStas format (which seems to be simple text) using
> mcformat.exe.  I then used excel to import only the data columns (in this
> case there was theta, counts, error and intensity).  I took this data from
> excel into Origin, and used Origin to perform analysis.  I do notice in
> doing this that the Gaussian fit found in Origin gives slightly different
> values for X0 and dX (the variable McStas used in Matlab) for the centre
> and
> width of the curve respectively.  The actual numbers are X0 = 99.852 dX =
> 6.024 (from Matlab) and X0 = 97.3, dX = 7.7, which as you can see is quite
> significant.
>
> Another interesting point to note is that the curve produced in Origin is
> slightly different than the one produced in Matlab by mcplot, but they
> should be produced from the same data.
>
> Aaron.
>
>   _____
>
> From: neutron-mc-bounces at risoe.dk [mailto:neutron-mc-bounces at risoe.dk] On
> Behalf Of Emmanuel FARHI
> Sent: Wednesday, January 10, 2007 10:48 AM
> To: McStas users list at neutron.risoe.dk
> Subject: Re: [neutron-mc] Simple Question
>
> Hi AAron,
>
> The idea is that axes are always regular, so that the min, max and number
> of
> steps is sufficient to generate the axis vector. The min and max is given
> in
> the 'xylimits' field of Matlab data structure, or on '# xylimits:' line of
> PGPLOT data format file. The number of steps is written in the 'type'
> field
> and '# type:' line as well. Then that's really easy to generate the axes
> with 'linspace' function in Matlab.
>
> the best for you is to generate the data using the PGPLOT format. If you
> do
> not have PGPLOT you will not be able to plot it. Anyway you may use the
> 'mcformat' tool to convert it to e.g. Matlab format. You may also convert
> -
> still with mcformat - your Matlab data into PGPLOT if the simulation is
> too
> long to re-run.
>
> E.
>
> Aaron M. Percival wrote:
> Good Day,
>
> I have a simple question about exporting McStas data from Matlab to
> another
> platform.  I'll give an example of what I want to do:
>
> I have a type Monitor_nD detector with the following options set, options
> =
> "banana, theta, limits=[60,150], bins=100".
>
> I'd like to take the data from this detector and export it to, say Origin
> for further analysis.  I've found in the detector file the array for the
> data and the errors, however, I cannot find the array for the x-values (in
> this case theta values).  However, I did find something called stepx:
> 0.9091.  Are the x-values generated by starting at (in this case) 60, then
> increasing each increment by 0.9091, 100 times (since there are 100 bins)?
>
> Regards,
>
> Aaron M. Percival
>
> *************************************************
> Aaron M. Percival
> M.Sc. Candidate
> Dept. of Physics, Engineering Physics & Astronomy
> Queen's University
> Kingston, Ontario, Canada, K7L 3N6
> Office: 613-533-6000 ext. 74789
> Fax: 613-533-6463
> *************************************************
>
>
>
>
>
>
>
>
>   _____
>
>
>
>
> _______________________________________________
> neutron-mc mailing list
> neutron-mc at risoe.dk
> http://mailman.risoe.dk/mailman/listinfo/neutron-mc
>
>
>
>
> --
> What's up Doc ?
> --------------------------------------------
> Emmanuel FARHI, http://www.ill.fr/Computing/people/Farhi  \|/ ____ \|/
> CS-Group BP2/22,   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_/
> _______________________________________________
> neutron-mc mailing list
> neutron-mc at risoe.dk
> http://mailman.risoe.dk/mailman/listinfo/neutron-mc
>


-- 
FARHI Emmanuel <farhi at ill.fr>
Groupe DS/CS, ILL4/156, Tel 04 76 20 71 35
ILL, Grenoble




More information about the mcstas-users mailing list