McStasMcXtrace / McCode

The home of the McStas (neutrons) and McXtrace (x-rays) Monte-Carlo ray-tracing instrument simulation codes.
https://github.com/McStasMcXtrace/McCode/wiki
GNU General Public License v3.0
78 stars 54 forks source link

McStas: Source_gen file-based input normalisation does not work as advertised #1387

Open willend opened 1 year ago

willend commented 1 year ago

The Source_gen component advertises that

Finally, a file with the flux as a
function of the wavelength [lambda(AA) flux(n/s/cm^2/st/AA)] may be used
with the 'flux_file' parameter. Format is 2 columns free text.

Additional distributions for the horizontal and vertical phase spaces
distributions (position-divergence) may be specified with the
'xdiv_file' and 'ydiv_file' parameters. Format is free text, requiring
a comment line '# xylimits: pos_min pos_max div_min div_max' to set
the axis of the distribution matrix. All these files may be generated using
standard monitors (better in McStas/PGPLOT format), e.g.:
Monitor_nD(options="auto lambda per cm2")
Monitor_nD(options="x hdiv, all auto")
Monitor_nD(options="y vdiv, all auto")

Multiple issues:

willend commented 1 year ago

For an example of a functional setup, see e.g. https://github.com/matteobsu/AMG-Beamlines-McStas/tree/main/BOA where

willend commented 1 year ago

Postponing full resolution until after release of McStas 3.3 - work around by following the recommendations above.