Skip to content

Commit

Permalink
Replace o_raw with omega in plot
Browse files Browse the repository at this point in the history
  • Loading branch information
jadball committed Nov 5, 2024
1 parent 86fc7f0 commit d79c95c
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions ImageD11/nbGui/TDXRD/3_3DXRD_look_at_peaks.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@
"\n",
"fig, ax = plt.subplots()\n",
"ax.scatter(cf_3d.fc[selected_grain.mask_3d], cf_3d.sc[selected_grain.mask_3d], marker=\"X\", c=cf_3d.omega[selected_grain.mask_3d], label='Merged 3D peak')\n",
"cols = ax.scatter(cf_2d.fc[selected_grain.mask_2d], cf_2d.sc[selected_grain.mask_2d], c=cf_2d.o_raw[selected_grain.mask_2d], s=cf_2d.s_I[selected_grain.mask_2d] / 5000, label='Contibutory 2D peaks')\n",
"cols = ax.scatter(cf_2d.fc[selected_grain.mask_2d], cf_2d.sc[selected_grain.mask_2d], c=cf_2d.omega[selected_grain.mask_2d], s=cf_2d.s_I[selected_grain.mask_2d] / 5000, label='Contibutory 2D peaks')\n",
"fig.colorbar(cols)\n",
"ax.set_xlim(0, 2048)\n",
"ax.set_ylim(0, 2048)\n",
Expand All @@ -193,22 +193,22 @@
"# take the selected grain\n",
"# get the omega value (corresponding to some image frame) with the most associated 2D peaks\n",
"\n",
"unique, counts = np.unique(cf_2d.o_raw[selected_grain.mask_2d], return_counts=True)\n",
"unique, counts = np.unique(cf_2d.omega[selected_grain.mask_2d], return_counts=True)\n",
"hits_dict = dict(zip(unique, counts))\n",
"hits_dict_max = sorted(hits_dict.items(), key=lambda x: x[1], reverse=True)[0]\n",
"max_omega, peaks_on_frame = hits_dict_max\n",
"\n",
"# mask all the omega values for the 2D peaks of the selected grain\n",
"# so we are only selecting those of max_omega\n",
"\n",
"omega_mask = cf_2d.o_raw[selected_grain.mask_2d] == max_omega\n",
"omega_mask = cf_2d.omega[selected_grain.mask_2d] == max_omega\n",
"\n",
"# now extract the fast, slow and omega values of the peaks\n",
"# we are chaining masks together\n",
"# we are first selecting 2D peaks for the selected grain with [selected_grain.mask_2d]\n",
"# then we are selecting those with the correct omega value with [omega_mask]\n",
"\n",
"fast, slow, omega = cf_2d.f_raw[selected_grain.mask_2d][omega_mask], cf_2d.s_raw[selected_grain.mask_2d][omega_mask], cf_2d.o_raw[selected_grain.mask_2d][omega_mask]\n",
"fast, slow, omega = cf_2d.f_raw[selected_grain.mask_2d][omega_mask], cf_2d.s_raw[selected_grain.mask_2d][omega_mask], cf_2d.omega[selected_grain.mask_2d][omega_mask]\n",
"\n",
"# print(fast, slow, omega)\n",
"\n",
Expand Down Expand Up @@ -450,7 +450,7 @@
"# avg_i, /* Average intensity */\n",
"# f_raw, /* fast centre of mass */\n",
"# s_raw, /* slow centre of mass */\n",
"# o_raw, /* omega centre of mass */\n",
"# omega, /* omega centre of mass */\n",
"# m_ss, /* moments */\n",
"# m_ff,\n",
"# m_oo,\n",
Expand Down

0 comments on commit d79c95c

Please sign in to comment.