<jupyter_start><jupyter_text>Center distribution (Figure 8)<jupyter_code># Import modules
import sys, h5py
import numpy as np
%matplotlib inline

# Import modules from src directory
sys.path.append("../src")
import plotting<jupyter_output><empty_output><jupyter_text>1. Loading data from file<jupyter_code>results_filename = '../meta/results.h5'
with h5py.File(results_filename, 'r') as f:
    diameter  = f['diameter'][:]
    intensity = f['intensity'][:]
    centerx   = f['centerx'][:]
    centery   = f['centery'][:]<jupyter_output><empty_output><jupyter_text>2. Converting units<jupyter_code># Correct for detector efficiency
intensity *= (1./0.955)

# Intensity in Nr. of photons
h = 6.62606957e-34 #Js
c = 299792458 #m/s
hc = h*c  #Jm
wavelength  = 0.22621e-9 #[m]
intensity_NrPhum2 = ((intensity / 1000.) * wavelength) / (hc)
intensity_NrPh    = intensity_NrPhum2 * np.pi * (1e-3*diameter/2.)**2
intensity = intensity_NrPhum2<jupyter_output><empty_output><jupyter_text>3. Plotting<jupyter_code>plot = plotting.Plot(fontsize=8, cols=3, rows=2, exclude=[0,1,3,4], 
                           axes_visible=False, colorbar=True, colorbar_left=True, save_pdf=True)
plot.add_axes((0,0), 2, 2, padx=-0.05)
plot.xlabel = [r'', r'', r'Horizontal phase tilt in mrad']
plot.ylabel = [r'', r'', r'Vertical phase tilt in mrad']
plot.title_label = 3*['']
plot.colorbar_label = r'Photon intensity [photons$/\mu$m$^2$]'
plot.set_axes_layout(plot.axes[0], visible=False)
plot.set_axes_layout(plot.axes[1], visible=False)
plot.plotting_a_heatmap(0, centerx - 0.018, centery - 0.008,
                        [(-0.7,0.8), (-1.4,0.5)], bins=[15, 19], cmaplist=['gray'], log=False)
plot.cb.outline.set_visible(False)
plot.axes[0].text(0.9, 0.5, '(b)', va='top', ha='left', fontsize=10)
plot.plotting_a_meanmap(1, centerx - 0.018, centery - 0.008,
                        intensity, [(-0.7,0.8), (-1.5,0.5)], bins=[15, 19], cmaplist=['viridis'], 
                        vmin=5e8, vmax=1e12, log=True)
plot.cb.outline.set_visible(False)
plot.cb.cmap.set_bad('0.65')

plot.axes[1].text(0.9, 0.5, '(c)', va='top', ha='left', fontsize=10)
plot.plotting_correlation3d(2, centerx - 0.018, centery - 0.008,
                            intensity, cmap='viridis', alpha=0.8, ms=5, scale_size=False, xlim=[-0.7,0.8],
                            ylim=[-1.4,0.5], vmin=5e8, vmax=1e12, log=True)
plot.cb.outline.set_visible(False)
plot.set_colorbar_layout(tickpos='left', direction='in', pad=5, labelpad=-50, ticks=None, color='black', 
                         ticklabels=None)
[plot.axes[2].axvline(i, color='0.0', ls=':', lw=0.5, alpha=1) for i in np.arange(-0.6,0.8,0.1)]
[plot.axes[2].axhline(i, color='0.0', ls=':', lw=0.5, alpha=1) for i in np.arange(-1.4,0.5,0.1)]
plot.axes[2].yaxis.tick_right()
plot.axes[2].yaxis.set_label_position("right")
plot.axes[2].set_xticklabels([])
plot.axes[2].set_yticklabels([])
plot.axes[2].text(-0.7, 0.62, '(a)', va='top', ha='left', fontsize=10)
plot.axes[2].set_axis_bgcolor('0.65')
plot.show()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.19598816178888523, 'fraction_numerical': 0.06609667872410391, 'mean_word_length': 4.15593220338983, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '4', 'dir': 'jupyter-structured-clean-dedup', 'id': '526508', 'license': 'BSD-2-Clause', 'n_tokens_mistral': 1352, 'n_tokens_neox': 1237, 'n_words': 209, 'path': 'ipynb/fig08_center_distribution.ipynb', 'repo_name': 'daurer/cxic9714-analysis', 'size': '3041'}