Merged Ptychography.py from cfelsgi