Skip to content

Commit

Permalink
Conformize all the empty list checking
Browse files Browse the repository at this point in the history
  • Loading branch information
gfreychet committed Jan 26, 2024
1 parent 5d309b4 commit 7580852
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions smi_analysis/SMI_beamline.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def __init__(self,
self.masks = []
self.cake = []
self.inpaints, self.mask_inpaints = [], []
self.img_st, self.mask_st = np.array([]), np.array([])
self.img_st, self.mask_st = [], []
self.bs_kind = bs_kind
self.scales = 1

Expand Down Expand Up @@ -247,7 +247,7 @@ def inpainting(self, **kwargs):
)

def caking(self, radial_range=None, azimuth_range=None, npt_rad=500, npt_azim=500):
if not(self.img_st.size):
if np.array_equal(self.img_st, []):
self.stitching_data()

if radial_range is None and 'Pilatus' in self.detector:
Expand Down Expand Up @@ -303,7 +303,7 @@ def radial_averaging(self, radial_range=None, azimuth_range=None, npt=2000):
)

elif self.geometry == 'Reflection':
if not(self.img_st.size):
if np.array_equal(self.img_st, []):
self.stitching_data()
if radial_range is None and 'Pilatus' in self.detector:
radial_range = (0, self.qp[1])
Expand Down Expand Up @@ -352,7 +352,7 @@ def azimuthal_averaging(self, radial_range=None, azimuth_range=None, npt_rad=500
)

def horizontal_integration(self, q_per_range=None, q_par_range=None):
if not(self.img_st.size):
if np.array_equal(self.img_st, []):
self.stitching_data()

self.q_hor, self.I_hor = integrate1D.integrate_qpar(self.img_st,
Expand All @@ -363,7 +363,7 @@ def horizontal_integration(self, q_per_range=None, q_par_range=None):
)

def vertical_integration(self, q_per_range=None, q_par_range=None):
if not(self.img_st.size):
if np.array_equal(self.img_st, []):
self.stitching_data()

self.q_ver, self.I_ver = integrate1D.integrate_qper(self.img_st,
Expand Down

0 comments on commit 7580852

Please sign in to comment.