reflection=reflection, spacing_ref=reference_spacing, temperature_ref=reference_temperature, use_q=False, material="Pt", ) ######################### # calculate voxel sizes # ######################### # update the detector angles in setup setup.inplane_angle = bragg_inplane setup.outofplane_angle = bragg_outofplane dz_realspace, dy_realspace, dx_realspace = setup.voxel_sizes( (nb_frames, numy, numx), tilt_angle=setup.tilt_angle, pixel_x=setup.detector.pixelsize_x, pixel_y=setup.detector.pixelsize_y, verbose=True, ) ################################# # plot image at Bragg condition # ################################# plt.figure() plt.imshow(np.log10(abs(data[int(round(z0)), :, :])), vmin=0, vmax=5) plt.title(f"Central slice at frame {int(np.rint(z0))}") plt.colorbar() plt.ioff() plt.show()
else: # data in detector frame setup = Setup( beamline=beamline, energy=energy, outofplane_angle=outofplane_angle, inplane_angle=inplane_angle, tilt_angle=tilt_angle, rocking_angle=rocking_angle, distance=distance, pixel_x=pixel_x, pixel_y=pixel_y, grazing_angle=grazing_angle, ) voxelsize_z, voxelsize_y, voxelsize_x = setup.voxel_sizes( unbinned_shape, tilt_angle=tilt_angle, pixel_x=pixel_x, pixel_y=pixel_y ) newvoxelsize_z, newvoxelsize_y, newvoxelsize_x = setup.voxel_sizes( unbinned_shape, tilt_angle=tilt_angle, pixel_x=pixel_x, pixel_y=pixel_y ) print( "Original voxel sizes zyx (nm):", str("{:.2f}".format(voxelsize_z)), str("{:.2f}".format(voxelsize_y)), str("{:.2f}".format(voxelsize_x)), ) print( "Output voxel sizes zyx (nm):", str("{:.2f}".format(newvoxelsize_z)), str("{:.2f}".format(newvoxelsize_y)),