Skip to content

Commit 8dcb290

Browse files
authored
Merge pull request #773 from HEXRD/simulated-powder-diffraction-fix
some fixes for simulating powder diffraction pattern on an instrument.
2 parents 21a0365 + cbe0861 commit 8dcb290

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

hexrd/instrument/hedm_instrument.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -485,8 +485,11 @@ def max_resolution(instr):
485485
axis=0
486486
).reshape(2, np.cumprod(panel.shape)[-1]).T
487487
)
488-
max_tth = min(max_tth, np.min(angps[:, 0]))
489-
max_eta = min(max_eta, np.min(angps[:, 1]))
488+
mask = ~np.logical_or(
489+
np.isclose(angps[:,0], 0),
490+
np.isclose(angps[:,1], 0))
491+
max_tth = min(max_tth, np.min(angps[mask, 0]))
492+
max_eta = min(max_eta, np.min(angps[mask, 1]))
490493
return max_tth, max_eta
491494

492495

hexrd/wppf/WPPF.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -344,6 +344,7 @@ def calctth(self):
344344
self.dsp[p][k] = dsp[limit]
345345
if sf_f is not None and lfact_sf is not None:
346346
sf_f = sf_f[allowed]
347+
lfact_sf = lfact_sf[allowed]
347348
self.sf_hkl_factors[p][k] = sf_f[limit]
348349
self.sf_lfactor[p][k] = lfact_sf[limit]
349350

0 commit comments

Comments
 (0)