{ "cells": [ { "cell_type": "markdown", "id": "fb25e607", "metadata": {}, "source": [ "# Crop data\n", "\n", "In this notebook, we will see how to crop the aita data." ] }, { "cell_type": "code", "execution_count": 1, "id": "312a1770", "metadata": {}, "outputs": [], "source": [ "import xarrayaita.loadData_aita as lda #here are some function to build xarrayaita structure\n", "import xarrayaita.aita as xa\n", "\n", "import xarray as xr\n", "import matplotlib.pyplot as plt\n", "import matplotlib.cm as cm\n", "import numpy as np\n", "%matplotlib widget" ] }, { "cell_type": "markdown", "id": "ba99b401", "metadata": {}, "source": [ "## Load your data" ] }, { "cell_type": "code", "execution_count": 2, "id": "08714440", "metadata": { "tags": [] }, "outputs": [], "source": [ "# path to data and microstructure\n", "path_data='orientation_test.dat'\n", "path_micro='micro_test.bmp'" ] }, { "cell_type": "code", "execution_count": 3, "id": "84f47d6c", "metadata": {}, "outputs": [], "source": [ "data=lda.aita5col(path_data,path_micro)" ] }, { "cell_type": "code", "execution_count": 4, "id": "42300bab", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
<xarray.Dataset>\n", "Dimensions: (y: 2500, x: 1000, uvecs: 2)\n", "Coordinates:\n", " * x (x) float64 0.0 0.02 0.04 0.06 0.08 ... 19.92 19.94 19.96 19.98\n", " * y (y) float64 49.98 49.96 49.94 49.92 49.9 ... 0.06 0.04 0.02 0.0\n", "Dimensions without coordinates: uvecs\n", "Data variables:\n", " orientation (y, x, uvecs) float64 2.395 0.6451 5.377 ... 0.6098 0.6473\n", " quality (y, x) int64 0 90 92 93 92 92 94 94 ... 96 96 96 96 96 97 97 96\n", " micro (y, x) float64 0.0 0.0 0.0 0.0 0.0 0.0 ... 0.0 0.0 0.0 0.0 0.0\n", " grainId (y, x) int64 1 1 1 1 1 1 1 1 1 1 1 1 ... 1 1 1 1 1 1 1 1 1 1 1\n", "Attributes:\n", " date: Thursday, 19 Nov 2015, 11:24 am\n", " unit: millimeters\n", " step_size: 0.02\n", " path_dat: orientation_test.dat
<xarray.Dataset>\n", "Dimensions: (y: 1075, x: 585, uvecs: 2)\n", "Coordinates:\n", " * x (x) float64 4.0 4.02 4.04 4.06 4.08 ... 15.62 15.64 15.66 15.68\n", " * y (y) float64 44.32 44.3 44.28 44.26 ... 22.9 22.88 22.86 22.84\n", "Dimensions without coordinates: uvecs\n", "Data variables:\n", " orientation (y, x, uvecs) float64 0.1868 0.6983 0.1848 ... 1.334 1.531\n", " quality (y, x) float64 95.0 94.0 94.0 85.0 56.0 ... 79.0 81.0 81.0 81.0\n", " micro (y, x) float64 0.0 0.0 0.0 0.0 0.0 0.0 ... 0.0 0.0 0.0 0.0 0.0\n", " grainId (y, x) int64 1 1 1 1 1 1 0 0 ... 380 380 380 380 380 380 380\n", "Attributes:\n", " date: Thursday, 19 Nov 2015, 11:24 am\n", " unit: millimeters\n", " step_size: 0.02\n", " path_dat: orientation_test.dat
<xarray.Dataset>\n", "Dimensions: (y: 1075, x: 585, uvecs: 2)\n", "Coordinates:\n", " * x (x) float64 4.0 4.02 4.04 4.06 4.08 ... 15.62 15.64 15.66 15.68\n", " * y (y) float64 44.32 44.3 44.28 44.26 ... 22.9 22.88 22.86 22.84\n", "Dimensions without coordinates: uvecs\n", "Data variables:\n", " orientation (y, x, uvecs) float64 0.1868 0.6983 0.1848 ... 1.334 1.531\n", " quality (y, x) float64 95.0 94.0 94.0 85.0 56.0 ... 79.0 81.0 81.0 81.0\n", " micro (y, x) float64 0.0 0.0 0.0 0.0 0.0 0.0 ... 0.0 0.0 0.0 0.0 0.0\n", " grainId (y, x) int64 1 1 1 1 1 1 0 0 ... 380 380 380 380 380 380 380\n", "Attributes:\n", " date: Thursday, 19 Nov 2015, 11:24 am\n", " unit: millimeters\n", " step_size: 0.02\n", " path_dat: orientation_test.dat