Plot Helpers

Some helper functions for easy plotting.

class angcal.PlotHelper(mythendetector, angular_range, histogram_bin_width)

Helper class for plotting diffraction patterns.

property overwrite_plot
plot_diffraction_pattern(photon_counts: ndarray, module_index=None, motor_position=None, axis=None)

Plot diffraction pattern.

Parameters:
  • photon_counts (numpy.ndarray) – 1D photon-count array.

  • module_index (int, optional) – Module index to restrict the plotted range.

  • motor_position (float, optional) – Detector motor position in degrees.

  • axis (matplotlib.axes.Axes, optional) – Axis to plot on. If None, a new figure will be created.

plot_base_peak(photon_counts: ndarray, base_peak_angle: float, base_peak_width: float, module_index=None, axis=None)

Plot the base-peak ROI.

Parameters:
  • photon_counts (numpy.ndarray) – 1D photon-count array.

  • base_peak_angle (float) – Base peak angle in degrees.

  • base_peak_width (float) – Base peak width in degrees.

  • module_index (int, optional) – Module index for title/selection.

  • axis (matplotlib.axes.Axes, optional) – Axis to plot on. If None, a new figure will be created.

angcal.utils.select_base_peak(anglecalibration, mythen_file_reader, filelist: list[str], module_index=0)

select base peak by plotting module 0 redistributed to fixed angle-width bins for each frame in filelist with a detector angle between 6° and 33°