Skip to content

Commit

Permalink
Add example with azimuthal range
Browse files Browse the repository at this point in the history
  • Loading branch information
viljarjf committed Apr 22, 2024
1 parent 728f3db commit a910c37
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions examples/processing/azimuthal_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,3 +89,27 @@
npt=100, npt_azim=360, inplace=False
).sum().plot()
# %%

# The `azimuth_range`-argument lets you choose what angular range to calculate the azimuthal integral for.
# The range can be increasing, decreasing, and does not need to be a multiple of pi.

nano_crystals.calibrate(center=None)

pol1 = nano_crystals.get_azimuthal_integral2d(npt=100, azimuth_range=(-np.pi, np.pi))

pol2 = nano_crystals.get_azimuthal_integral2d(npt=100, azimuth_range=(0, 1))

pol3 = nano_crystals.get_azimuthal_integral2d(
npt=100, npt_azim=720, azimuth_range=(0, 4 * np.pi)
)

pol4 = nano_crystals.get_azimuthal_integral2d(npt=100, azimuth_range=(np.pi, 0))

hs.plot.plot_images(
[pol1.sum(), pol2.sum(), pol3.sum(), pol4.sum()],
label=["(-pi, pi) default", "(0, 1)", "(0, 4pi)", "(pi, 0)"],
cmap="viridis",
tight_layout=True,
colorbar=None,
)
# %%

0 comments on commit a910c37

Please sign in to comment.