Skip to content

Commit 75cf35a

Browse files
committed
PEP8
1 parent 54a4b03 commit 75cf35a

File tree

1 file changed

+16
-13
lines changed

1 file changed

+16
-13
lines changed

hexrd/instrument/detector.py

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,6 @@ def beam_position(self):
171171
"""
172172
raise NotImplementedError
173173

174-
175174
@property
176175
def extra_config_kwargs(self):
177176
return {}
@@ -289,7 +288,8 @@ def __init__(
289288
self.group = group
290289

291290
if detector_filter is None:
292-
detector_filter = detector_coatings.Filter(**FILTER_DEFAULTS.TARDIS)
291+
detector_filter = detector_coatings.Filter(
292+
**FILTER_DEFAULTS.TARDIS)
293293
self.filter = detector_filter
294294

295295
if detector_coating is None:
@@ -1709,7 +1709,7 @@ def calc_physics_package_transmission(self, energy: np.floating,
17091709
need to consider HED and HEDM samples separately
17101710
"""
17111711
bvec = self.bvec
1712-
sample_normal = np.dot(rMat_s, [0.,0.,-1.])
1712+
sample_normal = np.dot(rMat_s, [0., 0., -1.])
17131713
seca = 1./np.dot(bvec, sample_normal)
17141714

17151715
tth, eta = self.pixel_angles()
@@ -1720,7 +1720,8 @@ def calc_physics_package_transmission(self, energy: np.floating,
17201720

17211721
secb = np.abs(1./np.dot(dvecs, sample_normal).reshape(self.shape))
17221722

1723-
T_sample = self.calc_transmission_sample(seca, secb, energy, physics_package)
1723+
T_sample = self.calc_transmission_sample(
1724+
seca, secb, energy, physics_package)
17241725
T_window = self.calc_transmission_window(secb, energy, physics_package)
17251726

17261727
transmission_physics_package = T_sample * T_window
@@ -1729,37 +1730,39 @@ def calc_physics_package_transmission(self, energy: np.floating,
17291730
def calc_transmission_sample(self, seca: np.array,
17301731
secb: np.array, energy: np.floating,
17311732
physics_package: AbstractPhysicsPackage) -> np.array:
1732-
thickness_s = physics_package.sample_thickness # in microns
1733-
mu_s = 1./physics_package.sample_absorption_length(energy) # in microns^-1
1733+
thickness_s = physics_package.sample_thickness # in microns
1734+
# in microns^-1
1735+
mu_s = 1./physics_package.sample_absorption_length(energy)
17341736
x = (mu_s*thickness_s)
17351737
pre = 1./x/(secb - seca)
17361738
num = np.exp(-x*seca) - np.exp(-x*secb)
17371739
return pre * num
17381740

17391741
def calc_transmission_window(self, secb: np.array, energy: np.floating,
17401742
physics_package: AbstractPhysicsPackage) -> np.array:
1741-
thickness_w = physics_package.window_thickness # in microns
1742-
mu_w = 1./physics_package.window_absorption_length(energy) # in microns^-1
1743+
thickness_w = physics_package.window_thickness # in microns
1744+
# in microns^-1
1745+
mu_w = 1./physics_package.window_absorption_length(energy)
17431746
return np.exp(-thickness_w*mu_w*secb)
17441747

17451748
def calc_effective_pinhole_area(self, physics_package: AbstractPhysicsPackage) -> np.array:
17461749
"""get the effective pinhole area correction
17471750
"""
17481751
effective_pinhole_area = np.ones(self.shape)
17491752

1750-
if (physics_package.pinhole_diameter !=0.
1751-
and physics_package.pinhole_thickness != 0.):
1753+
if (physics_package.pinhole_diameter != 0.
1754+
and physics_package.pinhole_thickness != 0.):
17521755

17531756
hod = (physics_package.pinhole_thickness /
17541757
physics_package.pinhole_diameter)
17551758
bvec = self.bvec
17561759

17571760
tth, eta = self.pixel_angles()
17581761
angs = np.vstack((tth.flatten(), eta.flatten(),
1759-
np.zeros(tth.flatten().shape))).T
1762+
np.zeros(tth.flatten().shape))).T
17601763
dvecs = angles_to_dvec(angs, beam_vec=bvec)
17611764

1762-
cth = -dvecs[:,2].reshape(self.shape)
1765+
cth = -dvecs[:, 2].reshape(self.shape)
17631766
tanth = np.tan(np.arccos(cth))
17641767
f = hod*tanth
17651768
f[np.abs(f) > 1.] = np.nan
@@ -1773,7 +1776,7 @@ def calc_transmission_generic(self,
17731776
secb: np.array,
17741777
thickness: np.floating,
17751778
absorption_length: np.floating) -> np.array:
1776-
mu = 1./absorption_length # in microns^-1
1779+
mu = 1./absorption_length # in microns^-1
17771780
return np.exp(-thickness*mu*secb)
17781781

17791782
def calc_transmission_phosphor(self,

0 commit comments

Comments
 (0)