Right detector:
       Same orientation of tubes, same size of pixels
       Only 96 tubes instead of 128 tubes in the main detector

       For more information, please visit
       https://www.ill.eu/instruments-support/instruments-groups/instruments/d22/characteristics/
       """
d22 = MantidGeom(instrumentName, comment=comment, valid_from=validFrom)
d22.addSnsDefaults(default_view='3D',axis_view_3d='z-')
d22.addComment("SOURCE")
d22.addComponentILL("moderator", 0., 0., moderator_source, "Source")
d22.addComment("Sample position")
d22.addComponentILL("sample_position", 0., 0., 0., "SamplePos")
d22.addComment("MONITORS")
d22.addMonitors(names=["monitor1", "monitor2"], distance=[zMon1, zMon2])
d22.addComment("MONITOR SHAPE")
d22.addDummyMonitor(0.01, 0.03)
d22.addComment("MONITOR IDs")
d22.addMonitorIds([repr(100000), repr(100001)])
d22.addComment("DETECTOR")
d22.addComponentILL("detector", 0., 0., 0.)
detector = d22.makeTypeElement("detector")
d22.addComponentRectangularDetector(detector0, 0., 0., zPos, idstart=id0, idfillbyfirst=FF, idstepbyrow=SR, root=detector)
d22.addComponentRectangularDetector(detector1, -right_center_offset, 0., zPos-z_gap, idstart=id1, idfillbyfirst=FF, idstepbyrow=SR, root=detector)
d22.addRectangularDetector(detector0, pixelName, xstart, xstep, xpixels, ystart, ystep, ypixels)
d22.addRectangularDetector(detector1, pixelName, xstart_right, xstep, xpixels_right, ystart, ystep, ypixels)
d22.addComment("PIXEL, EACH PIXEL IS A DETECTOR")
d22.addCuboidPixel(pixelName, [-x, -y, thickness/2.], [-x, y, thickness/2.], [-x, -y, -thickness/2.], [x, -y, thickness/2.], shape_id="pixel-shape")
d22.writeGeom("./ILL/IDF/" + instrumentName + "_Definition.xml")
       For more information, please visit
       https://www.ill.eu/instruments-support/instruments-groups/instruments/figaro/characteristics/
       """
figaro = MantidGeom(instrumentName, comment=comment, valid_from=validFrom)
figaro.addSnsDefaults(theta_sign_axis='y')
figaro.addComment("SOURCE")
figaro.addComponentILL("chopper1", 0.0, 0.0, zSource, "Source")
figaro.addComment("Sample position")
figaro.addComponentILL("sample_position", 0.0, 0.0, 0.0, "SamplePos")
figaro.addComment("MONITORS")
figaro.addMonitors(names=["monitor1", "monitor2"], distance=[zMon1, zMon2])
figaro.addComment("MONITOR SHAPE")
figaro.addComment("FIXME: Do something real here.")
figaro.addDummyMonitor(0.01, 0.03)
figaro.addComment("MONITOR IDs")
figaro.addMonitorIds(["100000", "100001"])
figaro.addComment("2 Slits")
figaro.addComponentILL("slit2", 0.0, 0.0, slit2Centre)
figaro.makeTypeElement("slit2")
figaro.addComponentILL("slit3", 0.0, 0.0, slit3Centre)
figaro.makeTypeElement("slit3")
figaro.addComment("DETECTORS")
figaro.addComment("64 tubes form the detector")
figaro.addComponentRectangularDetector("detector", 0.0, 0.0, zDetector, idstart="1", idfillbyfirst="x",
                                    idstepbyrow="1")
