[mcstas-users] components Source_simple and Source_gen : parameter "flux"

Peter Kjær Willendrup pkwi at fysik.dtu.dk
Wed May 13 17:02:20 CEST 2020

Dear Thierry,

Comments and answers follow in-line below.

On 13 May 2020, at 16.23, Peter Kjær Willendrup <pkwi at fysik.dtu.dk<mailto:pkwi at fysik.dtu.dk>> wrote:

As I try to get advantage of these special conditions to try and use McStas, I have a beginner's question:

One of my aims is to be sure to have correct orders of magnitude for absolute flux.

I started to use the components Source_simple and Source_gen.
I assume that for the simplest case, the parameters "flux" in Source_simple and "I1" in Source_gen play the same role.
My expectation is that the flux measured by a monitor at a certain distance from the source follows Equation 3.1 in the "McStas 2.6 Component Manual of 24/01/2020", which links the source brilliance with source area, solid angle and wavelength interval.

This is the case with both sources if I set the parameter to 1: with 1 Ang bins, I get a flux on my monitor which scales according to this equation.
Following the component help, this behaviour should be observed by setting the parameter to 0. This in not the case, with 0 as input the calculation gives different flux values, which I am not able to link to anything physical.
The documentation is a bit misleading, because it recommends to put the value to 0 and the default is 1.

in Source_simple:
name:    flux
unit:    1/(s*cm**2*st*energy unit)
description:    flux per energy unit, Angs or meV if flux=0, the source emits 1 in 4*PI whole space.
default:    1

in Source_gen:
name:    I1
unit:    1/(cm**2*sr)
descrption:    Source flux per solid angle, area and Angstrom if I1=0, the source emits 1 in 4*PI whole space.
default:    1

My feeling is that:
- the unit should be in both case as in Source_simple,
- the same sentences would work with "flux=1" and "I1=1", which would be consistent with the default values. I have no idea if the 0 value is useful for some case.

I agree, there is clearly a documentation issue here. :-)

Documentation aside, as far as I can see, the two components behave numerically exactly the same using flux and I1 - see attached instrument where once can select the used source and the intensity as input parameters.

I believe the right documentation sentence should be along the lines of

“Source flux per source area (specified by e.g. xwidth x yheight), per solid angle (specified by dist+ focus_wx x focus_yh), per second (McStas “intensities” always are assumed to be) and per used wavelength/energy interval.”

I think that perhaps the special flux=0 / I1=0 case at least originally was envisioned correspond to setting the flux-unit to unity and “not apply focusing”, but as the documentation is written and how the components in practice works, that special case seems to make no sense. :-)

I will define a GitHub issue to ensure this is rectified in a future release. :-)

Best and thanks for the input,


Peter Kjær Willendrup
Forskningsingeniør, Specialkonsulent
Næstformand for DTU Fysik LSU

DTU Physics

[cid:8cbfc342-2ffb-4ef7-a279-a75e5c753bb1 at win.dtu.dk]

Technical University of Denmark

[cid:c30418ef-1afd-43fd-9f3a-66457eee65a1 at win.dtu.dk]

Department of Physics
Building 307
DK-2800 Kongens Lyngby
Direct +45 2125 4612
Mobil +45 2125 4612
Fax +45 4593 2399
pkwi at fysik.dtu.dk<mailto:pkwi at fysik.dtu.dk>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman2.mcstas.org/pipermail/mcstas-users/attachments/20200513/f36e0248/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.gif
Type: image/gif
Size: 58 bytes
Desc: image001.gif
URL: <http://mailman2.mcstas.org/pipermail/mcstas-users/attachments/20200513/f36e0248/attachment-0002.gif>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image002.gif
Type: image/gif
Size: 1055 bytes
Desc: image002.gif
URL: <http://mailman2.mcstas.org/pipermail/mcstas-users/attachments/20200513/f36e0248/attachment-0003.gif>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: MonInstrumentToutPourri.instr
Type: application/octet-stream
Size: 1483 bytes
Desc: MonInstrumentToutPourri.instr
URL: <http://mailman2.mcstas.org/pipermail/mcstas-users/attachments/20200513/f36e0248/attachment-0001.obj>

More information about the mcstas-users mailing list