1. Functions overview

1.1. Loading data

1.2. aita xr.Dataset accessor

1.2.1. Geometric transformation

xarrayaita.aita_geom.crop(self, lim, rebuild_gId=True)

Geometric transformation

Crop dataset between limits given in parameters

Parameters:
  • rebuild_gId (bool) – recompute the grainID

  • lim (np.array) –

Return:
  • xarray.Dataset : croped dataset

xarrayaita.aita_geom.downscale(self, n)

Downscale the data in order to keep one value for each n x n boxes.

Parameters:

n (int) –

xarrayaita.aita_geom.fliplr(self)

Geometric transformation

Flip left right the data and rotate the orientation May be it is more a routation around the 0y axis of 180 degree

Return :
  • xarray.Dataset : fliped dataset

xarrayaita.aita_geom.resize(self, res)

Geometric transformation

Resize the dataset

Parameters:

res (float) – resolution factor

Return:
  • xarray.Dataset : resized dataset

xarrayaita.aita_geom.rot180(self)

Geometric transformantion

Rotate 180 degre around Oz the data and rotate the orientation

Return :
  • xarray.Dataset : rotated dataset

xarrayaita.aita_geom.rot90c(self)

Geometric transformation

Rotate 90 degre in clockwise direction

Return :
  • xarray.Dataset : rotated dataset

1.2.2. Data processing

xarrayaita.aita_processing.TJ_map(self)

Search Triple Join map and compute coordinates and grain of each triple Join

Return
  • xarray.DataArray : (nbTJ,5) , coordinates and triplet of grainId for each TJ

xarrayaita.aita_processing.anisotropy_factors(self)

Class function for xarray.DataSet.aita

Compute anisotropy factors of the closest TJ

Factors order :

0 : Relaive anisotropy 1 : Fractonal anisotropy 2 : Volume ratio anisotropy 3 : Flatness anisotropy

Return :
  • xarray.DataArray : (n,m,4)

xarrayaita.aita_processing.closest_outG_value(self, xada)

Compute for each pixel the value of the closest grain for the variable given in xada

Parameters:

xada (xr.DataArray) – map of values of same dimensions y and x

Return
  • xr.DataArray : (m,n,1 or 2) map of value from the closest grain

xarrayaita.aita_processing.closest_outTJ_value(self, xada)

Compute values of xada for the 3 grain of the closest TJ

Parameters:

xada (xarray.DataArray) – (n,m) or (n,m,2) map of values to compute

Return

xarray.DataArray : (n,m,3) or (n,m,3,2), the 3 maps of values (for each grain of TJ the closest TJ)

xarrayaita.aita_processing.dist2GB(self)

Compute the distance to the closest grain boundary for each pixel

Return
  • xr.DataArray : (m,n) map of distance to closest grain boundary

xarrayaita.aita_processing.dist2TJ_labels(self)

Calculate distance to closest TJ for each pixel using dist matrix calculated by dist2eachTJ method

Return

xarray.DataArray : map of distance to closest triple join

xarrayaita.aita_processing.dist2TJ_micro(self)

Compute the distance to the closest triple join for each pixel using micro structure

Return
  • xr.DataArray : (m,n) map of distance to closest triple join

xarrayaita.aita_processing.dist2eachTJ(self)

Compute distance to each TJ for each pixel using TJ coordinates from method TJ_map

Return
  • xarray.DataArray : matrix (n,m,nb_TJ) of distance to each TJ

xarrayaita.aita_processing.filter(self, val)

Put nan value in orientation for quality below val

Parameters:

val (float) – threshold value

xarrayaita.aita_processing.get_neighbours(self, id_grain)

Search and return id’s of neighbours of the given grain

Parameters:

id_grain (int) – id of grain

Return
  • np.array : list with id’s of neighbours

xarrayaita.aita_processing.mean_grain(self, dilate=True)

Compute the mean orientation inside each grain

Parameters:

dilate (bool) – remove grain boundaries by dilatation (default True)

Return :
  • xr.DataArray : (m,n,2) map of mean orientation per grain

1.2.3. Data export

xarrayaita.aita_export.craft(self, nameId, res=0, m3d=0, tesr=False)

Export ‘vtk’ file and the phase file.

Parameters:
  • res (float) – resolution for the vtk export

  • nameId – name of manipulation

  • m3d (int) – 0 for 2 dimensional data, 1 for 3 dimensional data

  • tesr (bool) – export tesr file compatible with neper

xarrayaita.aita_export.save(self, path)

Save xarray craft data using pickle

Parameters:

path (string) – path to save pickle file

1.2.4. Plot functions

xarrayaita.aita_plot.plotBoundary(self, dilatation=0, **kwargs)

Plot the grains boundries

Parameters:

dilatation (int) – number of iteration to perform dilation on boundaries

1.2.5. Interactive functions for Jupyter Notebook

xarrayaita.aita_interactive_nb.interactive_crop(self, 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

xarrayaita.aita_interactive_nb.interactive_misorientation_profile(self, 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)

xarrayaita.aita_interactive_nb.interactive_segmentation(self, 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