Phase losing name and properties after refinement from single crystal map #620
-
Hi! (sorry for the long post) >>>print(xmap)
Phase Orientations Name Space group Point group Proper point group Color
0 747 (37.4%) ferrite Im-3m m-3m 432 r
1 1253 (62.6%) austenite Fm-3m m-3m 432 aqua I would like to refine the crystal map's orientations by using refine orientation on each crystal map phase with the appropriate master pattern. I load the master pattern, make a deep copy of the crystal map phase with mp_key (name of the phase) with a for loop: for mp_key, mp_path in self.mp_paths.items():
mp: LazyEBSDMasterPattern = kp.load(
mp_path,
energy=energy,
projection="lambert",
hemisphere="upper",
lazy=lazy,
)
print(f"\nRefining Phase: {mp.phase.name}")
xmap_phase = xmap[mp_key].deepcopy()
print(xmap_phase)
#Outputs (as expected)
Refining Phase: ferrite
Phase Orientations Name Space group Point group Proper point group Color
0 747 (100.0%) ferrite Im-3m m-3m 432 r
Refining Phase: austenite
Phase Orientations Name Space group Point group Proper point group Color
1 1253 (100.0%) austenite Fm-3m m-3m 432 aqua I then perform refine_orientations, but now the output of the second phase has changed and are missing everything except orientations. ref_xmaps[mp_key] = s.refine_orientation(
xmap=xmap_phase,
detector=det,
master_pattern=mp,
energy=energy,
signal_mask=signal_mask,
trust_region=[1, 1, 1],
method=method,
method_kwargs=ref_kwargs,
compute=True
)
print(f"After refinement:\n{ref_xmaps[mp_key]}")
# Outputs
After refinement:
Phase Orientations Name Space group Point group Proper point group Color
0 747 (100.0%) ferrite Im-3m m-3m 432 tab:blue
After refinement:
Phase Orientations Name Space group Point group Proper point group Color
1 1253 (100.0%) None None None None tab:orange Am I doing something wrong when doing refinement this way? I know that the name and properties are kept when the phases are loaded from two different crystal maps instead of just the one containging both phases. Note that the signal s is the pattern which the crystal map originated from, but is not being indexed (neither pattern matching nor hough indexing) in the same code where refinement takes place. Colors also change after refinement, but these are maybe decided by the master pattern rather than the original crystal map? Full code snippet with output at bottom: ...
ref_xmaps = {}
print(xmap)
for mp_key, mp_path in self.mp_paths.items():
mp: LazyEBSDMasterPattern = kp.load(
mp_path,
energy=energy,
projection="lambert",
hemisphere="upper",
lazy=lazy,
)
print(f"\nRefining Phase: {mp.phase.name}")
xmap_phase = xmap[mp_key].deepcopy()
print(xmap_phase)
ref_xmaps[mp_key] = s.refine_orientation(
xmap=xmap_phase,
detector=det,
master_pattern=mp,
energy=energy,
signal_mask=signal_mask,
trust_region=[1, 1, 1],
method=method,
method_kwargs=ref_kwargs,
compute=True
)
print(f"After refinement:\n{ref_xmaps[mp_key]}")
...
# Output
Phase Orientations Name Space group Point group Proper point group Color
0 747 (37.4%) ferrite Im-3m m-3m 432 r
1 1253 (62.6%) austenite Fm-3m m-3m 432 aqua
Properties: cm, fit, nmatch, pq
Scan unit: um
Refining Phase: ferrite
Phase Orientations Name Space group Point group Proper point group Color
0 747 (100.0%) ferrite Im-3m m-3m 432 r
Properties: cm, fit, nmatch, pq
Scan unit: um
Refinement information:
Method: LN_NELDERMEAD (local) from NLopt
Trust region (+/-): [1 1 1]
Relative tolerance: 0.0001
Refining 747 orientation(s):
[########################################] | 100% Completed | 7.82 s
Refinement speed: 95.23195 patterns/s
After refinement:
Phase Orientations Name Space group Point group Proper point group Color
0 747 (100.0%) ferrite Im-3m m-3m 432 tab:blue
Properties: scores, num_evals
Scan unit: um
Refining Phase: austenite
Phase Orientations Name Space group Point group Proper point group Color
1 1253 (100.0%) austenite Fm-3m m-3m 432 aqua
Properties: cm, fit, nmatch, pq
Scan unit: um
Refinement information:
Method: LN_NELDERMEAD (local) from NLopt
Trust region (+/-): [1 1 1]
Relative tolerance: 0.0001
Refining 1253 orientation(s):
[########################################] | 100% Completed | 13.45 s
Refinement speed: 92.94377 patterns/s
After refinement:
Phase Orientations Name Space group Point group Proper point group Color
1 1253 (100.0%) None None None None tab:orange
Properties: scores, num_evals
Scan unit: um |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 13 replies
-
Hi @Erlendos12, thank you for asking. The loss of properties is by design. There are some auxiliary properties, like the orientation similarity (OS) computed from dictionary indexing results, which aren't valid for refined maps. Therefore, I think it is safest to return only properties we know are valid for the refined map. If we want to add them to the refined map, we have to do so manually. The "intended way" of refining only some points in a map is to pass a That said, the loss of phase information is strange and seems like a bug. Can you check xmap.phases_in_data? I'm wondering if the Austenite phase got a phase ID of 0 when wrapping the refinement results in a new crystal map, while the |
Beta Was this translation helpful? Give feedback.
Hi @Erlendos12,
thank you for asking. The loss of properties is by design. There are some auxiliary properties, like the orientation similarity (OS) computed from dictionary indexing results, which aren't valid for refined maps. Therefore, I think it is safest to return only properties we know are valid for the refined map. If we want to add them to the refined map, we have to do so manually.
The "intended way" of refining only some points in a map is to pass a
navigation_mask
, with points to refine equal toFalse
(points to "mask out" areTrue
), to the refinement methods EBSD.refine_*(). This procedure is demonstrated in the Hybrid indexing tutorial. It seems to me like this workflow doe…