ptypy.simulations package

Submodules

ptypy.simulations.detector module

Detector module

Note that “dark current” and consequently exposure time is not used. Modern detectors are insensitive to dark current. Scale the incoming Intensity accordingly to match the number of photons in your acquisition.

This file is part of the PTYPY package.

copyright

Copyright 2014 by the PTYPY team, see AUTHORS.

license

see LICENSE for details.

class ptypy.simulations.detector.Detector(pars=None)

Bases: object

filter(intensity_stack, convert_dtype=False)
ptypy.simulations.detector.conv(A, inp, **kwargs)
ptypy.simulations.detector.fill2D(imA, imB, offset)

fill array imA with imB

ptypy.simulations.detector.shot(I, exp=0.1, flux=100000.0, sensitivity=1.0, dark_c=None, io_noise=0.0, full_well=1023, el_per_ADU=1.0, offset=50.0)

I : intensity distribution flux : overall photon photons per seconds coming in exp : exposition time in sec io_noise : readout noise rms full_well : electron capacity of each pixel el_per_ADU : conversion effficiency of electrons to digitally counted units dark_curr : electrons per second per pixel on average

ptypy.simulations.ptysim_utils module

Utilities for the simulation package.

This file is part of the PTYPY package.

copyright

Copyright 2014 by the PTYPY team, see AUTHORS.

license

see LICENSE for details.

ptypy.simulations.ptysim_utils.exp_positions(positions, drift=0.0, scale=0.0, noise=0.0)

Takes postion array and messes around with it

ptypy.simulations.simscan module

Simulation of ptychographic datasets.

This file is part of the PTYPY package.

copyright

Copyright 2014 by the PTYPY team, see AUTHORS.

license

see LICENSE for details.

class ptypy.simulations.simscan.SimScan(pars=None, **kwargs)

Bases: ptypy.core.data.PtyScan

Simulates a ptychographic scan and acts as Virtual data source.

Parameters

pars (Param) – PtyScan parameters. See scandata.SimScan.

DEFAULT = {'add_poisson_noise': False, 'auto_center': None, 'center': 'fftshift', 'chunk_format': '.chunk%02d', 'detector': {}, 'dfile': None, 'distance': 7.19, 'energy': 7.2, 'experimentID': None, 'frame_size': None, 'illumination': {'aperture': {'central_stop': None, 'diffuser': None, 'edge': 2.0, 'form': 'circ', 'offset': 0.0, 'rotate': 0.0, 'size': None}, 'diversity': {'noise': (0.5, 1.0), 'power': 0.1, 'shift': None}, 'model': None, 'photons': None, 'propagation': {'antialiasing': 1, 'focussed': None, 'parallel': None, 'spot_size': None}, 'recon': {'label': None, 'rfile': '\\*.ptyr'}}, 'label': None, 'load_parallel': 'data', 'min_frames': 1, 'name': 'SimScan', 'num_frames': None, 'orientation': None, 'plot': True, 'pos_drift': 0.0, 'pos_noise': 1e-10, 'pos_scale': 0.0, 'positions_theory': None, 'propagation': 'farfield', 'psf': None, 'psize': 0.000172, 'rebin': None, 'sample': {'diversity': {'noise': None, 'power': 0.1, 'shift': None}, 'fill': 1, 'model': None, 'process': {'density': 1, 'formula': None, 'offset': (0, 0), 'ref_index': (0.5, 0.0), 'smoothing': 2, 'thickness': 1e-06, 'zoom': None}, 'recon': {'rfile': '\\*.ptyr'}, 'stxm': {'label': None}}, 'save': None, 'shape': 256, 'verbose_level': 1, 'version': 0.1, 'xy': {'count': None, 'extent': 1.5e-05, 'jitter': None, 'model': None, 'offset': 0.0, 'override': None, 'spacing': 1.5e-06, 'steps': 10}}
load(indices)

Load data, weights and positions from internal dictionarys

manipulate_ptycho(ptycho)

Overwrite in child class for inline manipulation of the ptycho instance that is created by the Simulation

Module contents

Ptychographic simulation module.

This file is part of the PTYPY package.

copyright

Copyright 2014 by the PTYPY team, see AUTHORS.

license

see LICENSE for details.