diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 36c537f..712d3b7 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -1,7 +1,11 @@ - + + + + + + + + + + + + + @@ -89,6 +120,10 @@ 7 diff --git a/dist/dylab-0.0.1-py3-none-any.whl b/dist/dylab-0.0.1-py3-none-any.whl deleted file mode 100644 index 9a71692..0000000 Binary files a/dist/dylab-0.0.1-py3-none-any.whl and /dev/null differ diff --git a/dist/dylab-0.0.1.tar.gz b/dist/dylab-0.0.1.tar.gz deleted file mode 100644 index 4fe1771..0000000 Binary files a/dist/dylab-0.0.1.tar.gz and /dev/null differ diff --git a/dylab.egg-info/PKG-INFO b/dylab.egg-info/PKG-INFO deleted file mode 100644 index 7913b9d..0000000 --- a/dylab.egg-info/PKG-INFO +++ /dev/null @@ -1,17 +0,0 @@ -Metadata-Version: 2.1 -Name: dylab -Version: 0.0.1 -Summary: An internal toolbox package used for analyzation data of an ultracold atom experiment. -Home-page: UNKNOWN -Author: QF-group (AG Chomaz), Heidelberg university -Author-email: gao@physi.uni-heidelberg.de -License: UNKNOWN -Platform: UNKNOWN -Classifier: Programming Language :: Python :: 3 -Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3) -Classifier: Operating System :: OS Independent -Description-Content-Type: text/markdown -License-File: LICENSE - -UNKNOWN - diff --git a/dylab.egg-info/SOURCES.txt b/dylab.egg-info/SOURCES.txt deleted file mode 100644 index 3b0df75..0000000 --- a/dylab.egg-info/SOURCES.txt +++ /dev/null @@ -1,14 +0,0 @@ -LICENSE -README.md -setup.py -dylab/AbsorptionImaging.py -dylab/Camera.py -dylab/DyTransition.py -dylab/Fitting.py -dylab/FittingFunction.py -dylab/TransitionClass.py -dylab/__init__.py -dylab.egg-info/PKG-INFO -dylab.egg-info/SOURCES.txt -dylab.egg-info/dependency_links.txt -dylab.egg-info/top_level.txt \ No newline at end of file diff --git a/dylab.egg-info/dependency_links.txt b/dylab.egg-info/dependency_links.txt deleted file mode 100644 index 8b13789..0000000 --- a/dylab.egg-info/dependency_links.txt +++ /dev/null @@ -1 +0,0 @@ - diff --git a/dylab.egg-info/top_level.txt b/dylab.egg-info/top_level.txt deleted file mode 100644 index e1da2e6..0000000 --- a/dylab.egg-info/top_level.txt +++ /dev/null @@ -1 +0,0 @@ -dylab diff --git a/dylab/AbsorptionImaging.py b/dylab/AbsorptionImaging.py index d8e6892..2c4513d 100644 --- a/dylab/AbsorptionImaging.py +++ b/dylab/AbsorptionImaging.py @@ -52,6 +52,13 @@ class absorption_imaging: self.image_dark = None self.image_absorption = None + # + self.image_absorption_cut = None + self.x_start = None + self.y_start = None + self.x_end = None + self.y_end = None + # import the data of transition # The transition should be an object of TransitionClass.py in module TransitionConstant # self.transition = transition @@ -93,10 +100,6 @@ class absorption_imaging: self.image_background = self.image_background.astype(float) self.image_dark = self.image_dark.astype(float) - if not (self.intensity is None): - intensity = np.ones(self.image_atoms.shape) - self.intensity = intensity * self.intensity - def close(self): self.save() @@ -107,6 +110,19 @@ class absorption_imaging: if self.atom_number is not None: self.data_handle.save_result('atom_number', self.atom_number, 'results/absorption_imaging/') + # select the effective data in an rectangle area defined by coordinates of two conner + # The select region will be presented as a red box in the plotting + def select_effective_data(self, left_up_conner, right_down_conner): + + self.x_start = left_up_conner[0] + self.x_end = right_down_conner[0] + self.y_start = left_up_conner[1] + self.y_end = right_down_conner[1] + + self.image_absorption_cut = self.image_absorption[self.y_start:self.y_end, self.x_start:self.x_end] + + return self.image_absorption_cut + # The function do the analyzation for absorption imaging # It will return a two-dimensional array, which stores the absorption imaging def get_image_absorption(self): @@ -155,14 +171,22 @@ class absorption_imaging: if self.atom_number is not None and not force_to_run: return self.atom_number - if self.image_absorption is None and not force_to_run: + if self.image_absorption is None or not force_to_run: self.image_absorption = self.get_image_absorption() - OD_act = self.image_absorption + if self.image_absorption_cut is None: + self.image_absorption_cut = self.image_absorption + self.x_start = 0 + self.x_end = self.image_absorption.shape[1] + self.y_start = 0 + self.y_end = self.image_absorption.shape[0] + + OD_act = self.image_absorption_cut cross_section = self.transition.get_cross_section(self.detuning, self.intensity) - self.atom_number = np.sum(cross_section * OD_act) * self.camera['pixel_size_V'] * self.camera['pixel_size_H'] + self.atom_number = np.sum(1 / cross_section * OD_act) * self.camera['pixel_size_V'] * self.camera[ + 'pixel_size_H'] return self.atom_number @@ -171,7 +195,7 @@ class absorption_imaging: cmap = plt.cm.get_cmap("jet") - grid = plt.GridSpec(3, 3, wspace=0.2, hspace=0.2) + grid = plt.GridSpec(3, 3, wspace=0.3, hspace=0.3) ax1 = plt.subplot(grid[0, 0]) pos = ax1.imshow(self.image_atoms, cmap=cmap) @@ -188,9 +212,19 @@ class absorption_imaging: ax3.set_title('Dark') plt.colorbar(pos, ax=ax3) - ax4 = plt.subplot(grid[0:3, 1:3]) + ax4 = plt.subplot(grid[0:2, 1:3]) pos = ax4.imshow(self.image_absorption, cmap=cmap, vmin=vmin, vmax=vmax) ax4.set_title('Absorption Imaging') plt.colorbar(pos, ax=ax4) + ax4.plot([self.x_start, self.x_start], [self.y_start, self.y_end], color='black') + ax4.plot([self.x_end, self.x_end], [self.y_start, self.y_end], color='black') + ax4.plot([self.x_start, self.x_end], [self.y_start, self.y_start], color='black') + ax4.plot([self.x_start, self.x_end], [self.y_end, self.y_end], color='black') + + ax5 = plt.subplot(grid[2:3, 1:3]) + atom_number_str = '{:g}'.format(self.atom_number) + ax5.text(0, 0.55, 'Atom Number : '+atom_number_str, horizontalalignment='left', verticalalignment='center', + transform=ax5.transAxes, fontsize=40) + plt.axis('off') plt.show() diff --git a/test_absorption_imaging.py b/test_absorption_imaging.py index 5afff5a..f0837aa 100644 --- a/test_absorption_imaging.py +++ b/test_absorption_imaging.py @@ -8,6 +8,7 @@ mot_3D_camera = Camera.c11440_36u(absorption_imaging_transition['wavelength']) with AbsorptionImaging.absorption_imaging(path, 'MOT_3D_Camera', 'in_situ_absorption', absorption_imaging_transition, mot_3D_camera, 0, 0) as absorption_image: - absorption_image.plot_result(-0.05, 0.03) + absorption_image.select_effective_data((800, 500), (1000, 700)) + absorption_image.plot_result(-0.05, 0.05) print(absorption_image.atom_number)