...
Code Block | ||
---|---|---|
| ||
import pyFAI
import scisoftpy as dnp
import scisoftpy.io as dio
ai = pyFAI.AzimuthalIntegrator()
nexusFile = dio.load("/path/to/calibration/nexus/file.nxs")
#Load geometry and energy into PyFAI
px = nexusFile['/entry1/instrument/detector/detector_module/fast_pixel_direction'][...]
bc = [nexusFile['/entry1/instrument/detector/beam_center_x'][...],
nexusFile['/entry1/instrument/detector/beam_center_y'][...]]
distance = nexusFile['/entry1/instrument/detector/distance'][...]
wavelength = nexusFile['/entry1/calibration_sample/beam/incident_wavelength'][...][0]
px = nexusFile['/entry1/instrument/detector/detector_module/fast_pixel_direction'][...]
eub = nexusFile['/entry1/instrument/detector/transformations/euler_b'][...]
euc = nexusFile['/entry1/instrument/detector/transformations/euler_c'][...]
#set
ai.setFit2D(distance, bc[0]/px, bc[1]/px, eub, euc, px*1000., px*1000.0, None)
ai.set_wavelength(wavelength*10e-10);
ai.set_wavelength(energy);
|
...