HDF5 file, superblock version 0
group /
	attribute HDF5_Version = "1.14.3"
	attribute NeXus_version = "4.4.2"
	attribute creator = "Test_PowderN generated with McStas 3.x-dev - Nov. 22, 2024"
	attribute file_name = "9/mccode.h5"
	attribute file_time = "2024-11-23T02:57:15+01:00"
group /entry1
	attribute NX_class = "NXentry"
	attribute instrument = "Test_PowderN"
	attribute program_name = "McStas 3.x-dev - Nov. 22, 2024"
	attribute simulation = "9/mccode"
group /entry1/data
	attribute NX_class = "NXdetector"
group /entry1/data/PSD_dat
	attribute Date = "Sat Nov 23 02:57:16 2024"
	attribute NX_class = "NXdata"
	attribute Ncount = "10000000"
	attribute Source = "Test_PowderN (Test_Powders.instr)"
	attribute component = "psd_mon"
	attribute filename = "PSD.dat"
	attribute options = "None"
	attribute position = "0.97237 0 10.2334"
	attribute signal = "Min=0; Max=312.153; Mean=17.8616;"
	attribute statistics = "X0=0.114166; dX=1.08524; Y0=-0.017805; dY=1.45064;"
	attribute target = "/entry1/instrument/components/psd_mon/output/PSD_dat"
	attribute title = "PSD monitor"
	attribute type = "array_2d(100, 100)"
	attribute values = "178616 3129.29 8329"
	attribute variables = "I I_err N"
	attribute xlabel = "X position [cm]"
	attribute xvar = "X "
	attribute xylimits = "-4 4 -2.5 2.5"
	attribute ylabel = "Y position [cm]"
	attribute yvar = "Y "
	attribute zlabel = "Signal per bin"
	attribute zvar = "I"
dataset /entry1/data/PSD_dat/X_position__cm_: float64, shape (100)
	attribute axis = 1
	attribute long_name = "X position [cm]"
	attribute primary = 1
	attribute short_name = "X "
	attribute units = "X "
dataset /entry1/data/PSD_dat/Y_position__cm_: float64, shape (100)
	attribute axis = 2
	attribute long_name = "Y position [cm]"
	attribute primary = 1
	attribute short_name = "Y "
	attribute units = "Y "
dataset /entry1/data/PSD_dat/data: float64, shape (100, 100)
	attribute long_name = "data 'PSD monitor'"
	attribute short_name = "PSD.dat"
	attribute signal = 1
dataset /entry1/data/PSD_dat/errors: float64, shape (100, 100)
	attribute long_name = "errors 'PSD monitor'"
dataset /entry1/data/PSD_dat/ncount: float64, shape (100, 100)
	attribute long_name = "ncount 'PSD monitor'"
group /entry1/data/Sphere_dat
	attribute Date = "Sat Nov 23 02:57:16 2024"
	attribute NX_class = "NXdata"
	attribute Ncount = "10000000"
	attribute Source = "Test_PowderN (Test_Powders.instr)"
	attribute component = "Sph_mon"
	attribute filename = "Sphere.dat"
	attribute options = "None"
	attribute position = "0 0 10"
	attribute signal = "Min=0; Max=70529.3; Mean=1544.49;"
	attribute statistics = "X0=-0.0499592; dX=94.6676; Y0=0.448963; dY=43.7441;"
	attribute target = "/entry1/instrument/components/Sph_mon/output/Sphere_dat"
	attribute title = "4PI PSD monitor"
	attribute type = "array_2d(360, 180)"
	attribute values = "1.00083e+08 76216.6 8.94409e+06"
	attribute variables = "I I_err N"
	attribute xlabel = "Longitude [deg]"
	attribute xvar = "Lo"
	attribute xylimits = "-180 180 -90 90"
	attribute ylabel = "Latitude [deg]"
	attribute yvar = "La"
	attribute zlabel = "Signal per bin"
	attribute zvar = "I"
dataset /entry1/data/Sphere_dat/Latitude__deg_: float64, shape (180)
	attribute axis = 2
	attribute long_name = "Latitude [deg]"
	attribute primary = 1
	attribute short_name = "La"
	attribute units = "La"
