def MaskRectangle(x_min, x_max, y_min, y_max): masked_pixels = [] for ix in range(x_min, x_max + 1): for iy in range(y_min, y_max + 1): masked_pixels.append([ix, iy]) det_list = hfir_instrument.get_detector_from_pixel(masked_pixels) MaskDetectors(det_list)
def MaskRectangle(x_min, x_max, y_min, y_max): masked_pixels = [] for ix in range(x_min, x_max+1): for iy in range(y_min, y_max+1): masked_pixels.append([ix, iy]) det_list = hfir_instrument.get_detector_from_pixel(masked_pixels) MaskDetectors(det_list)
def _mask_pixels(self, pixel_list, workspace, facility): if len(pixel_list)>0: # Transform the list of pixels into a list of Mantid detector IDs if facility.upper() == "HFIR": masked_detectors = hfir_instrument.get_detector_from_pixel(pixel_list) else: masked_detectors = sns_instrument.get_detector_from_pixel(pixel_list, workspace) # Mask the pixels by passing the list of IDs api.MaskDetectors(Workspace=workspace, DetectorList = masked_detectors)
def _mask_pixels(self, pixel_list, workspace, facility): if len(pixel_list) > 0: # Transform the list of pixels into a list of Mantid detector IDs if facility.upper() == "HFIR": masked_detectors = hfir_instrument.get_detector_from_pixel( pixel_list) else: masked_detectors = sns_instrument.get_detector_from_pixel( pixel_list, workspace) # Mask the pixels by passing the list of IDs api.MaskDetectors(Workspace=workspace, DetectorList=masked_detectors)