figaro.addComment("PIXEL, EACH PIXEL IS A DETECTOR")
figaro.addRectangularDetector("detector", "pixel", xstart, xstep, xpixels, ystart, ystep, ypixels)
figaro.addCuboidPixel("pixel", [-x, -y, z], [x, y, z], [-x, -y, -z], [x, -y, z], shape_id="pixel-shape")
figaro.writeGeom("./ILL/IDF/" + instrumentName.upper() + "_Definition.xml")
Example #3
0
                                    extra_attrs={"is":"rectangular_detector", "type":"pixel_v3",
                                                 "xpixels":x_num3, "xstart":x_offset3, "xstep":x_delta3,
                                                 "ypixels":y_num3, "ystart":y_offset3, "ystep":y_delta3
                                                 })
        le.SubElement(det, "properties")

    # shape for monitors
    instr.addComment(" Shape for Monitors")
    instr.addComment(" TODO: Update to real shape ")
    instr.addDummyMonitor(0.01, .03)

    # shape for detector pixels
    instr.addComment(" Pixel for Version 2 Detectors (7x154)")
    instr.addCuboidPixel("pixel_v2", 
                         [-.5*x_delta2, -.5*y_delta2,  0.0],
                         [-.5*x_delta2,  .5*y_delta2,  0.0],
                         [-.5*x_delta2, -.5*y_delta2, -0.0001],
                         [ .5*x_delta2, -.5*y_delta2,  0.0],
                         shape_id="pixel-shape")
    if len(v3_panels) > 0:
        instr.addComment(" Pixel for Version 3 Detectors (16x308)")
        instr.addCuboidPixel("pixel_v3", 
                             [-.5*x_delta3, -.5*y_delta3,  0.0],
                             [-.5*x_delta3,  .5*y_delta3,  0.0],
                             [-.5*x_delta3, -.5*y_delta3, -0.0001],
                             [ .5*x_delta3, -.5*y_delta3,  0.0],
                             shape_id="pixel-shape")

    # monitor ids
    instr.addComment("MONITOR IDs")
    instr.addMonitorIds([-1]) # TODO [-1,-2,-3]
    instr.addComment("SAMPLE")
    instr.addSamplePosition()

    instr.addComment("MONITORS")
    instr.addMonitors(distance=[-2.935, -0.898, 1.042],
                      names=["monitor1", 'monitor2', 'monitor3'])

    # add banks here
    for bank in detcal.banks:
        bank.addToXml(instr)

    # shape for detector pixels - ignored by required
    instr.addComment(' Pixel for Detectors')
    delta = 0.000309
    instr.addCuboidPixel("pixel", [-delta, -delta, 0.0], [-delta, delta, 0.0],
                         [-delta, -delta, -0.0001], [delta, -delta, 0.0],
                         shape_id="pixel-shape")

    instr.addComment(" Shape for Monitors")
    instr.addComment(" TODO: Update to real shape ")
    instr.addDummyMonitor(0.01, .03)

    instr.addComment("MONITOR IDs")
    instr.addMonitorIds([-1, -2, -3])

    instr.writeGeom(filename)

    # write the parameter file
    filename = filename.replace('Definition', 'Parameters')
    param_contents = parameters_template.format(validfrom=valid_from,
                                                T0=detcal.t0)
Example #5
0
    # Pixel Width
    x_pixel_offset = file["/entry/instrument/bank1/x_pixel_offset"].value
    pixel_xsize = x_pixel_offset[1] - x_pixel_offset[0]


    # Lets just make them bigger for a moment so we can see them
    pixel_xsize *= 5.0
    pixel_ysize *= 2.0

    # arbitary value plucked from thin air!
    detector_depth = 0.01

    left_front_bottom = ((-pixel_xsize/2.0), (-pixel_ysize/2.0), 0.0)
    left_front_top = ((-pixel_xsize/2.0), (pixel_ysize/2.0), 0.0)
    left_back_bottom = ((-pixel_xsize/2.0), (-pixel_ysize/2.0), -detector_depth)
    right_front_bottom = ((pixel_xsize/2.0), (-pixel_ysize/2.0), 0.0)

    det.addComment("PIXEL")
    det.addCuboidPixel("pixel", left_front_bottom, left_front_top, left_back_bottom, right_front_bottom, "detector")

    det.addComment("MONITOR SHAPE")
    det.addComment("FIXME: Do something real here.")
    det.addDummyMonitor(0.01, 0.03)

    det.addComment("MONITOR IDs")
    det.addMonitorIds(["-1"])

    det.showGeom()
    det.writeGeom(xml_outfile)
Example #6
0
d33.addComponentRectangularDetector(detector4,
                                    0.,
                                    dR + dF,
                                    zFront,
                                    idstart=id4,
                                    idfillbyfirst="x",
                                    idstepbyrow=STB,
                                    rotz=90.,
                                    root=front_detector)
