Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagepy
reader = NexusMetaReader(r"Path/To/Your/Calibration/File.nxs")
meta = reader.getDiffractionMetadataFromNexus(None)
if (not reader.isPartialRead()):
    sys.exit("no metadata in file")
    
#Load image data
data = dnp.io.load(r"Path/To/Your/Data.tiff")['image_name'][...]

#Create object to do integration [In this case pixel split](metadata, then number of bins)
integrator = PSI(meta, 2000)
#integrator = NPSI(meta, 2000)
#integrator = PSI2D(meta, 2000, 360)

###
# 1D Azimuthal
###

#For full image, integrating azimuthally, in q only need to call
out = integrator.integrate(data._jdataset())
#out[0] is axis, out[1] is intensity
dnp.plot.line(out[0],out[1], name="Plot 1", title = "Full Image - non split")

 Other options can be explored using methods on the integrator object or in the PixelIntegrationUtils class.