dataset /entry1/data/Sphere_dat/Longitude__deg_: float64, shape (360)
	attribute axis = 1
	attribute long_name = "Longitude [deg]"
	attribute primary = 1
	attribute short_name = "Lo"
	attribute units = "Lo"
dataset /entry1/data/Sphere_dat/data: float64, shape (360, 180)
	attribute long_name = "data '4PI PSD monitor'"
	attribute short_name = "Sphere.dat"
	attribute signal = 1
dataset /entry1/data/Sphere_dat/errors: float64, shape (360, 180)
	attribute long_name = "errors '4PI PSD monitor'"
dataset /entry1/data/Sphere_dat/ncount: float64, shape (360, 180)
	attribute long_name = "ncount '4PI PSD monitor'"
dataset /entry1/duration: string(1), shape (1)
	text = "1"
dataset /entry1/end_time: string(25), shape (1)
	text = "Sat Nov 23 02:57:16 2024\n"
group /entry1/instrument
	attribute Default_main = "yes"
	attribute Embedded_runtime = "yes"
	attribute NX_class = "NXinstrument"
	attribute Parameters = " comp(int) lambda(double) L1(double) directbeam(int) material(string) SPLITS(int) frac_t(double) sxmos(double) twotheta(double)"
	attribute Source = "Test_Powders.instr"
	attribute Trace_enabled = "yes"
	attribute name = "Test_PowderN"
group /entry1/instrument/components
	attribute NX_class = "NXdata"
	attribute description = "Component list for instrument Test_PowderN"
group /entry1/instrument/components/Beamstop
	attribute NX_class = "NXdata"
dataset /entry1/instrument/components/Beamstop/Position: float64, shape (3)
dataset /entry1/instrument/components/Beamstop/Rotation: float64, shape (3, 3)
group /entry1/instrument/components/Origin
	attribute NX_class = "NXdata"
dataset /entry1/instrument/components/Origin/Position: float64, shape (3)
dataset /entry1/instrument/components/Origin/Rotation: float64, shape (3, 3)
group /entry1/instrument/components/Pow_NCrystal
	attribute NX_class = "NXdata"
dataset /entry1/instrument/components/Pow_NCrystal/Position: float64, shape (3)
dataset /entry1/instrument/components/Pow_NCrystal/Rotation: float64, shape (3, 3)
group /entry1/instrument/components/Pow_PowderN
	attribute NX_class = "NXdata"
dataset /entry1/instrument/components/Pow_PowderN/Position: float64, shape (3)
dataset /entry1/instrument/components/Pow_PowderN/Rotation: float64, shape (3, 3)
group /entry1/instrument/components/Pow_Single_crystal
	attribute NX_class = "NXdata"
dataset /entry1/instrument/components/Pow_Single_crystal/Position: float64, shape (3)
dataset /entry1/instrument/components/Pow_Single_crystal/Rotation: float64, shape (3, 3)
group /entry1/instrument/components/Source
	attribute NX_class = "NXdata"
dataset /entry1/instrument/components/Source/Position: float64, shape (3)
dataset /entry1/instrument/components/Source/Rotation: float64, shape (3, 3)
group /entry1/instrument/components/Sph_mon
	attribute NX_class = "NXdata"
dataset /entry1/instrument/components/Sph_mon/Position: float64, shape (3)
dataset /entry1/instrument/components/Sph_mon/Rotation: float64, shape (3, 3)
group /entry1/instrument/components/Sph_mon/output
	attribute NX_class = "NXdetector"
group or dataset /entry1/instrument/components/Sph_mon/output/Sphere_dat: the same object as one printed elsewhere in this listing
group /entry1/instrument/components/peak_dir
	attribute NX_class = "NXdata"
dataset /entry1/instrument/components/peak_dir/Position: float64, shape (3)
dataset /entry1/instrument/components/peak_dir/Rotation: float64, shape (3, 3)
group /entry1/instrument/components/psd_mon
	attribute NX_class = "NXdata"
dataset /entry1/instrument/components/psd_mon/Position: float64, shape (3)
dataset /entry1/instrument/components/psd_mon/Rotation: float64, shape (3, 3)
group /entry1/instrument/components/psd_mon/output
	attribute NX_class = "NXdetector"
