-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added optical class with import functions
- Loading branch information
Patrick Curran
committed
Sep 29, 2024
1 parent
bb80dbf
commit 97ab620
Showing
8 changed files
with
461 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,126 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 3, | ||
"id": "a167425e-fc5d-4f0d-ad30-96ab225104a9", | ||
"metadata": {}, | ||
"outputs": [ | ||
{ | ||
"ename": "ModuleNotFoundError", | ||
"evalue": "No module named 'numba'", | ||
"output_type": "error", | ||
"traceback": [ | ||
"\u001b[1;31m---------------------------------------------------------------------------\u001b[0m", | ||
"\u001b[1;31mModuleNotFoundError\u001b[0m Traceback (most recent call last)", | ||
"Cell \u001b[1;32mIn[3], line 7\u001b[0m\n\u001b[0;32m 5\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01mdefdap\u001b[39;00m\u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01mfile_readers\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m OpticalDataLoader, MatplotlibLoader\n\u001b[0;32m 6\u001b[0m \u001b[38;5;28;01mimport\u001b[39;00m \u001b[38;5;21;01mdefdap\u001b[39;00m\n\u001b[1;32m----> 7\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01mdefdap\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m ebsd\n\u001b[0;32m 8\u001b[0m \u001b[38;5;28;01mimport\u001b[39;00m \u001b[38;5;21;01moptical\u001b[39;00m \n", | ||
"File \u001b[1;32mC:\\\\Users\\\\mbgm5pc3\\\\dev-optical\\\\DefDAP\\defdap\\ebsd.py:28\u001b[0m\n\u001b[0;32m 26\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01mdefdap\u001b[39;00m\u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01mquat\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m Quat\n\u001b[0;32m 27\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01mdefdap\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m base\n\u001b[1;32m---> 28\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01mdefdap\u001b[39;00m\u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01m_accelerated\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m flood_fill\n\u001b[0;32m 30\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01mdefdap\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m defaults\n\u001b[0;32m 31\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01mdefdap\u001b[39;00m\u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01mplotting\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m MapPlot\n", | ||
"File \u001b[1;32mC:\\\\Users\\\\mbgm5pc3\\\\dev-optical\\\\DefDAP\\defdap\\_accelerated.py:1\u001b[0m\n\u001b[1;32m----> 1\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01mnumba\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m njit\n\u001b[0;32m 2\u001b[0m \u001b[38;5;28;01mimport\u001b[39;00m \u001b[38;5;21;01mnumpy\u001b[39;00m \u001b[38;5;28;01mas\u001b[39;00m \u001b[38;5;21;01mnp\u001b[39;00m\n\u001b[0;32m 5\u001b[0m \u001b[38;5;129m@njit\u001b[39m\n\u001b[0;32m 6\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21mfind_first\u001b[39m(arr):\n", | ||
"\u001b[1;31mModuleNotFoundError\u001b[0m: No module named 'numba'" | ||
] | ||
} | ||
], | ||
"source": [ | ||
"import numpy as np\n", | ||
"import matplotlib.pyplot as plt\n", | ||
"import matplotlib.image as mpimg\n", | ||
"#%matplotlib qt5\n", | ||
"from defdap.file_readers import OpticalDataLoader, MatplotlibLoader\n", | ||
"import defdap\n", | ||
"from defdap import ebsd\n", | ||
"import optical " | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 2, | ||
"id": "23fafbcf-4cb1-4540-b85e-10906c14cfe0", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"import sys\n", | ||
"sys.path.append(r'C:\\\\Users\\\\mbgm5pc3\\\\dev-optical\\\\DefDAP')" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "6ae24a9b-6842-4540-b36b-3795c1d85f05", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"fname = \"./test_data/F5-pol-Cy50.png\"\n", | ||
"Opt = optical.Map(fname)" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "8bcb125c-55be-4745-a22c-3578cef3f7ee", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"Opt.set_scale (2.105) #um/pixel" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "4387f479-785f-4639-b778-b60148f849cb", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"#Opt.set_crop (left = 10, right = 10, top = 10, bottom = 10)" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "de922a4a-44ff-45a9-8f1d-2fb99297b698", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"Opt.plot_optical_image()" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "a0eaeccb-5e58-428e-b448-903ed9bb1942", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"EbsdMap = ebsd.Map(path+'../EBSD_data/post_deformed/f-5-test-region')" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "6a0c8059-c551-40b6-8091-cbaacbd798e7", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [] | ||
} | ||
], | ||
"metadata": { | ||
"kernelspec": { | ||
"display_name": "Python 3 (ipykernel)", | ||
"language": "python", | ||
"name": "python3" | ||
}, | ||
"language_info": { | ||
"codemirror_mode": { | ||
"name": "ipython", | ||
"version": 3 | ||
}, | ||
"file_extension": ".py", | ||
"mimetype": "text/x-python", | ||
"name": "python", | ||
"nbconvert_exporter": "python", | ||
"pygments_lexer": "ipython3", | ||
"version": "3.12.6" | ||
} | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 5 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.