Loading sample_simulation_mcvine/post_processing/post_processing_from_events.pydeleted 100644 → 0 +0 −44 Original line number Diff line number Diff line import numpy as np def compute_xy_from_pixelID(pixelID, start_index, Nx, Ny, xwidth, yheight, dx, dy): """ Compute the (x, y) positions from the given pixelID. Parameters: - pixelID (array or scalar): The pixel index array. - start_index (int): The starting pixel index. - Nx (int): Number of pixels in the x-direction. - Ny (int): Number of pixels in the y-direction. - xwidth (float): Total width of the detector. - yheight (float): Total height of the detector. - dx (float): Pixel size in the x direction. - dy (float): Pixel size in the y direction. Returns: - x (array or scalar): Computed x positions. - y (array or scalar): Computed y positions. """ # Compute xindex and yindex xindex = (pixelID - start_index) // Ny yindex = (pixelID - start_index) % Ny # Compute x and y positions x = xindex * dx - (xwidth / 2) y = yindex * dy - (yheight / 2) return x, y # # Example Usage: # pixelID = np.array([100, 200, 300, 400]) # Example pixel IDs # start_index = 0 # Nx = 8 # Example: Number of x pixels # Ny = 128 # Example: Number of y pixels # xwidth = 0.21 # yheight = 0.834 # dx = 0.021 # dy = 0.0064 # # # Compute x, y # x, y = compute_xy_from_pixelID(pixelID, start_index, Nx, Ny, xwidth, yheight, dx, dy) # print("x:", x) # print("y:", y) No newline at end of file Loading
sample_simulation_mcvine/post_processing/post_processing_from_events.pydeleted 100644 → 0 +0 −44 Original line number Diff line number Diff line import numpy as np def compute_xy_from_pixelID(pixelID, start_index, Nx, Ny, xwidth, yheight, dx, dy): """ Compute the (x, y) positions from the given pixelID. Parameters: - pixelID (array or scalar): The pixel index array. - start_index (int): The starting pixel index. - Nx (int): Number of pixels in the x-direction. - Ny (int): Number of pixels in the y-direction. - xwidth (float): Total width of the detector. - yheight (float): Total height of the detector. - dx (float): Pixel size in the x direction. - dy (float): Pixel size in the y direction. Returns: - x (array or scalar): Computed x positions. - y (array or scalar): Computed y positions. """ # Compute xindex and yindex xindex = (pixelID - start_index) // Ny yindex = (pixelID - start_index) % Ny # Compute x and y positions x = xindex * dx - (xwidth / 2) y = yindex * dy - (yheight / 2) return x, y # # Example Usage: # pixelID = np.array([100, 200, 300, 400]) # Example pixel IDs # start_index = 0 # Nx = 8 # Example: Number of x pixels # Ny = 128 # Example: Number of y pixels # xwidth = 0.21 # yheight = 0.834 # dx = 0.021 # dy = 0.0064 # # # Compute x, y # x, y = compute_xy_from_pixelID(pixelID, start_index, Nx, Ny, xwidth, yheight, dx, dy) # print("x:", x) # print("y:", y) No newline at end of file