Skip to content

Commit

Permalink
Small quality of life improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
jadball committed Nov 6, 2024
1 parent 223d754 commit f159837
Show file tree
Hide file tree
Showing 7 changed files with 56 additions and 13 deletions.
3 changes: 2 additions & 1 deletion ImageD11/nbGui/S3DXRD/4_visualise.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,8 @@
"source": [
"# load phases from parameter file\n",
"\n",
"ds.phases = ds.get_phases_from_disk()"
"ds.phases = ds.get_phases_from_disk()\n",
"ds.phases.unitcells"
]
},
{
Expand Down
3 changes: 1 addition & 2 deletions ImageD11/nbGui/S3DXRD/5_combine_phases.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,7 @@
"source": [
"# load phases from parameter file\n",
"\n",
"phases = ds.get_phases_from_disk()\n",
"ds.phases = phases\n",
"ds.phases = ds.get_phases_from_disk()\n",
"ds.phases.unitcells"
]
},
Expand Down
20 changes: 16 additions & 4 deletions ImageD11/nbGui/S3DXRD/6_stack_layers.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,19 @@
"print(ds.shape)"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "8ea038db-b86c-4ce3-9117-83060f68351e",
"metadata": {},
"outputs": [],
"source": [
"# load phases from parameter file\n",
"\n",
"ds.phases = ds.get_phases_from_disk()\n",
"ds.phases.unitcells"
]
},
{
"cell_type": "code",
"execution_count": null,
Expand All @@ -95,12 +108,12 @@
"samples_dict = {}\n",
"\n",
"skips_dict = {\n",
" \"FeAu_0p5_tR_nscope\": [\"top_100um\", \"top_-100um\"]\n",
" ds.sample: []\n",
"}\n",
"\n",
"dset_prefix = \"top\"\n",
"\n",
"sample_list = [\"FeAu_0p5_tR_nscope\"]\n",
"sample_list = [ds.sample]\n",
"\n",
"for sample in sample_list:\n",
" all_dset_folders_for_sample = os.listdir(os.path.join(rawdata_path, sample))\n",
Expand All @@ -114,8 +127,7 @@
" samples_dict[sample] = dsets_list\n",
" \n",
"# manually override:\n",
"\n",
"samples_dict = {\"FeAu_0p5_tR_nscope\": [\"top_150um\", \"top_200um\", \"top_250um\"]}"
"# samples_dict = {\"FeAu_0p5_tR_nscope\": [\"top_150um\", \"top_200um\", \"top_250um\"]}"
]
},
{
Expand Down
3 changes: 2 additions & 1 deletion ImageD11/nbGui/S3DXRD/pbp_2_visualise.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,8 @@
"source": [
"# load phases from parameter file\n",
"\n",
"ds.phases = ds.get_phases_from_disk()"
"ds.phases = ds.get_phases_from_disk()\n",
"ds.phases.unitcells"
]
},
{
Expand Down
3 changes: 2 additions & 1 deletion ImageD11/nbGui/S3DXRD/pbp_3_refinement.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,8 @@
"source": [
"# load phases from parameter file\n",
"\n",
"ds.phases = ds.get_phases_from_disk()"
"ds.phases = ds.get_phases_from_disk()\n",
"ds.phases.unitcells"
]
},
{
Expand Down
4 changes: 2 additions & 2 deletions ImageD11/nbGui/S3DXRD/tomo_1_index.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -260,10 +260,10 @@
"\n",
"fig, ax = plt.subplots(figsize=(16, 9), constrained_layout=True)\n",
"\n",
"ax.plot( ucell.ringds, [1e4,]*len(ucell.ringds), '|', ms=90, c=\"red\")\n",
"\n",
"ax.plot(cf_4d.ds, cf_4d.sum_intensity,',', label='cf_4d')\n",
"ax.plot(cf_strong.ds, cf_strong.sum_intensity,',', label='cf_strong')\n",
"ax.plot( ucell.ringds, [1e4,]*len(ucell.ringds), '|', ms=90, c=\"red\")\n",
"\n",
"ax.semilogy()\n",
"\n",
"ax.set_xlabel(\"Dstar\")\n",
Expand Down
33 changes: 31 additions & 2 deletions ImageD11/nbGui/TDXRD/4_3DXRD_merge_slices.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,30 @@
"processed_data_root_dir = ds.analysisroot"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"ds.phases = ds.get_phases_from_disk()\n",
"ds.phases.unitcells"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# now let's select a phase to index from our parameters json\n",
"phase_str = 'Fe'\n",
"\n",
"ucell = ds.phases.unitcells[phase_str]\n",
"\n",
"print(ucell.lattice_parameters, ucell.spacegroup)"
]
},
{
"cell_type": "code",
"execution_count": null,
Expand Down Expand Up @@ -159,7 +183,7 @@
"source": [
"# load grains for each dataset and tie them to the dataset objects\n",
"for ds in ds_dict.values():\n",
" ds.grains = ds.get_grains_from_disk()"
" ds.grains = ds.get_grains_from_disk(phase_str)"
]
},
{
Expand Down Expand Up @@ -276,8 +300,13 @@
"\n",
"from xfab.symmetry import Umis\n",
"\n",
"# USER: Check the symmetry here\n",
"# crystal_system number must be one of 1: Triclinic, 2: Monoclinic, 3: Orthorhombic, 4: Tetragonal, 5: Trigonal, 6: Hexagonal, 7: Cubic\n",
"\n",
"crystal_system_number = 7 # cubic\n",
"\n",
"def misorien_deg(U1, U2):\n",
" return np.min(Umis(U1, U2, 7), axis=0)[1] # 7 == cubic\n",
" return np.min(Umis(U1, U2, crystal_system_number), axis=0)[1] # 7 == cubic\n",
"\n",
"matches = []\n",
"\n",
Expand Down

0 comments on commit f159837

Please sign in to comment.