@@ -326,6 +326,7 @@ def __init__(self):
326326 self ._physics_package = None
327327 self ._detector_coatings = {}
328328 self ._instrument_rigid_body_params = {}
329+ self .absorption_corrections_dict = {}
329330
330331 # Make sure that the matplotlib font size matches the application
331332 self .font_size = self .font_size
@@ -986,7 +987,10 @@ def intensity_corrected_images_dict(self):
986987 factor = panel .lorentz_factor ()
987988 images_dict [name ] = img / factor
988989
990+ HexrdConfig ().absorption_corrections_dict .clear ()
989991 if HexrdConfig ().apply_absorption_correction :
992+ absorption_corrections = HexrdConfig ().absorption_corrections_dict
993+
990994 transmissions = instr .calc_transmission ()
991995 max_transmission = max (
992996 [np .nanmax (v ) for v in transmissions .values ()])
@@ -995,7 +999,16 @@ def intensity_corrected_images_dict(self):
995999 transmission = transmissions [name ]
9961000 # normalize by maximum of the entire instrument
9971001 transmission /= max_transmission
998- images_dict [name ] = img * (1 / transmission )
1002+ absorption_corrections [name ] = 1 / transmission
1003+
1004+ if (
1005+ HexrdConfig ().image_mode not in
1006+ (constants .ViewType .polar , constants .ViewType .stereo )
1007+ ):
1008+ # If it's not polar or stereo, go ahead and apply the
1009+ # corrections
1010+ for name , img in images_dict .items ():
1011+ images_dict [name ] = img * absorption_corrections [name ]
9991012
10001013 if HexrdConfig ().intensity_subtract_minimum :
10011014 minimum = min ([np .nanmin (x ) for x in images_dict .values ()])
0 commit comments