d33.addComment("REAR DETECTOR")
d33.addRectangularDetector(detector0, pixel, xstartb, xstepb, xpixelsb,
                           ystartb, ystepb, ypixelsb)
d33.addComment("4 FRONT DETECTORS, from detector to sample in +Z direction")
d33.addComment("RIGHT")
d33.addRectangularDetector(detector1, pixel, xstartlr, xsteplr, xpixelslr,
                           ystartlr, ysteplr, ypixelslr)
d33.addComment("LEFT")
d33.addRectangularDetector(detector2, pixel, xstartlr, xsteplr, xpixelslr,
                           ystartlr, ysteplr, ypixelslr)
d33.addComment("BOTTOM")
d33.addRectangularDetector(detector3, pixel, xstarttb, xsteptb, xpixelslr,
                           ystartlr, ysteplr, ypixelslr)
d33.addComment("TOP")
d33.addRectangularDetector(detector4, pixel, xstarttb, xsteptb, xpixelslr,
                           ystartlr, ysteplr, ypixelslr)
d33.addComment("PIXEL, EACH PIXEL IS A DETECTOR")
d33.addCuboidPixel(pixel, [-x, -y, thickness / 2.], [-x, y, thickness / 2.],
                   [-x, -y, -thickness / 2.], [x, -y, -thickness / 2.],
                   shape_id="pixel-shape")
d33.writeGeom("./ILL/IDF/" + instrumentName + "_Definition.xml")
figaro.addComment("Sample position")
figaro.addComponentILL("sample_position", 0.0, 0.0, 0.0, "SamplePos")
figaro.addComment("MONITORS")
figaro.addMonitors(names=["monitor1", "monitor2"], distance=[zMon1, zMon2])
figaro.addComment("MONITOR SHAPE")
figaro.addComment("FIXME: Do something real here.")
figaro.addDummyMonitor(0.01, 0.03)
figaro.addComment("MONITOR IDs")
figaro.addMonitorIds(["100000", "100001"])
figaro.addComment("2 Slits")
figaro.addComponentILL("slit2", 0.0, 0.0, slit2Centre)
figaro.makeTypeElement("slit2")
figaro.addComponentILL("slit3", 0.0, 0.0, slit3Centre)
figaro.makeTypeElement("slit3")
figaro.addComment("DETECTORS")
figaro.addComment("64 tubes form the detector")
figaro.addComponentRectangularDetector("detector",
                                       0.0,
                                       0.0,
                                       zDetector,
                                       idstart="1",
                                       idfillbyfirst="x",
                                       idstepbyrow="1")
figaro.addComment("PIXEL, EACH PIXEL IS A DETECTOR")
figaro.addRectangularDetector("detector", "pixel", xstart, xstep, xpixels,
                              ystart, ystep, ypixels)
figaro.addCuboidPixel("pixel", [-x, -y, z], [x, y, z], [-x, -y, -z],
                      [x, -y, z],
                      shape_id="pixel-shape")
