Skip to content

Commit

Permalink
Update MACS_User_notebook.ipynb
Browse files Browse the repository at this point in the history
  • Loading branch information
thallor1 committed Feb 4, 2025
1 parent 9606e25 commit 51d8451
Showing 1 changed file with 15 additions and 31 deletions.
46 changes: 15 additions & 31 deletions docs/source/notebooks/MACS_User_notebook.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,17 @@
},
{
"cell_type": "code",
"execution_count": 79,
"execution_count": 1,
"id": "7a8918f4",
"metadata": {},
"outputs": [],
"source": [
"!pip install -q git+https://github.com/thallor1/pyMACS.git requests"
"#!pip install -q git+https://github.com/thallor1/pyMACS.git requests"
]
},
{
"cell_type": "code",
"execution_count": 80,
"execution_count": 2,
"id": "910b0952",
"metadata": {},
"outputs": [],
Expand All @@ -38,7 +38,7 @@
},
{
"cell_type": "code",
"execution_count": 81,
"execution_count": 3,
"id": "b641a6fa-635c-42d9-8f80-9e4e864189a4",
"metadata": {},
"outputs": [],
Expand All @@ -57,7 +57,7 @@
},
{
"cell_type": "code",
"execution_count": 82,
"execution_count": 4,
"id": "c124891d-e194-48b8-b4b1-2c0c0b9c8126",
"metadata": {
"editable": true,
Expand Down Expand Up @@ -111,7 +111,7 @@
},
{
"cell_type": "code",
"execution_count": 83,
"execution_count": 5,
"id": "df544de4-a1f5-4337-a40b-7dad043958d2",
"metadata": {},
"outputs": [
Expand Down Expand Up @@ -170,7 +170,7 @@
"name": "stderr",
"output_type": "stream",
"text": [
"/mnt/c/Users/tjh/OneDrive - NIST/GitHub/pyMACS/pyMACS/scripting/resfunc.py:588: UserWarning: FigureCanvasAgg is non-interactive, and thus cannot be shown\n",
"/home/tjh/mambaforge/envs/mantid/lib/python3.10/site-packages/pyMACS/scripting/resfunc.py:588: UserWarning: FigureCanvasAgg is non-interactive, and thus cannot be shown\n",
" fig.show()\n"
]
},
Expand Down Expand Up @@ -207,7 +207,7 @@
},
{
"cell_type": "code",
"execution_count": 84,
"execution_count": 6,
"id": "2164a7db-b31c-4ef2-8427-01d3deaade65",
"metadata": {},
"outputs": [],
Expand All @@ -230,15 +230,15 @@
},
{
"cell_type": "code",
"execution_count": 85,
"execution_count": 7,
"id": "d98cf19a-45ed-42d1-8f81-fcb8fb0e0cdd",
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"/tmp/ipykernel_32879/1738536076.py:61: UserWarning: FigureCanvasAgg is non-interactive, and thus cannot be shown\n",
"/tmp/ipykernel_95747/1738536076.py:61: UserWarning: FigureCanvasAgg is non-interactive, and thus cannot be shown\n",
" fig.show()\n"
]
},
Expand Down Expand Up @@ -329,20 +329,20 @@
},
{
"cell_type": "code",
"execution_count": 86,
"execution_count": 8,
"id": "ec9a8525-2394-4b6e-9fb0-ac2703ecae5b",
"metadata": {},
"outputs": [
{
"ename": "FileNotFoundError",
"evalue": "[Errno 2] No such file or directory: '/mnt/c/Users/tjh/OneDrive - NIST/GitHub/pyMACS/pyMACS/scripting/interp_fwhm/MACS_Ef_3p7_interp_dQx.pck'",
"evalue": "[Errno 2] No such file or directory: '/home/tjh/mambaforge/envs/mantid/lib/python3.10/site-packages/pyMACS/scripting/interp_fwhm/MACS_Ef_3p7_interp_dQx.pck'",
"output_type": "error",
"traceback": [
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[0;31mFileNotFoundError\u001b[0m Traceback (most recent call last)",
"Cell \u001b[0;32mIn[86], line 6\u001b[0m\n\u001b[1;32m 4\u001b[0m omegas \u001b[38;5;241m=\u001b[39m np\u001b[38;5;241m.\u001b[39mlinspace(\u001b[38;5;241m0\u001b[39m,\u001b[38;5;241m10\u001b[39m,\u001b[38;5;241m50\u001b[39m)\n\u001b[1;32m 5\u001b[0m macs_instr\u001b[38;5;241m.\u001b[39mkidney\u001b[38;5;241m.\u001b[39mEf\u001b[38;5;241m=\u001b[39mmacsEf\n\u001b[0;32m----> 6\u001b[0m interp_dQx, interp_dQz, interp_dE \u001b[38;5;241m=\u001b[39m \u001b[43mmacs_instr\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mload_res_fwhm_interp_objects\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 7\u001b[0m \u001b[38;5;66;03m#These interpolators require input in terms of lab fram, not H,K,L. This is done in the following way.\u001b[39;00m\n\u001b[1;32m 8\u001b[0m qx1,qz1 \u001b[38;5;241m=\u001b[39m macs_instr\u001b[38;5;241m.\u001b[39msample\u001b[38;5;241m.\u001b[39mHKL_to_QxQz(H1,K1,L1)\n",
"File \u001b[0;32m/mnt/c/Users/tjh/OneDrive - NIST/GitHub/pyMACS/pyMACS/virtualMACS.py:1094\u001b[0m, in \u001b[0;36mVirtualMACS.load_res_fwhm_interp_objects\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 1092\u001b[0m f_dQx \u001b[38;5;241m=\u001b[39m interp_dir\u001b[38;5;241m+\u001b[39m\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mMACS_Ef_3p7_interp_dQx.pck\u001b[39m\u001b[38;5;124m\"\u001b[39m\n\u001b[1;32m 1093\u001b[0m f_dQz \u001b[38;5;241m=\u001b[39m interp_dir\u001b[38;5;241m+\u001b[39m\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mMACS_Ef_3p7_interp_dQz.pck\u001b[39m\u001b[38;5;124m\"\u001b[39m\n\u001b[0;32m-> 1094\u001b[0m \u001b[38;5;28;01mwith\u001b[39;00m \u001b[38;5;28;43mopen\u001b[39;49m\u001b[43m(\u001b[49m\u001b[43mf_dQx\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43mrb\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m)\u001b[49m \u001b[38;5;28;01mas\u001b[39;00m input_file:\n\u001b[1;32m 1095\u001b[0m interp_dQx \u001b[38;5;241m=\u001b[39m pickle\u001b[38;5;241m.\u001b[39mload(input_file)\n\u001b[1;32m 1096\u001b[0m \u001b[38;5;28;01mwith\u001b[39;00m \u001b[38;5;28mopen\u001b[39m(f_dQz, \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mrb\u001b[39m\u001b[38;5;124m\"\u001b[39m) \u001b[38;5;28;01mas\u001b[39;00m input_file:\n",
"\u001b[0;31mFileNotFoundError\u001b[0m: [Errno 2] No such file or directory: '/mnt/c/Users/tjh/OneDrive - NIST/GitHub/pyMACS/pyMACS/scripting/interp_fwhm/MACS_Ef_3p7_interp_dQx.pck'"
"Cell \u001b[0;32mIn[8], line 6\u001b[0m\n\u001b[1;32m 4\u001b[0m omegas \u001b[38;5;241m=\u001b[39m np\u001b[38;5;241m.\u001b[39mlinspace(\u001b[38;5;241m0\u001b[39m,\u001b[38;5;241m10\u001b[39m,\u001b[38;5;241m50\u001b[39m)\n\u001b[1;32m 5\u001b[0m macs_instr\u001b[38;5;241m.\u001b[39mkidney\u001b[38;5;241m.\u001b[39mEf\u001b[38;5;241m=\u001b[39mmacsEf\n\u001b[0;32m----> 6\u001b[0m interp_dQx, interp_dQz, interp_dE \u001b[38;5;241m=\u001b[39m \u001b[43mmacs_instr\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mload_res_fwhm_interp_objects\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 7\u001b[0m \u001b[38;5;66;03m#These interpolators require input in terms of lab fram, not H,K,L. This is done in the following way.\u001b[39;00m\n\u001b[1;32m 8\u001b[0m qx1,qz1 \u001b[38;5;241m=\u001b[39m macs_instr\u001b[38;5;241m.\u001b[39msample\u001b[38;5;241m.\u001b[39mHKL_to_QxQz(H1,K1,L1)\n",
"File \u001b[0;32m~/mambaforge/envs/mantid/lib/python3.10/site-packages/pyMACS/virtualMACS.py:1094\u001b[0m, in \u001b[0;36mVirtualMACS.load_res_fwhm_interp_objects\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 1092\u001b[0m f_dQx \u001b[38;5;241m=\u001b[39m interp_dir\u001b[38;5;241m+\u001b[39m\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mMACS_Ef_3p7_interp_dQx.pck\u001b[39m\u001b[38;5;124m\"\u001b[39m\n\u001b[1;32m 1093\u001b[0m f_dQz \u001b[38;5;241m=\u001b[39m interp_dir\u001b[38;5;241m+\u001b[39m\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mMACS_Ef_3p7_interp_dQz.pck\u001b[39m\u001b[38;5;124m\"\u001b[39m\n\u001b[0;32m-> 1094\u001b[0m \u001b[38;5;28;01mwith\u001b[39;00m \u001b[38;5;28;43mopen\u001b[39;49m\u001b[43m(\u001b[49m\u001b[43mf_dQx\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43mrb\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m)\u001b[49m \u001b[38;5;28;01mas\u001b[39;00m input_file:\n\u001b[1;32m 1095\u001b[0m interp_dQx \u001b[38;5;241m=\u001b[39m pickle\u001b[38;5;241m.\u001b[39mload(input_file)\n\u001b[1;32m 1096\u001b[0m \u001b[38;5;28;01mwith\u001b[39;00m \u001b[38;5;28mopen\u001b[39m(f_dQz, \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mrb\u001b[39m\u001b[38;5;124m\"\u001b[39m) \u001b[38;5;28;01mas\u001b[39;00m input_file:\n",
"\u001b[0;31mFileNotFoundError\u001b[0m: [Errno 2] No such file or directory: '/home/tjh/mambaforge/envs/mantid/lib/python3.10/site-packages/pyMACS/scripting/interp_fwhm/MACS_Ef_3p7_interp_dQx.pck'"
]
}
],
Expand Down Expand Up @@ -373,22 +373,6 @@
"ax.set_title(f\"Energy Resolution at [{H1:.2f},{K1:.2f},{L1:.2f}] point, MACS Ef={macsEf}\",fontsize=10)\n",
"\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "4a0c237f-7ce1-4d1d-a72d-b8aba53a4911",
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"id": "d3b59da7-183f-4969-828d-63a6f7ba9963",
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
Expand Down

0 comments on commit 51d8451

Please sign in to comment.