group or dataset /entry1/instrument/components/psd_mon/output/PSD_dat: the same object as one printed elsewhere in this listing
group /entry1/instrument/components/sample_cradle
	attribute NX_class = "NXdata"
dataset /entry1/instrument/components/sample_cradle/Position: float64, shape (3)
dataset /entry1/instrument/components/sample_cradle/Rotation: float64, shape (3, 3)
dataset /entry1/instrument/description: string(6320), shape (1)
	attribute MCCODE_STRING = "McStas 3.x-dev - Nov. 22, 2024"
	attribute file_name = "Test_Powders.instr"
	attribute file_size = "6320"
	text = (text block)
| /*******************************************************************************
| *         McStas instrument definition URL=http://www.mcstas.org
| *
| * Instrument: Test PowderN output
| *
| * %Identification
| * Written by: M. Bertelsen and P. Willendrup
| * Date: November 2024
| * Origin: ESS DMSC
| * %INSTRUMENT_SITE: Tests_samples
| *
| * Test output of PowderN, NCrystal and Single_crystal on a spherical monitor / PSD.
| *
| * %Description
| * A test instrument for Powder output from different sample components.
| *
| * %Example: lambda=2.5 directbeam=0 comp=1 material=Ge SPLITS=1 Detector: Sph_mon_I=3.9e+08
| * %Example: lambda=2.5 directbeam=0 comp=1 material=Ge SPLITS=1 Detector: psd_mon_I=8.3e+05
| * %Example: lambda=2.5 directbeam=0 comp=2 material=Ge SPLITS=1 Detector: Sph_mon_I=3.9e+08
| * %Example: lambda=2.5 directbeam=0 comp=2 material=Ge SPLITS=1 Detector: psd_mon_I=8.3e+05
| * %Example: lambda=2.5 directbeam=0 comp=3 material=Ge SPLITS=1 Detector: Sph_mon_I=3.9e+08
| * %Example: lambda=2.5 directbeam=0 comp=3 material=Ge SPLITS=1 Detector: psd_mon_I=8.3e+05
| * %Example: lambda=2.5 directbeam=0 comp=1 material=Al twotheta=76.5 SPLITS=1 Detector: Sph_mon_I=1.1e+08
| * %Example: lambda=2.5 directbeam=0 comp=1 material=Al twotheta=76.5 SPLITS=1 Detector: psd_mon_I=2e+05
| * %Example: lambda=2.5 directbeam=0 comp=2 material=Al twotheta=76.5 SPLITS=1 Detector: Sph_mon_I=1.1e+08
| * %Example: lambda=2.5 directbeam=0 comp=2 material=Al twotheta=76.5 SPLITS=1 Detector: psd_mon_I=2e+05
| * %Example: lambda=2.5 directbeam=0 comp=3 material=Al twotheta=76.5 SPLITS=1 Detector: Sph_mon_I=1.1e+08
| * %Example: lambda=2.5 directbeam=0 comp=3 material=Al twotheta=76.5 SPLITS=1 Detector: psd_mon_I=2e+05
| * %Example: lambda=2.5 directbeam=0 comp=1 material=LaMnO3 twotheta=80 SPLITS=1 Detector: Sph_mon_I=3.1e+08
| * %Example: lambda=2.5 directbeam=0 comp=1 material=LaMnO3 twotheta=80 SPLITS=1 Detector: psd_mon_I=1.9e+05
| * %Example: lambda=2.5 directbeam=0 comp=2 material=LaMnO3 twotheta=80 SPLITS=1 Detector: Sph_mon_I=3.1e+08
| * %Example: lambda=2.5 directbeam=0 comp=2 material=LaMnO3 twotheta=80 SPLITS=1 Detector: psd_mon_I=1.9e+05
| * %Example: lambda=2.5 directbeam=0 comp=3 material=LaMnO3 twotheta=80 SPLITS=1 Detector: Sph_mon_I=3.1e+08
| * %Example: lambda=2.5 directbeam=0 comp=3 material=LaMnO3 twotheta=80 SPLITS=1 Detector: psd_mon_I=1.9e+05
| * %Example: lambda=2.5 directbeam=0 comp=1 material=NaCl twotheta=78 SPLITS=1 Detector: Sph_mon_I=2.5e+08
| * %Example: lambda=2.5 directbeam=0 comp=1 material=NaCl twotheta=78 SPLITS=1 Detector: psd_mon_I=3.4e+05
| * %Example: lambda=2.5 directbeam=0 comp=2 material=NaCl twotheta=78 SPLITS=1 Detector: Sph_mon_I=2.5e+08
| * %Example: lambda=2.5 directbeam=0 comp=2 material=NaCl twotheta=78 SPLITS=1 Detector: psd_mon_I=3.4e+05
| * %Example: lambda=2.5 directbeam=0 comp=3 material=NaCl twotheta=78 SPLITS=1 Detector: Sph_mon_I=2.5e+08
| * %Example: lambda=2.5 directbeam=0 comp=3 material=NaCl twotheta=78 SPLITS=1 Detector: psd_mon_I=3.4e+05
| *
| * %Parameters
| * comp:          [1] 1=PowderN, 2=Single_crystal, 3=NCrystal
| * lambda:     [Angs] Wavelength emitted from source, 1% wl-interval around.
| * L1:            [m] Source-sample distance
| * directbeam:    [1] Suppress direct beam or not
| * material:    [str] Material string for picking up CIF (PowderN/Single_Crystal) and ncmat (NCrystal)
| * SPLITS:        [1] Number of SPLIT's before sample
| * frac_t:        [1] Fraction of stats assigned to unscattered, "direct beam"
| * sxmos:    [arcmin] Mosaicity to use in Single_crystal case
| * twotheta:    [deg] Angle for 2\theta detector for detailed view
| *
| * %End
| *******************************************************************************/
| DEFINE INSTRUMENT Test_PowderN(int comp=1, lambda=2.5, L1=10, int directbeam=0, string material="Ge", int SPLITS=1, frac_t=0.1, sxmos=60, twotheta=94)
| 
| DECLARE %{
|   char ciffile[128];
|   char ncmatfile[128];
| %}
| 
| /* The INITIALIZE section is executed when the simulation starts     */
| /* (C code). You may use them as component parameter values.         */
| INITIALIZE
| %{
| 
|   if (!strcmp("Ge",material)) {
|     sprintf(ciffile,"Ge.cif");
|     sprintf(ncmatfile,"autogen_Ge_sg227_cod9011050.ncmat");
|   } else if (!strcmp("Al",material)) {
|     sprintf(ciffile,"Al.cif");
|     sprintf(ncmatfile,"autogen_Al_sg225_cod1502689.ncmat");
|   } else if (!strcmp("LaMnO3",material)) {
|     sprintf(ciffile,"LaMnO3.cif");
|     sprintf(ncmatfile,"autogen_LaMnO3_sg62_cod1006141.ncmat");
|   } else if (!strcmp("NaCl",material)) {
|     sprintf(ciffile,"NaCl.cif");
|     sprintf(ncmatfile,"autogen_ClNa_sg225_cod1000041.ncmat");
|   } else {
|     fprintf(stderr,"Material %s not supported\n",material);
|     exit(-1);
|   }
| %}
| 
| /* Here comes the TRACE section, where the actual      */
| /* instrument is defined as a sequence of components.  */
| TRACE
| 
| REMOVABLE COMPONENT Origin = Progress_bar()
|   AT (0,0,0) ABSOLUTE
| 
| /* source with constant flux */
| REMOVABLE COMPONENT Source = Source_gen(
|     radius = 0.11, dist = L1, focus_xw = 0.01, focus_yh = 0.1,
|     lambda0 = lambda, dlambda = lambda*0.01,
|     T1=229.6,I1=5.32e13,T2=1102, I2=4.37e12, T3=437.1,I3=3.84e13)
|   AT (0, 0, 0) RELATIVE Origin
| 
| /* TIP: monochromator cradle */
| SPLIT SPLITS COMPONENT sample_cradle = Arm()
|   AT (0, 0, L1) RELATIVE PREVIOUS
| 
| COMPONENT Pow_PowderN = PowderN(
| 	radius=0.005, yheight=0.1, reflections=ciffile, p_transmit=frac_t)
| WHEN (comp==1)
| AT (0, 0, 0) RELATIVE sample_cradle
| 
| COMPONENT Pow_Single_crystal = Single_crystal(
|     radius=0.005, yheight=0.1, reflections=ciffile, p_transmit=frac_t,
|     powder=1, mosaic=sxmos, order=1, barns=1)
| WHEN (comp==2)
| AT (0, 0, 0) RELATIVE sample_cradle
| 
| COMPONENT Pow_NCrystal = NCrystal_sample(
| 	radius=0.005, yheight=0.1, cfg=ncmatfile)
| WHEN (comp==3)
| AT (0, 0, 0) RELATIVE sample_cradle
| 
|   COMPONENT Beamstop = Beamstop(xwidth=0.015, yheight=0.105)
| WHEN (directbeam==0)
| AT (0, 0, 0.1) RELATIVE sample_cradle
| 
| COMPONENT Sph_mon = PSD_monitor_4PI(nx=360,ny=180, radius=1, restore_neutron=1, filename="Sphere")
|   AT (0, 0, 0) RELATIVE sample_cradle
| 
| COMPONENT peak_dir = Arm()
| AT (0,0,0) RELATIVE sample_cradle
| ROTATED (0, twotheta, 0) RELATIVE sample_cradle
| 
| COMPONENT psd_mon = PSD_monitor(xwidth=0.08, yheight=0.05, nx=100, ny=100, restore_neutron=1, filename="PSD")
| AT (0,0,1) RELATIVE peak_dir
| 
| /* The END token marks the instrument definition end */
| END
dataset /entry1/instrument/instrument_source: string(50), shape (1)
	text = "Test_PowderN McStas neutron Monte Carlo simulation"
