Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

PFEnergySeriesIntegrator bug: fix #125 #126

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/PyHyperScattering/PFGeneralIntegrator.py
Original file line number Diff line number Diff line change
Expand Up @@ -474,6 +474,12 @@ def calibrationFromTemplateXRParams(self, raw_xr):
if self.mask is None:
self.mask = np.zeros((len(raw_xr.pix_y),len(raw_xr.pix_x)))
warnings.warn(f'Since mask was none, creating an empty mask with shape {self.mask.shape}',stacklevel=2)

if hasattr(raw_xr.energy, '__iter__'): # this is an iterable, not a single number
self.energy = raw_xr.energy[0]
else:
self.energy = raw_xr.energy

self.recreateIntegrator()

@property
Expand Down
Loading