diff --git a/defdap/base.py b/defdap/base.py index 771fa26..f4f2401 100755 --- a/defdap/base.py +++ b/defdap/base.py @@ -950,8 +950,13 @@ def grain_map_data(self, map_data=None, grain_data=None, bg=np.nan): grain_data = self.grain_data(map_data) x0, y0, xmax, ymax = self.extreme_coords - grain_map_data = np.full((ymax - y0 + 1, xmax - x0 + 1), bg, - dtype=type(grain_data[0])) + # To support 3D array (ie RGB) + map_shape = (ymax - y0 + 1, xmax - x0 + 1) + if grain_data.ndim > 1: + map_shape = map_shape + grain_data.shape[1:] + + # Create output array with appropriate dtype + grain_map_data = np.full(map_shape, bg, dtype=grain_data.dtype) for coord, data in zip(self.data.point, grain_data): grain_map_data[coord[1] - y0, coord[0] - x0] = data diff --git a/defdap/ebsd.py b/defdap/ebsd.py index db168d2..87f58a2 100755 --- a/defdap/ebsd.py +++ b/defdap/ebsd.py @@ -1306,7 +1306,28 @@ def calc_grod(self): misori_axis = (2 * dq[1:4] * np.arccos(dq[0])) / np.sqrt(1 - dq[0]**2) return misori, misori_axis + + def calc_ipf_colour(self, grain_data, direction, bg_colour=None): + grain_colours = Quat.calc_ipf_colours( + grain_data, direction, self.phase.crystal_structure.name + ).T + + return grain_colours + + def calc_euler_colour(self, grain_data, bg_colour=None): + + if self.phase.crystal_structure.name == 'cubic': + norm = np.array([2 * np.pi, np.pi / 2, np.pi / 2]) + elif self.phase.crystal_structure.name == 'hexagonal': + norm = np.array([np.pi, np.pi, np.pi / 3]) + else: + ValueError("Only hexagonal and cubic symGroup supported") + + grain_colours = grain_data.T / norm + + return grain_colours + def plot_ref_ori(self, direction=np.array([0, 0, 1]), **kwargs): """Plot the average grain orientation on an IPF. diff --git a/defdap/inspector.py b/defdap/inspector.py index 2acdeb3..8a77a39 100644 --- a/defdap/inspector.py +++ b/defdap/inspector.py @@ -419,8 +419,8 @@ def calc_rdr(self, y_list.extend(ymap - self.selected_dic_grain.extreme_coords[1]) # Get u and v values at each coordinate - u = self.selected_dic_map.crop(self.selected_dic_map.data.displacement[0])[ymap, xmap] - v = self.selected_dic_map.crop(self.selected_dic_map.data.displacement[1])[ymap, xmap] + u = self.selected_dic_map.data.displacement[0][ymap, xmap] + v = self.selected_dic_map.data.displacement[1][ymap, xmap] # Subtract mean u and v value for each row u_list.extend(u - np.mean(u, axis=1)[:, None]) diff --git a/docs/source/papers.rst b/docs/source/papers.rst index 163c23b..c454ccd 100644 --- a/docs/source/papers.rst +++ b/docs/source/papers.rst @@ -1,11 +1,22 @@ Papers ======== -Here is a list of papers which have used the DefDAP Python library. +Here is a list of journal papers which have used the DefDAP Python library. + +2026 +------ + +* `A.D.Smith, D.Lunt, M.Taylor, A.Davis, R.Thomas, F.Martinez, A.Candeias, A.Gholinia, M.Preuss, J.M.Donoghue. A new approach to SEM in-situ thermomechanical experiments through automation. Ultramicroscopy. Vol. 280, Feb 2026, pp. 114244. `_ 2025 ------ +* `B.Yavuzyegit, K.Karali, S.Davis, B.Morrison, S.Karabal, K.Balandiz, N.Smith, S.Usov, P.Shashkov, R.Bonithon, G.Blunn. High-resolution DIC analysis of in situ strain and crack propagation in coated AZ31 magnesium alloys under mechanical loading. Journal of Materials Science. Vol. 60, Aug 2025, pp. 14708–14730. `_ + +* `Z.Yang, R.Thomas, J.Donoghue, A.Smith, M.Preuss, A.Gholinia. In situ and correlative study of dislocation density and deformation mechanisms in Inconel 690. Materials Characterization. Volume 230, Part A, December 2025, 115699. `_ + +* `G.Zhou, D.T.Fullwood, R.H.Wagoner, S.R.Niezgoda, T.Russell, D.Lunt. Slip mode analysis in BCC tantalum with HRDIC. Materials Science and Engineering: A. Volume 947, December 2025, 149179. `_ + * `B.Yang, X.Xu, D.Lunt, F.Zhang, M.D.Atkinson, Y.Li, J.LLorca, X.Zhou. Grain size dependence of microscopic strain distribution in a high entropy alloy at the onset of plastic deformation. Acta Materialia. Volume 285, Feb 2025, 120682. `_ * `D.Hu, A.D.Smith, D.Lunt, R.Thomas, M.D.Atkinson, X.Liu, Ö.Koç, J.M.Donoghue, Z.Zhang, J.Quinta da Fonseca, M.Preuss, Tracking the onset of plasticity in a Ni-base superalloy using in-situ High-Resolution Digital Image Correlation. Materialia. Volume 220, Feb 2025, 114654. `_