dataset /entry1/instrument/name: string(12), shape (1)
	text = "Test_PowderN"
dataset /entry1/program_name: string(30), shape (1)
	text = "McStas 3.x-dev - Nov. 22, 2024"
group /entry1/simulation
	attribute Directory = "9"
	attribute Format = "NeXus"
	attribute Gravitation = "no"
	attribute Instrument = "Test_Powders.instr"
	attribute NX_class = "NXnote"
	attribute Seed = "1000"
	attribute Trace = "no"
	attribute URL = "http://www.mccode.org"
	attribute name = "9/mccode"
	attribute program = "McStas 3.x-dev - Nov. 22, 2024"
dataset /entry1/simulation/Nodes: string(2), shape (1)
	text = "16"
group /entry1/simulation/Param
	attribute L1 = "10"
	attribute NX_class = "NXparameters"
	attribute SPLITS = "1"
	attribute comp = "2"
	attribute directbeam = "0"
	attribute frac_t = "0.1"
	attribute lambda = "2.5"
	attribute material = "Al"
	attribute sxmos = "60"
	attribute twotheta = "76.5"
dataset /entry1/simulation/Param/L1: string(2), shape (1)
	text = "10"
dataset /entry1/simulation/Param/SPLITS: string(1), shape (1)
	text = "1"
dataset /entry1/simulation/Param/comp: string(1), shape (1)
	text = "2"
dataset /entry1/simulation/Param/directbeam: string(1), shape (1)
	text = "0"
dataset /entry1/simulation/Param/frac_t: string(3), shape (1)
	text = "0.1"
dataset /entry1/simulation/Param/lambda: string(3), shape (1)
	text = "2.5"
dataset /entry1/simulation/Param/material: string(2), shape (1)
	text = "Al"
dataset /entry1/simulation/Param/sxmos: string(2), shape (1)
	text = "60"
dataset /entry1/simulation/Param/twotheta: string(4), shape (1)
	text = "76.5"
dataset /entry1/simulation/name: string(6), shape (1)
	text = "mccode"
dataset /entry1/start_time: string(25), shape (1)
	text = "Sat Nov 23 02:57:15 2024\n"
dataset /entry1/title: string(56), shape (1)
	text = "9/mccode simulation generated by instrument Test_PowderN"