[mcstas-users] logarithmic binning detector

Robert Dalgliesh - STFC UKRI robert.dalgliesh at stfc.ac.uk
Thu Jan 22 13:04:44 CET 2026


Hi Markus,
I can’t use the built in q monitors because they don’t take account of time-of-flight.
I’m writing monitors that essentially perform a TOF data reduction in mcstas to remove the step where you have to push the data through e.g. Mantid.

This route is much more efficient as it doesn’t result in large event mode files but relies on you not using the fact that mcstas inherently knows the direction of travel and wavelength of the neutron.
The downside is that you run into this sort of problem and you have to do a bunch of geometry calculations to work out where pixels are in real space.

That being said I can possibly use the output routines from monitor_nd….
I’ll take a look

Thanks for the reply

Rob


From: Markus APPEL <appel at ill.fr>
Sent: 22 January 2026 08:27
To: Dalgliesh, Robert (STFC,RAL,ISIS) <robert.dalgliesh at stfc.ac.uk>; mcstas-users at mcstas.org
Subject: Re: [mcstas-users] logarithmic binning detector

Hi Rob,
not sure if it's what you want to achieve, but would it not be easier to monitor log10(Q) with limits from -3 to 0 and 90 linear bins?
That should be simple with Monitor_nD and user variables (see section 9.8.7 of the Component Manual):
COMPONENT QMonitor = Monitor nD ( user1=log10(Q) , username1=”Log (Q)” , ....)

Unless that's what you wanted to avoid for some reason.

Best,
Markus

On 21/01/2026 13:09, Robert Dalgliesh - STFC UKRI via mcstas-users wrote:
Hi,
If I want to create a new detector with logarithmic binning is there an easy way to export the x array?
The way DETECTOR_OUT_1D works requires the binning scheme to be linear.

I would like to define e.g. q bins
1e-3 to 1.0 with 8% binning so the bins are

[a,ab,ab^2,….] where a=1e-3 and b=1.08.

Working out which bin to put data into is straightforward in the same way as linear bins but data output isn’t, due to the constraints of the function above.
In addition, the read function for mcstas plotting would need modification so I guess it will mean an additional function is required unless I’ve missed something.

Obviously, I can write something that outputs the data and post process the x array but that’s not ideal.

Rob



====================================================================
If you receive this email outside working hours then please do not feel obliged to reply
====================================================================
Dr. Robert Dalgliesh
Small Angle Scattering Group Leader
ISIS Neutron and Muon Source
Science and Technology Facilities Council
Building R3 1.29,
Rutherford Appleton Laboratory​​,
​Harwell Campus,
Didcot
​Oxfordshire,
OX11 0QX.
UK
Tel: +44(0)1235-445687
Email: Robert.dalgliesh at stfc.ac.uk<mailto:Robert.dalgliesh at stfc.ac.uk>




_______________________________________________

mcstas-users mailing list

mcstas-users at mcstas.org<mailto:mcstas-users at mcstas.org>

https://mailman2.mcstas.org/mailman/listinfo/mcstas-users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman2.mcstas.org/pipermail/mcstas-users/attachments/20260122/dc159cec/attachment-0001.htm>


More information about the mcstas-users mailing list