figaro.writeGeom("./ILL/IDF/" + instrumentName.upper() + "_Definition.xml")
       Size 1024 mm x 1024 mm
       Nominal resolution:
            128 x 256
            Pixel size 8 x 4 mm2
       Low resolution:
            128 x 128
            Pixel size 8 x 8 mm2

       For more information, please visit
       https://www.ill.eu/instruments-support/instruments-groups/instruments/d22/characteristics/
       """
d22 = MantidGeom(instrumentName, comment=comment, valid_from=validFrom)
d22.addSnsDefaults()
d22.addComment("SOURCE")
d22.addComponentILL("moderator", 0., 0., moderator_source, "Source")
d22.addComment("Sample position")
d22.addComponentILL("sample_position", 0., 0., 0., "SamplePos")
d22.addComment("MONITORS")
d22.addMonitors(names=["monitor1", "monitor2"], distance=[zMon1, zMon2])
d22.addComment("MONITOR SHAPE")
d22.addComment("FIXME: Do something real here.")
d22.addDummyMonitor(0.01, 0.03)
d22.addComment("MONITOR IDs")
d22.addMonitorIds([repr(100000), repr(100001)])
d22.addComment("DETECTOR")
d22.addComponentRectangularDetector(detector0, 0., 0., zPos, idstart=id0, idfillbyfirst=FF, idstepbyrow=SR)
d22.addRectangularDetector(detector0, pixelName, xstart, xstep, xpixels, ystart, ystep, ypixels)
d22.addComment("PIXEL, EACH PIXEL IS A DETECTOR")
d22.addCuboidPixel(pixelName, [-x, -y, z], [x, y, z], [-x, -y, thickness], [x, -y, z], shape_id="pixel-shape")
d22.writeGeom("./ILL/IDF/" + instrumentName + "_Definition.xml")
Example #9
0
salsa.addComponentILL("monochromator", 0., 0., zSource, "Source")

# Sample is set as the origin
salsa.addComment("Sample position")
salsa.addComponentILL("sample_position", 0., 0., 0., "SamplePos")

salsa.addComment("MONITORS")
salsa.addMonitors(names=["monitor"], distance=[zMonitor])
salsa.addComment("MONITOR SHAPE")
salsa.addDummyMonitor(0.01, 0.01)
salsa.addComment("MONITOR IDs")
salsa.addMonitorIds([repr(256 * 256)])

salsa.addComment("DETECTOR")
salsa.addRectangularDetector(detector0, pixelName, xstart, xstep, xpixels,
                             ystart, ystep, ypixels)
salsa.addComponentRectangularDetector(detector0,
                                      0.,
                                      0.,
                                      zDetector,
                                      idstart=id0,
                                      idfillbyfirst=FF,
                                      idstepbyrow=SR)

salsa.addComment("PIXEL, EACH PIXEL IS A DETECTOR")
salsa.addCuboidPixel(pixelName, [-x, -y, z], [-x, y, z], [-x, -y, -z],
                     [x, -y, -z],
                     shape_id="pixel-shape")

salsa.writeGeom(instrumentName + "_Definition.xml")
Example #10
0
                                        "ypixels": y_num3,
                                        "ystart": y_offset3,
                                        "ystep": y_delta3
                                    })
        le.SubElement(det, "properties")

    # shape for monitors
    instr.addComment(" Shape for Monitors")
    instr.addComment(" TODO: Update to real shape ")
    instr.addDummyMonitor(0.01, .03)

    # shape for detector pixels
    instr.addComment(" Pixel for Version 2 Detectors (7x154)")
    instr.addCuboidPixel("pixel_v2", [-.5 * x_delta2, -.5 * y_delta2, 0.0],
                         [-.5 * x_delta2, .5 * y_delta2, 0.0],
                         [-.5 * x_delta2, -.5 * y_delta2, -0.0001],
                         [.5 * x_delta2, -.5 * y_delta2, 0.0],
                         shape_id="pixel-shape")
    if len(v3_panels) > 0:
        instr.addComment(" Pixel for Version 3 Detectors (16x308)")
        instr.addCuboidPixel("pixel_v3", [-.5 * x_delta3, -.5 * y_delta3, 0.0],
                             [-.5 * x_delta3, .5 * y_delta3, 0.0],
                             [-.5 * x_delta3, -.5 * y_delta3, -0.0001],
                             [.5 * x_delta3, -.5 * y_delta3, 0.0],
                             shape_id="pixel-shape")

    # monitor ids
    instr.addComment("MONITOR IDs")
    instr.addMonitorIds([-1])  # TODO [-1,-2,-3]

    # write out the file
Example #11
0
       For more information, please visit
       https://www.ill.eu/instruments-support/instruments-groups/instruments/d17/characteristics/
       """
