[neutron-mc] Generate a source spectra from exp. file

Emmanuel Farhi farhi at ill.fr
Wed Aug 27 11:07:42 CEST 2003


Yes, there is a solution to use an experimental profile for the
simulation source.

First position a normal source (Source_flat or Source_gen, or ...).
Then, you may use the Filter_gen component (in the optics) to read the
contents a a file, with options="lambda, set weight". Then the first
column of the table is assumed to be the wavelength, and the second
should be the flux to set.
A rebinning/interpolation is done when loading the table. This will set
the weight of neutrons. You may also choose to multiply or add to the
existing weight.
The Filter_gen (McStas v1.7) is a replacement to the old Flux_adapter.

Just look at the MCSTASLIB/optics/Filter_gen component (or 'mcdoc
Filter_gen').

pwilk wrote:

> Thanks for the quick reply! I'll give that a go.I think you are right
> about the zero velocity neutrons.I have another quick question for
> you: Is there an easy way to simulate a source from a 2D file of
> (measured) Intensity vs. Wavelength ?Cheers,Philip
>
>      -----Original Message-----
>      From: farhi at ill.fr [mailto:farhi at ill.fr]
>      Sent: Tuesday, August 26, 2003 3:18 PM
>      To: pwilk-radiochem at hahnium.com; neutron-mc at risoe.dk
>      Subject: Re: sqrt: DOMAIN error
>      Hy Philip,
>
>      You probably have some zero velocity neutrons or such huge
>      velocities that the square gets hawfull (before getting the
>      sqrt), else I can not figure out how the 'sqrt' can fail in
>      the speed in L_monitor.comp.
>      You may copy this component locally and change the line #76
>      so that it tests the speed norm to be non zero or reasonable
>      value (not huge).
>
>      You may also try replacing with the Monitor_nD(options="auto
>      lambda", filename="...")
>
>      Cheers, Emmanuel.
>
>      Philip Wilk wrote:
>
>     > Hi,
>     >
>     > I am using the new version 1.7
>     >
>     > I keep getting "sqrt: DOMAIN error"
>     >
>     > Just like I was getting with version 1.6.4 , should I be
>     > worried about this?
>     > It seems to be associated with the wavelength detector
>     > component.
>     >
>     > See example output:
>     >
>     > Detector: psd_begin_I=75.9887 psd_begin_ERR=0.0701353
>     > psd_begin_N=3.65191e+06 "p
>     > sd1.dat"
>     > Detector: lambda_begin_I=75.9887
>     > lambda_begin_ERR=0.0701353
>     > lambda_begin_N=3.651
>     > 91e+06 "erg1.dat"
>     > Detector: psd_middle_I=6.2552 psd_middle_ERR=0.017862
>     > psd_middle_N=1.68387e+06 "
>     > psd2.dat"
>     >
>     > sqrt: DOMAIN error
>     > Detector: lambda_middle_I=6.2552
>     > lambda_middle_ERR=0.017862
>     > lambda_middle_N=1.68
>     > 387e+06 "erg2.dat"
>     > Detector: psd_middle2_I=1.20321 psd_middle2_ERR=0.00418768
>     >
>     > psd_middle2_N=1.08584
>     > e+06 "psd3.dat"
>     > Detector: lambda_middle2_I=1.20321
>     > lambda_middle2_ERR=0.00418768
>     > lambda_middle2_
>     > N=1.08584e+06 "erg3.dat"
>     > Detector: psd_end_I=0.65266 psd_end_ERR=0.002805
>     > psd_end_N=389221 "psd4.dat"
>     > Detector: lambda_end_I=0.65266 lambda_end_ERR=0.002805
>     > lambda_end_N=389221
>     > "erg4
>     > .dat"
>     >
>     > Cheers,
>     > Philip
>
>      --
>      What's up Doc ?
>      --------------------------------------------
>      Emmanuel FARHI, http://www.ill.fr/tas/people/Farhi.html   \|/ ____ \|/
>      CS-Group ILL4/156, 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 20 76 48     \__U_/
>
>
>
--
What's up Doc ?
--------------------------------------------
Emmanuel FARHI, http://www.ill.fr/tas/people/Farhi.html   \|/ ____ \|/
CS-Group ILL4/156, 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 20 76 48     \__U_/


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman2.mcstas.org/pipermail/mcstas-users/attachments/20030827/a1da57c4/attachment.html>


More information about the mcstas-users mailing list