Skip to content

Commit

Permalink
Merge pull request #8 from ePSIC-DLS/master
Browse files Browse the repository at this point in the history
Update branch
  • Loading branch information
M0hsend authored Dec 7, 2020
2 parents 5df510f + 141b1da commit 146aa27
Show file tree
Hide file tree
Showing 13 changed files with 387 additions and 87 deletions.
1 change: 0 additions & 1 deletion docs/build/html/.nojekyll

This file was deleted.

1 change: 0 additions & 1 deletion docs/build/html/searchindex.js

This file was deleted.

3 changes: 3 additions & 0 deletions docs/getting_started.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.. _getting_started:

Work in progress.
2 changes: 2 additions & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ Welcome to epsic_tools's documentation!
.. toctree::
:maxdepth: -1
:caption: Contents:

getting_started.rst


Indices and tables
Expand Down
46 changes: 46 additions & 0 deletions docs/source/epsic_tools.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
epsic\_tools package
====================

Subpackages
-----------

.. toctree::

epsic_tools.signals
epsic_tools.toolbox

Submodules
----------

epsic\_tools.api module
-----------------------

.. automodule:: epsic_tools.api
:members:
:undoc-members:
:show-inheritance:

epsic\_tools.build\_params module
---------------------------------

.. automodule:: epsic_tools.build_params
:members:
:undoc-members:
:show-inheritance:

epsic\_tools.ptychography2D module
----------------------------------

.. automodule:: epsic_tools.ptychography2D
:members:
:undoc-members:
:show-inheritance:


Module contents
---------------

.. automodule:: epsic_tools
:members:
:undoc-members:
:show-inheritance:
10 changes: 10 additions & 0 deletions docs/source/epsic_tools.signals.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
epsic\_tools.signals package
============================

Module contents
---------------

.. automodule:: epsic_tools.signals
:members:
:undoc-members:
:show-inheritance:
70 changes: 70 additions & 0 deletions docs/source/epsic_tools.toolbox.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
epsic\_tools.toolbox package
============================

Submodules
----------

epsic\_tools.toolbox.define\_probe\_function module
---------------------------------------------------

.. automodule:: epsic_tools.toolbox.define_probe_function
:members:
:undoc-members:
:show-inheritance:

epsic\_tools.toolbox.make\_merlin\_mask module
----------------------------------------------

.. automodule:: epsic_tools.toolbox.make_merlin_mask
:members:
:undoc-members:
:show-inheritance:

epsic\_tools.toolbox.make\_merlin\_mask\_test module
----------------------------------------------------

.. automodule:: epsic_tools.toolbox.make_merlin_mask_test
:members:
:undoc-members:
:show-inheritance:

epsic\_tools.toolbox.ptycho\_utils module
-----------------------------------------

.. automodule:: epsic_tools.toolbox.ptycho_utils
:members:
:undoc-members:
:show-inheritance:

epsic\_tools.toolbox.radial\_profile module
-------------------------------------------

.. automodule:: epsic_tools.toolbox.radial_profile
:members:
:undoc-members:
:show-inheritance:

epsic\_tools.toolbox.sim\_utils module
--------------------------------------

.. automodule:: epsic_tools.toolbox.sim_utils
:members:
:undoc-members:
:show-inheritance:

epsic\_tools.toolbox.warp\_3d module
------------------------------------

.. automodule:: epsic_tools.toolbox.warp_3d
:members:
:undoc-members:
:show-inheritance:


Module contents
---------------

.. automodule:: epsic_tools.toolbox
:members:
:undoc-members:
:show-inheritance:
7 changes: 7 additions & 0 deletions docs/source/modules.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
epsic_tools
===========

.. toctree::
:maxdepth: 4

epsic_tools
2 changes: 2 additions & 0 deletions epsic_tools/build_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,8 @@ def init_ptyrex():
params['process']['common']['scan']['dR'] = [1e-11, 1e-11]

params['process']['common']['scan']['N'] = [64,64]

params['process']['common']['scan']['region'] = [0.0 , 1.0, 0.0, 1.0, 1, 1]



Expand Down
46 changes: 44 additions & 2 deletions epsic_tools/ptychography2D.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,16 @@ def set_save_interval(self, val):

def get_iterations(self):
return self.ptyrex['process']['PIE']['iterations']

def get_scan_refine_start(self):
return self.ptyrex['process']['PIE']['scan']['start']

def set_scan_refine_start(self, val):
if int(val) == val:
self.ptyrex['process']['PIE']['scan']['start'] = val
else:
raise ValueError("scan refine start must be an integer")


def get_decay(self):
return self.ptyrex['process']['PIE']['decay']
Expand Down Expand Up @@ -226,9 +236,29 @@ def set_load_probe_path(self, val):
else:
raise ValueError("probe path must be a string")

def get_probe_start(self):
return self.ptyrex['process']['PIE']['probe']['start']

def set_probe_start(self, val):
#todo : check if path is valid here??
if is_number(val) == True:
self.ptyrex['process']['PIE']['probe']['start'] = val
else:
raise ValueError("probe start must be a number")

def get_probe_alpha(self):
return self.ptyrex['process']['PIE']['probe']['alpha']

def set_probe_alpha(self, val):
#todo : check if path is valid here??
if is_number(val) == True:
self.ptyrex['process']['PIE']['probe']['alpha'] = val
else:
raise ValueError("probe alpha must be a number")

def get_load_object_flag(self):
return self.ptyrex['process']['common']['object']['load_flag']

def set_load_object_flag(self, val):
if val == 1 or val == 0:
self.ptyrex['process']['common']['object']['load_flag'] = val
Expand Down Expand Up @@ -270,7 +300,19 @@ def set_scan_size(self, val):
self.ptyrex['process']['common']['scan']['N'] = val
else:
raise ValueError("scan size must take the form [x, y]")


def set_scan_region(self, val):
#scan region must take the form [x_start,x_end, y_start, y_end, x_step, y_step]
#start 0.0 = first px
#end 1.0 = last px
if len(val) == 6:
self.ptyrex['process']['common']['scan']['region'] = val
else:
raise ValueError("scan region must take the form [x_start,x_end, y_start, y_end, x_step, y_step]")

def get_scan_region(self, val):
return self.ptyrex['process']['common']['scan']['region']

def get_load_data_flag(self):
return self.ptyrex['experiment']['data']['load_flag']

Expand Down
Loading

0 comments on commit 146aa27

Please sign in to comment.