-
Notifications
You must be signed in to change notification settings - Fork 14
Open
Description
Generate the following error when trying to apply powder mask in 2XRS view, with and without pinhole camera corrections when tth_width = 3 degrees. When width is reduced to 0.5 degrees, then the error goes away, but the powder masks are incorrectly drawn (extra regions masked). Attaching a screenshot below.
File "/Users/soderlind3/hexrdgui/hexrdgui/main_window.py", line 906, in action_edit_apply_powder_mask_to_polar
raw_data = convert_polar_to_raw(data)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/soderlind3/hexrdgui/hexrdgui/masking/create_raw_mask.py", line 78, in convert_polar_to_raw
mask = ~polygon_to_mask(raw * res, mask_shape)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/soderlind3/hexrdgui/hexrdgui/utils/polygon.py", line 10, in polygon_to_mask
ImageDraw.Draw(img).polygon(coords.flatten().tolist(), outline=0, fill=0)
File "/Users/soderlind3/opt/miniconda3/envs/hexrd/lib/python3.11/site-packages/PIL/ImageDraw.py", line 362, in polygon
self.draw.draw_polygon(xy, fill_ink, 1)
TypeError: coordinate list must contain at least 2 coordinates```