McCode icon indicating copy to clipboard operation
McCode copied to clipboard

Suppress plotting of list mode data

Open willend opened this issue 2 years ago • 3 comments

There is often very little physical meaning in plots of "event data" from Monitor_nD, it also happens very often that the data become very big and hence take long time to load.

I therefore propose to avoid writing a data-section to mccode.sim in such cases, simply by adding an if-statement to the detector_out_2d() function:

        /* If this is list mode we suppress the mccode.sim entry*/
	if (!strcasestr(detector.format, "list")) {
	  /* Write data set information to simulation description file. */
	  siminfo_out("\nbegin data\n"); // detector.filename
	  mcdatainfo_out("  ", siminfo_file, detector);
	  siminfo_out("end data\n");
	} 

Implemented this way, output to Mantid/NeXus is unaffected and we avoid plotting in the ASCII case.

willend avatar May 06 '22 09:05 willend

An exception where this solution seems not to work perfectly is when

options="multiple list ..."
  • entrypoint to the plotting logic apparently lives elsewhere...

willend avatar May 06 '22 09:05 willend

The other solution is to detect the 'list' type in the header/metadata, and not plot it. Removing all the metadata from the generated file brings a raw list of numbers which are not anymore self explanatory.

farhi avatar May 07 '22 07:05 farhi

The solution proposed does in fact not suppress all metadata, it simply removes the corresponding Data section in mccode.sim. The actual event file remains including all content.

willend avatar May 08 '22 16:05 willend

Related to #292 and #1150

farhi avatar Nov 08 '22 16:11 farhi