diff --git a/hexrdgui/create_raw_mask.py b/hexrdgui/create_raw_mask.py index ea185f6aa..fd18eca42 100644 --- a/hexrdgui/create_raw_mask.py +++ b/hexrdgui/create_raw_mask.py @@ -47,9 +47,10 @@ def convert_polar_to_raw(line_data, reverse_tth_distortion=True): line_data[i] = line raw_line_data = [] + instr = create_hedm_instrument() for line in line_data: - for key, panel in create_hedm_instrument().detectors.items(): - raw = angles_to_pixels(line, panel) + for key, panel in instr.detectors.items(): + raw = angles_to_pixels(line, panel, tvec_s=instr.tvec) if all([np.isnan(x) for x in raw.flatten()]): continue diff --git a/hexrdgui/utils/conversions.py b/hexrdgui/utils/conversions.py index facd80a0e..4f5ed9740 100644 --- a/hexrdgui/utils/conversions.py +++ b/hexrdgui/utils/conversions.py @@ -46,8 +46,10 @@ def angles_to_cart(angles, panel, tvec_s=None, tvec_c=None, return panel.angles_to_cart(**kwargs) -def angles_to_pixels(angles, panel): - xys = angles_to_cart(angles, panel) +def angles_to_pixels(angles, panel, tvec_s=None, tvec_c=None, + apply_distortion=True): + xys = angles_to_cart(angles, panel, tvec_s=tvec_s, tvec_c=tvec_c, + apply_distortion=apply_distortion) return cart_to_pixels(xys, panel)