1. Functions overview

1.1. Loading data

xarrayaita.loadData_aita.aita3col(adr_data, image, micro_adress=0)

Function to load the data from G50 analyser that have 3 columns

Parameters
  • adr_data (str) – path to the data

  • image (str) – path to one image from G50 analyser

  • micro_adress (str) – path to microstructure file (black and white image where grains boundaries are white) .bmp

xarrayaita.loadData_aita.aita5col(adr_data, micro_adress=0)

Function to load the data from G50 analyser that have 5 columns

Parameters
  • adr_data (str) – path to the data

  • micro_adress (str) – path to microstructure file (black and white image where grains boundaries are white) .bmp

xarrayaita.loadData_aita.craft_input(adr_vtk, adr_phase)

Function to load the data from craft simulation

Parameters
  • adr_vtk – path to the vtk

  • phase (str) – path to phase

1.2. aita xr.Dataset accessor

class xarrayaita.aita.aita(xarray_obj)

This is a classe to work on aita data in xarray environnement.

Note

xarray does not support heritage from xr.DataArray may be the day it support it, we could move to it

__init__(xarray_obj)

Constructor for aita.

The xarray_obj should contained at least : 1. orientation : DataArray that is compatible with uvec structure 2. quality : DataArray of dim (m,n,1)

It can contained : 1. micro : DataArray of dim (m,n,1) 2. grainId : DataArray of dim (m,n,1)

Parameters

xarray_obj (xr.Dataset) –

__weakref__

list of weak references to the object (if defined)

closest_outG_value(xada)

Compute for each pixel the abs(val_pixel-val_pixel_closest_grain)

craft(nameId, res=0, m3d=0)

Export ‘vtk’ file and the phase file. :param res: resolution for the vtk export :type res: float

crop(lim, rebuild_gId=True)
Parameters
  • rebuild_gId (bool) – recompute the grainID

  • lim (np.array) –

dist2GB()

Compute the distance to the closest grain boundary :retrun dist2gb: :rtype dist2gb: xr.DataArray

dist2TJ()

Compute the distance to the closest grain boundary :retrun dist2tj: :rtype dist2tj: xr.DataArray

filter(val)

Put nan value in orientation file

fliplr()

flip left right the data and rotate the orientation

May be it is more a routation around the 0y axis of 180 degree

interactive_crop(rebuild_gId=True)

out=data.aita.interactive_crop()

Parameters

rebuild_gId (bool) – recompute the grainID

This function can be use to crop within a jupyter notebook It will crop the data and export the value of the crop in out.pos

interactive_misorientation_profile(res=0, degre=True)

Interactive misorientation profile for jupyter notebook

Parameters
  • res (float) – step size of the profil

  • degre (bool) – return mis2o and mis2p in degre overwise in radian (default: true)

interactive_segmentation(val_scharr_init=1.5, use_scharr_init=True, val_canny_init=1.5, use_canny_init=True, val_qua_init=60, use_qua_init=False, inc_border_init=False)

This function allow you to performed grain segmentation on aita data. The intitial value of the segmenation function can be set-up initially

Parameters
  • val_scharr_init (float) – scharr filter usually between 0 and 10 (default : 1.5)

  • use_scharr_init (bool) – use scharr filter

  • val_canny_init (float) – canny filter usually between 0 and 10 (default : 1.5)

  • use_canny_init (bool) – use canny filter

  • val_qua_init (int) – quality filter usually between 0 and 100 (default : 60)

  • use_qua_init (bool) – use quality filter

  • inc_border_init (bool) – add image border to grain boundaries

Note

on data with holes such as snow, using quality filter is not recommended

mean_grain(dilate=True)

Compute the mean orientation inside the grain :param dilate: remove grain boundaries by dilatation (default True) :type dilate: bool

plotBoundary(dilatation=0, **kwargs)

Plot the grains boundries

Parameters

dilatation (int) –

resize(res)

Resize the dataset

rot180()

rotate 180 degre around Oz the data and rotate the orientation

rot90c()

rotate 90 degre in clockwise direction