get_map_data#
- CrystalMap.get_map_data(item: str | ndarray, decimals: int | None = None, fill_value: int | float | None = nan) ndarray [source]#
Return an array of a class instance attribute, with values equal to
False
inself.is_in_data
set tofill_value
, of map data shape.- Parameters:
- item
Name of the class instance attribute or a
numpy.ndarray
.- decimals
Number of decimals to round data point values to. If not given, no rounding is done.
- fill_value
Value to fill points not in the data with. Default is
numpy.nan
.
- Returns:
output_array
Array of the class instance attribute with points not in data set to
fill_value
, of float data type.
Notes
Rotations and orientations should be accessed via
rotations
andorientations
.If
item
is"orientations"
or"rotations"
and there are multiple rotations per point, only the first rotation is used. Rotations are returned as Euler angles.Examples
>>> from orix import data >>> xmap = data.sdss_ferrite_austenite(allow_download=True) >>> xmap Phase Orientations Name Space group Point group Proper point group Color 1 5657 (48.4%) austenite None 432 432 tab:blue 2 6043 (51.6%) ferrite None 432 432 tab:orange Properties: iq, dp Scan unit: um >>> xmap.shape (100, 117)
Get a 2D map in the correct shape of any attribute, ready for plotting
>>> xmap.iq.shape (11700,) >>> iq = xmap.get_map_data("iq") >>> iq.shape (100, 117)