Skip to content

Commit 2b6126f

Browse files
committed
A couple of minor fixes for improved accuracy...
Signed-off-by: Patrick Avery <patrick.avery@kitware.com>
1 parent ba0b426 commit 2b6126f

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

hexrdgui/calibration/polar_plot.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,13 @@ def write_image(self, filename='polar_image.npz'):
130130
np.savetxt(filename, azimuthal_integration, delimiter=delimiter)
131131
return
132132

133-
intensities = self.img.filled(np.nan)
134-
raw_intensities = self.raw_img.filled(np.nan)
133+
intensities = self.img
134+
if np.ma.is_masked(intensities):
135+
intensities = intensities.filled(np.nan)
136+
137+
raw_intensities = self.raw_img
138+
if np.ma.is_masked(raw_intensities):
139+
raw_intensities = raw_intensities.filled(np.nan)
135140

136141
eta, tth = np.degrees(self.angular_grid)
137142

hexrdgui/masking/mask_regions_dialog.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,10 @@ def button_pressed(self, event):
206206
print('Masking must be done in raw or polar view')
207207
return
208208

209-
if HexrdConfig().stitch_raw_roi_images:
209+
if (
210+
self.image_mode == ViewType.raw and
211+
HexrdConfig().stitch_raw_roi_images
212+
):
210213
print('Ellipse/rectangle masks do not yet support drawing on a '
211214
'stitched raw view. Please switch to an unstitched view to '
212215
'draw the masks.')

0 commit comments

Comments
 (0)