Commit 9f1af438 authored by Islam, Fahima's avatar Islam, Fahima
Browse files

Replace Snap.py

parent f55ef639
Loading
Loading
Loading
Loading
+21 −0
Original line number Diff line number Diff line
@@ -9,7 +9,28 @@ def instrument(beam, sample_path, angleMons=[45, 135], detector_width=[0.5, 0.5]
               sourceTosample_z=0., sampleTodetector_z=[0.5, 0.5], number_detectors=2,
               number_pixels_in_height=[256, 256], number_pixels_in_width=[256, 256],
               number_of_box_in_height=[3, 3], number_of_box_in_width=[3, 3]):
    """
        Create an instrument setup for a neutron scattering experiment.

        Parameters:
        beam (str): Path to the beam file.
        sample_path (str): Path to the sample directory.
        angleMons (list of float): List of angles for the monitors in degrees.
        detector_width (list of float): List of widths for the detectors.
        detector_height (list of float): List of heights for the detectors.
        sourceTosample_x (float): X-coordinate distance from source to sample.
        sourceTosample_y (float): Y-coordinate distance from source to sample.
        sourceTosample_z (float): Z-coordinate distance from source to sample.
        sampleTodetector_z (list of float): List of Z-coordinate distances from sample to detectors.
        number_detectors (int): Number of detectors.
        number_pixels_in_height (list of int): List of number of pixels in height for each detector.
        number_pixels_in_width (list of int): List of number of pixels in width for each detector.
        number_of_box_in_height (list of int): List of number of boxes in height for each detector.
        number_of_box_in_width (list of int): List of number of boxes in width for each detector.

        Returns:
        mcvine.instrument: Configured instrument object.
        """
    instrument = mcvine.instrument()
    source = mc.sources.NeutronFromStorage('source', beam)
    instrument.append(source, position=(0,0,0))