Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
gfreychet committed Sep 19, 2024
2 parents c2a8aa2 + d0d5c5c commit e43cd8d
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions smi_analysis/SMI_beamline.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,8 +223,8 @@ def calculate_integrator_gi(self, det_rots):

def stitching_data(self, flag_scale=True, interp_factor=1):
self.img_st, self.qp, self.qz = [], [], []

if self.ai == []:
if np.array_equal(self.ai, []):
if len(self.det_angles) != len(self.imgs):
if self.detector != 'Pilatus900kw':
if len(self.det_angles) !=0 and len(self.det_angles) > len(self.imgs):
Expand Down Expand Up @@ -283,7 +283,7 @@ def inpainting(self, **kwargs):
)

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

if radial_range is None and 'Pilatus' in self.detector:
Expand All @@ -292,7 +292,7 @@ def caking(self, radial_range=None, azimuth_range=None, npt_rad=500, npt_azim=50
azimuth_range = (-180, 180)

if self.geometry == 'Transmission':
if self.inpaints == []:
if np.array_equal(self.inpaints, []):
self.inpainting()
self.cake, self.q_cake, self.chi_cake = integrate1D.cake_saxs(self.inpaints,
self.ai,
Expand All @@ -304,7 +304,7 @@ def caking(self, radial_range=None, azimuth_range=None, npt_rad=500, npt_azim=50
)
elif self.geometry == 'Reflection':
#ToDo implement a way to modify the dimension of the cake if required (it need to match the image dim ratio)
# if self.inpaints == []:
# if np.array_equal(self.inpaints, []):
# self.inpainting()
self.cake, self.q_cake, self.chi_cake = integrate1D.cake_gisaxs(self.img_st,
self.qp,
Expand All @@ -318,7 +318,7 @@ def radial_averaging(self, radial_range=None, azimuth_range=None, npt=2000):
self.q_rad, self.I_rad = [], []

if self.geometry == 'Transmission':
if self.inpaints == []:
if np.array_equal(self.inpaints, []):
self.inpainting()
if radial_range is None and (self.detector == 'Pilatus300kw' or self.detector == 'Pilatus900kw'):
radial_range = (0.001, np.sqrt(self.qp[1]**2 + self.qz[1]**2))
Expand All @@ -339,7 +339,7 @@ def radial_averaging(self, radial_range=None, azimuth_range=None, npt=2000):
)

elif self.geometry == 'Reflection':
if self.img_st == []:
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 @@ -373,7 +373,7 @@ def azimuthal_averaging(self, radial_range=None, azimuth_range=None, npt_rad=500
if azimuth_range is None and self.detector == 'Pilatus1m':
azimuth_range = (-180, 180)

if self.cake == []:
if np.array_equal(self.cake, []):
self.caking(radial_range=radial_range,
azimuth_range=azimuth_range,
npt_rad=npt_rad,
Expand All @@ -388,7 +388,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 self.img_st == []:
if np.array_equal(self.img_st, []):
self.stitching_data()

self.q_hor, self.I_hor = integrate1D.integrate_qpar(self.img_st,
Expand All @@ -399,7 +399,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 self.img_st == []:
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 e43cd8d

Please sign in to comment.