Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fiber tutorial new cell #2444

Merged
merged 1 commit into from
Feb 18, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 39 additions & 10 deletions doc/source/usage/tutorial/FiberGrazingIncidence.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -116,12 +116,34 @@
},
{
"cell_type": "markdown",
"id": "566d743e-0da2-4c4e-a546-ce928ea5a285",
"id": "28acc826-7cf4-4502-aba2-17fdb4d6aac5",
"metadata": {},
"source": [
"### FiberIntegrator has access to two main methods: \n",
"- integrate2d_grazing_incidence == integrate2d_fiber\n",
"- integrate1d_grazing_incidence == integrate1d_fiber"
"### **FiberIntegrator** API provides two main integration methods\n",
"`integrate2d_grazing_incidence` == `integrate2d_fiber`\n",
"\n",
"`integrate1d_grazing_incidence` == `integrate1d_fiber`"
]
},
{
"cell_type": "markdown",
"id": "eb2a6f3c-15c0-443e-8d6b-0dd8edb317d9",
"metadata": {},
"source": [
"#### The methods accept the following arguments:\n",
"\n",
"- `npt_oop` : Number of bins in the out-of-plane direction.\n",
"- `unit_oop` : Unit to be used as out-of-plane. By default: `qoop_nm^-1`\n",
"- `oop_range` : Range of integratin along the out-of-plane axis\n",
"- `npt_ip` : Number of bins in the in-plane direction\n",
"- `unit_ip` : Unit to be used as in-plane. By default: `qip_nm^-1`\n",
"- `ip_range` : Range of integratin along the in-plane axis\n",
"- `incident_angle` : tilting of the sample towards the beam (analog to rot2) (rads)\n",
"- `tilt_angle`: tilting of the sample orthogonal to the beam direction (analog to rot3) (rads)\n",
"- `sample_orientation`: 1-8, orientation of the fiber axis according to EXIF orientation values \n",
"\n",
"Only for integrate1d methods:\n",
"- `vertical_integration` : If True, integrates along unit_ip; if False, integrates along unit_oop"
]
},
{
Expand Down Expand Up @@ -298,11 +320,18 @@
],
"source": [
"iangle = 0.1\n",
"res_0 = fi.integrate2d_grazing_incidence(data=data, sample_orientation=6, incident_angle=iangle, unit_ip=\"qip_A^-1\", unit_oop=\"qoop_A^-1\")\n",
"res_0 = fi.integrate2d_grazing_incidence(data=data, \n",
" unit_ip=\"qip_A^-1\", unit_oop=\"qoop_A^-1\",\n",
" sample_orientation=6, incident_angle=iangle, \n",
" )\n",
"res_1 = fi.integrate2d_exitangles(data=data, sample_orientation=6, incident_angle=iangle)\n",
"res_2 = fi.integrate2d_exitangles(data=data, sample_orientation=6, incident_angle=iangle, angle_degrees=False)\n",
"res_2 = fi.integrate2d_exitangles(data=data, sample_orientation=6, incident_angle=iangle, \n",
" angle_degrees=False,\n",
" )\n",
"res_3 = fi.integrate2d_polar(data=data, sample_orientation=6, incident_angle=iangle)\n",
"res_4 = fi.integrate2d_polar(data=data, sample_orientation=6, incident_angle=iangle, polar_degrees=False, radial_unit=\"A^-1\", rotate=True)\n",
"res_4 = fi.integrate2d_polar(data=data, sample_orientation=6, incident_angle=iangle, \n",
" polar_degrees=False, \n",
" radial_unit=\"A^-1\", rotate=True)\n",
"\n",
"fig, axes = subplots(ncols=5, figsize=(20,4))\n",
"for ax, res in zip(axes.ravel(), [res_0, res_1, res_2, res_3, res_4]):\n",
Expand Down Expand Up @@ -745,9 +774,9 @@
"name": "stderr",
"output_type": "stream",
"text": [
"/tmp/ipykernel_830751/1134296278.py:8: UserWarning: The input coordinates to pcolormesh are interpreted as cell centers, but are not monotonically increasing or decreasing. This may lead to incorrectly calculated cell edges, in which case, please supply explicit cell edges to pcolormesh.\n",
"/tmp/ipykernel_1431066/1134296278.py:8: UserWarning: The input coordinates to pcolormesh are interpreted as cell centers, but are not monotonically increasing or decreasing. This may lead to incorrectly calculated cell edges, in which case, please supply explicit cell edges to pcolormesh.\n",
" ax[0].pcolormesh(arr_qxz, arr_qy, data, vmin=0, vmax=500)\n",
"/tmp/ipykernel_830751/1134296278.py:9: UserWarning: The input coordinates to pcolormesh are interpreted as cell centers, but are not monotonically increasing or decreasing. This may lead to incorrectly calculated cell edges, in which case, please supply explicit cell edges to pcolormesh.\n",
"/tmp/ipykernel_1431066/1134296278.py:9: UserWarning: The input coordinates to pcolormesh are interpreted as cell centers, but are not monotonically increasing or decreasing. This may lead to incorrectly calculated cell edges, in which case, please supply explicit cell edges to pcolormesh.\n",
" ax[1].pcolormesh(arr_qx, arr_qyz, data, vmin=0, vmax=500)\n"
]
},
Expand Down Expand Up @@ -785,7 +814,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"Total run-time: 41.899s\n"
"Total run-time: 66.154s\n"
]
}
],
Expand Down