d17 = MantidGeom(instrumentName, comment=comment, valid_from=validFrom)
d17.addSnsDefaults(theta_sign_axis='x')
d17.addComment("SOURCE")
d17.addComponentILL("chopper1", 0.0, 0.0, chop1_source, "Source")
d17.addComment("Sample position")
d17.addComponentILL("sample_position", 0.0, 0.0, 0.0, "SamplePos")
d17.addComment("MONITORS")
d17.addMonitors(names=["monitor1", "monitor2"], distance=[zMon1, zMon2])
d17.addComment("MONITOR SHAPE")
d17.addComment("FIXME: Do something real here.")
d17.addDummyMonitor(0.01, 0.03)
d17.addComment("MONITOR IDs")
d17.addMonitorIds(["100000", "100001"])
d17.addComment("2 Slits")
d17.addComponentILL("slit2", 0.0, 0.0, slit2Centre)
d17.makeTypeElement("slit2")
d17.addComponentILL("slit3", 0.0, 0.0, slit3Centre)
d17.makeTypeElement("slit3")
d17.addComment("DETECTORS")
d17.addComment("64 TUBES FORM ONE DETECTOR")
d17.addComponentRectangularDetector("detector", 0.0, 0.0, detValue, idstart="1", idfillbyfirst="x",
                                    idstepbyrow="1")
d17.addComment("PIXEL, EACH PIXEL IS A DETECTOR")
d17.addRectangularDetector("detector", "pixel", xstart, xstep, xpixels, ystart, ystep, ypixels)
d17.addCuboidPixel("pixel", [-x, -y, z], [x, y, z], [-x, -y, thickness], [x, -y, z], shape_id="pixel-shape")
d17.writeGeom("./ILL/IDF/" + instrumentName + "_Definition.xml")
Example #12
0
    # Pixel Width
    x_pixel_offset = file["/entry/instrument/bank1/x_pixel_offset"].value
    pixel_xsize = x_pixel_offset[1] - x_pixel_offset[0]

    # Lets just make them bigger for a moment so we can see them
    pixel_xsize *= 5.0
    pixel_ysize *= 2.0

    # arbitary value plucked from thin air!
    detector_depth = 0.01

    left_front_bottom = ((-pixel_xsize / 2.0), (-pixel_ysize / 2.0), 0.0)
    left_front_top = ((-pixel_xsize / 2.0), (pixel_ysize / 2.0), 0.0)
    left_back_bottom = ((-pixel_xsize / 2.0), (-pixel_ysize / 2.0),
                        -detector_depth)
    right_front_bottom = ((pixel_xsize / 2.0), (-pixel_ysize / 2.0), 0.0)

    det.addComment("PIXEL")
    det.addCuboidPixel("pixel", left_front_bottom, left_front_top,
                       left_back_bottom, right_front_bottom, "detector")

    det.addComment("MONITOR SHAPE")
    det.addComment("FIXME: Do something real here.")
    det.addDummyMonitor(0.01, 0.03)

    det.addComment("MONITOR IDs")
    det.addMonitorIds(["-1"])

    det.showGeom()
    det.writeGeom(xml_outfile)
Example #13
0
    idstart=id2,
    idfillbyfirst="y",
    idstepbyrow=str(number_of_pixels_per_tube),
    root=detector)
d11b.addComment("CENTER DETECTOR")
d11b.addRectangularDetector(detector0, pixel_center, xstart, xstep, xpixels,
                            ystart, ystep, ypixels)
d11b.addComment("LEFT")
d11b.addRectangularDetector(detector1, pixel_panels, xstart_left, xstep_left,
                            xpixels_left, ystart_left, ystep_left,
                            ypixels_left)
d11b.addComment("RIGHT")
d11b.addRectangularDetector(detector2, pixel_panels, xstart_right, xstep_right,
                            xpixels_right, ystart_right, ystep_right,
                            ypixels_right)
# here x and y are swapped
x = center_pixel_x
y = center_pixel_y
d11b.addCuboidPixel(pixel_center, [-x, -y, thickness / 2.],
                    [-x, y, thickness / 2.], [-x, -y, -thickness / 2.],
                    [x, -y, -thickness / 2.],
                    shape_id=pixel_center)
# for the panels we swap them back again
x = center_pixel_y
y = center_pixel_x
d11b.addCuboidPixel(pixel_panels, [-x, -y, thickness / 2.],
                    [-x, y, thickness / 2.], [-x, -y, -thickness / 2.],
                    [x, -y, -thickness / 2.],
                    shape_id=pixel_panels)
d11b.writeGeom("./ILL/IDF/" + instrument_name + "_Definition.xml")