.. _parameters: ************************ Parameter tree structure ************************ .. note:: This section needs to be reworked to account for the recursive nature for |ptypy|_'s parameter tree. Please use the examples in the templates folder to craft your own scripts. io == .. py:data:: io (Param) *default* = ``Param({})`` io.interaction -------------- .. py:data:: io.interaction (Param) *default* = ``Param({})`` .. py:data:: io.interaction.server (Param) *default* = ``Param({})`` .. py:data:: io.interaction.server.active (bool) Activation switch Set to ``False`` for no ZeroMQ interaction server *default* = ``True`` .. py:data:: io.interaction.server.address (str) The address the server is listening to. Wenn running ptypy on a remote server, it is the servers network address. *default* = ``'tcp://127.0.0.1'`` .. py:data:: io.interaction.server.port (int) The port the server is listening to. Make sure to pick an unused port with a few unused ports close to it. *default* = ``5560`` .. py:data:: io.interaction.server.connections (int) Number of concurrent connections on the server A range ``[port : port+connections]`` of ports adjacent :py:data:`~.io.interaction.port` will be opened on demand for connecting clients. *default* = ``10`` .. py:data:: io.interaction.server.poll_timeout (float) Network polling interval Network polling interval, in milliseconds. *default* = ``10.0`` .. py:data:: io.interaction.server.pinginterval (float) Interval to check pings Interval with which to check pings, in seconds. *default* = ``2`` .. py:data:: io.interaction.server.pingtimeout (float) Ping time out Ping time out: client disconnected after this period, in seconds. *default* = ``10`` .. py:data:: io.interaction.client (Param) *default* = ``Param({})`` .. py:data:: io.interaction.client.address (str) The address the server is listening to. Wenn running ptypy on a remote server, it is the servers network address. *default* = ``'tcp://127.0.0.1'`` .. py:data:: io.interaction.client.port (int) The port the server is listening to. Make sure to pick an unused port with a few unused ports close to it. *default* = ``5560`` .. py:data:: io.interaction.client.poll_timeout (float) Network polling interval Network polling interval, in milliseconds. *default* = ``100.0`` .. py:data:: io.interaction.client.pinginterval (float) Interval to check pings Interval with which to check pings, in seconds. *default* = ``1`` .. py:data:: io.interaction.client.connection_timeout (float) Timeout for dead server Timeout for dead server, in milliseconds. *default* = ``3600000.0`` scandata ======== .. py:data:: scandata (Param) *default* = ``Param({})`` scandata.PtyScan ---------------- .. py:data:: scandata.PtyScan (Param) *default* = ``Param({})`` .. py:data:: scandata.PtyScan.name (str) *default* = ``'PtyScan'`` .. py:data:: scandata.PtyScan.dfile (str) File path where prepared data will be saved in the ``ptyd`` format. *default* = ``None`` .. py:data:: scandata.PtyScan.chunk_format (str) Appendix to saved files if save == 'link' *default* = ``'.chunk%02d'`` .. py:data:: scandata.PtyScan.save (str) Saving mode Mode to use to save data to file. - ``None``: No saving - ``'merge'``: attemts to merge data in single chunk **[not implemented]** - ``'append'``: appends each chunk in master \*.ptyd file - ``'link'``: appends external links in master \*.ptyd file and stores chunks separately in the path given by the link. Links file paths are relative to master file. *default* = ``None`` .. py:data:: scandata.PtyScan.auto_center (bool) Determine if center in data is calculated automatically - ``False``, no automatic centering - ``None``, only if :py:data:`center` is ``None`` - ``True``, it will be enforced *default* = ``None`` .. py:data:: scandata.PtyScan.load_parallel (str) Determines what will be loaded in parallel Choose from ``None``, ``'data'``, ``'common'``, ``'all'`` *default* = ``'data'`` .. py:data:: scandata.PtyScan.rebin (int) Rebinning factor Rebinning factor for the raw data frames. ``'None'`` or ``1`` both mean *no binning* *default* = ``None (>1, <32)`` .. py:data:: scandata.PtyScan.orientation (int, tuple, list) Data frame orientation Choose - ``None`` or ``0``: correct orientation - ``1``: invert columns (numpy.flip_lr) - ``2``: invert rows (numpy.flip_ud) - ``3``: invert columns, invert rows - ``4``: transpose (numpy.transpose) - ``4+i``: tranpose + other operations from above Alternatively, a 3-tuple of booleans may be provided ``(do_transpose, do_flipud, do_fliplr)`` *default* = ``None`` .. py:data:: scandata.PtyScan.min_frames (int) Minimum number of frames loaded by each node *default* = ``1 (>1)`` .. py:data:: scandata.PtyScan.positions_theory (ndarray) Theoretical positions for this scan If provided, experimental positions from :py:class:`PtyScan` subclass will be ignored. If data preparation is called from Ptycho instance, the calculated positions from the :py:func:`ptypy.core.xy.from_pars` dict will be inserted here *default* = ``None`` .. py:data:: scandata.PtyScan.num_frames (int) Maximum number of frames to be prepared If `positions_theory` are provided, num_frames will be ovverriden with the number of positions available *default* = ``None`` .. py:data:: scandata.PtyScan.label (str) The scan label Unique string identifying the scan *default* = ``None`` .. py:data:: scandata.PtyScan.experimentID (str) Name of the experiment If None, a default value will be provided by the recipe. **unused** *default* = ``None`` .. py:data:: scandata.PtyScan.version (float) TODO: Explain this and decide if it is a user parameter. *default* = ``0.1`` .. py:data:: scandata.PtyScan.shape (int, tuple) Shape of the region of interest cropped from the raw data. Cropping dimension of the diffraction frame Can be None, (dimx, dimy), or dim. In the latter case shape will be (dim, dim). *default* = ``256`` .. py:data:: scandata.PtyScan.center (list, tuple, str) Center (pixel) of the optical axes in raw data If ``None``, this parameter will be set by :py:data:`~.scan.data.auto_center` or elsewhere *default* = ``'fftshift'`` .. py:data:: scandata.PtyScan.psize (float, tuple) Detector pixel size Dimensions of the detector pixels (in meters) *default* = ``0.000172 (>0.0)`` .. py:data:: scandata.PtyScan.distance (float) Sample to detector distance In meters. *default* = ``7.19 (>0.0)`` .. py:data:: scandata.PtyScan.energy (float) Photon energy of the incident radiation in keV *default* = ``7.2 (>0.0)`` .. py:data:: scandata.PtyScan.add_poisson_noise (bool) Decides whether the scan should have poisson noise or not *default* = ``False`` scandata.PtydScan ----------------- .. py:data:: scandata.PtydScan (Param) *default* = ``Param({})`` .. py:data:: scandata.PtydScan.name (str) *default* = ``'PtydScan'`` .. py:data:: scandata.PtydScan.dfile (str) Prepared data file path If source is ``None`` or ``'file'``, data will be loaded from this file and processing as well as saving is deactivated. If source is the path to a file, data will be saved to this file. *default* = ``None`` .. py:data:: scandata.PtydScan.chunk_format (str) Appendix to saved files if save == 'link' *default* = ``'.chunk%02d'`` .. py:data:: scandata.PtydScan.save (str) Saving mode Mode to use to save data to file. - ``None``: No saving - ``'merge'``: attemts to merge data in single chunk **[not implemented]** - ``'append'``: appends each chunk in master \*.ptyd file - ``'link'``: appends external links in master \*.ptyd file and stores chunks separately in the path given by the link. Links file paths are relative to master file. *default* = ``None`` .. py:data:: scandata.PtydScan.auto_center (bool) Determine if center in data is calculated automatically - ``False``, no automatic centering - ``None``, only if :py:data:`center` is ``None`` - ``True``, it will be enforced *default* = ``None`` .. py:data:: scandata.PtydScan.load_parallel (str) Determines what will be loaded in parallel Choose from ``None``, ``'data'``, ``'common'``, ``'all'`` *default* = ``'data'`` .. py:data:: scandata.PtydScan.rebin (int) Rebinning factor Rebinning factor for the raw data frames. ``'None'`` or ``1`` both mean *no binning* *default* = ``None (>1, <32)`` .. py:data:: scandata.PtydScan.orientation (int, tuple, list) Data frame orientation Choose - ``None`` or ``0``: correct orientation - ``1``: invert columns (numpy.flip_lr) - ``2``: invert rows (numpy.flip_ud) - ``3``: invert columns, invert rows - ``4``: transpose (numpy.transpose) - ``4+i``: tranpose + other operations from above Alternatively, a 3-tuple of booleans may be provided ``(do_transpose, do_flipud, do_fliplr)`` *default* = ``None`` .. py:data:: scandata.PtydScan.min_frames (int) Minimum number of frames loaded by each node *default* = ``1 (>1)`` .. py:data:: scandata.PtydScan.positions_theory (ndarray) Theoretical positions for this scan If provided, experimental positions from :py:class:`PtyScan` subclass will be ignored. If data preparation is called from Ptycho instance, the calculated positions from the :py:func:`ptypy.core.xy.from_pars` dict will be inserted here *default* = ``None`` .. py:data:: scandata.PtydScan.num_frames (int) Maximum number of frames to be prepared If `positions_theory` are provided, num_frames will be ovverriden with the number of positions available *default* = ``None`` .. py:data:: scandata.PtydScan.label (str) The scan label Unique string identifying the scan *default* = ``None`` .. py:data:: scandata.PtydScan.experimentID (str) Name of the experiment If None, a default value will be provided by the recipe. **unused** *default* = ``None`` .. py:data:: scandata.PtydScan.version (float) TODO: Explain this and decide if it is a user parameter. *default* = ``0.1`` .. py:data:: scandata.PtydScan.shape (int, tuple) Shape of the region of interest cropped from the raw data. Cropping dimension of the diffraction frame Can be None, (dimx, dimy), or dim. In the latter case shape will be (dim, dim). *default* = ``256`` .. py:data:: scandata.PtydScan.center (list, tuple, str) Center (pixel) of the optical axes in raw data If ``None``, this parameter will be set by :py:data:`~.scan.data.auto_center` or elsewhere *default* = ``'fftshift'`` .. py:data:: scandata.PtydScan.psize (float, tuple) Detector pixel size Dimensions of the detector pixels (in meters) *default* = ``0.000172 (>0.0)`` .. py:data:: scandata.PtydScan.distance (float) Sample to detector distance In meters. *default* = ``7.19 (>0.0)`` .. py:data:: scandata.PtydScan.energy (float) Photon energy of the incident radiation in keV *default* = ``7.2 (>0.0)`` .. py:data:: scandata.PtydScan.add_poisson_noise (bool) Decides whether the scan should have poisson noise or not *default* = ``False`` .. py:data:: scandata.PtydScan.source (str, NoneType) Alternate source file path if data is meant to be reprocessed. `None` for input shall be deprecated in future *default* = ``'file'`` scandata.MoonFlowerScan ----------------------- .. py:data:: scandata.MoonFlowerScan (Param) *default* = ``Param({})`` .. py:data:: scandata.MoonFlowerScan.name (str) *default* = ``'MoonFlowerScan'`` .. py:data:: scandata.MoonFlowerScan.dfile (str) File path where prepared data will be saved in the ``ptyd`` format. *default* = ``None`` .. py:data:: scandata.MoonFlowerScan.chunk_format (str) Appendix to saved files if save == 'link' *default* = ``'.chunk%02d'`` .. py:data:: scandata.MoonFlowerScan.save (str) Saving mode Mode to use to save data to file. - ``None``: No saving - ``'merge'``: attemts to merge data in single chunk **[not implemented]** - ``'append'``: appends each chunk in master \*.ptyd file - ``'link'``: appends external links in master \*.ptyd file and stores chunks separately in the path given by the link. Links file paths are relative to master file. *default* = ``None`` .. py:data:: scandata.MoonFlowerScan.auto_center (bool) Determine if center in data is calculated automatically - ``False``, no automatic centering - ``None``, only if :py:data:`center` is ``None`` - ``True``, it will be enforced *default* = ``None`` .. py:data:: scandata.MoonFlowerScan.load_parallel (str) Determines what will be loaded in parallel Choose from ``None``, ``'data'``, ``'common'``, ``'all'`` *default* = ``'data'`` .. py:data:: scandata.MoonFlowerScan.rebin (int) Rebinning factor Rebinning factor for the raw data frames. ``'None'`` or ``1`` both mean *no binning* *default* = ``None (>1, <32)`` .. py:data:: scandata.MoonFlowerScan.orientation (int, tuple, list) Data frame orientation Choose - ``None`` or ``0``: correct orientation - ``1``: invert columns (numpy.flip_lr) - ``2``: invert rows (numpy.flip_ud) - ``3``: invert columns, invert rows - ``4``: transpose (numpy.transpose) - ``4+i``: tranpose + other operations from above Alternatively, a 3-tuple of booleans may be provided ``(do_transpose, do_flipud, do_fliplr)`` *default* = ``None`` .. py:data:: scandata.MoonFlowerScan.min_frames (int) Minimum number of frames loaded by each node *default* = ``1 (>1)`` .. py:data:: scandata.MoonFlowerScan.positions_theory (ndarray) Theoretical positions for this scan If provided, experimental positions from :py:class:`PtyScan` subclass will be ignored. If data preparation is called from Ptycho instance, the calculated positions from the :py:func:`ptypy.core.xy.from_pars` dict will be inserted here *default* = ``None`` .. py:data:: scandata.MoonFlowerScan.num_frames (int) Number of frames to simulate *default* = ``100`` .. py:data:: scandata.MoonFlowerScan.label (str) The scan label Unique string identifying the scan *default* = ``None`` .. py:data:: scandata.MoonFlowerScan.experimentID (str) Name of the experiment If None, a default value will be provided by the recipe. **unused** *default* = ``None`` .. py:data:: scandata.MoonFlowerScan.version (float) TODO: Explain this and decide if it is a user parameter. *default* = ``0.1`` .. py:data:: scandata.MoonFlowerScan.shape (int, tuple) Shape of the region of interest cropped from the raw data. Cropping dimension of the diffraction frame Can be None, (dimx, dimy), or dim. In the latter case shape will be (dim, dim). *default* = ``128`` .. py:data:: scandata.MoonFlowerScan.center (list, tuple, str) Center (pixel) of the optical axes in raw data If ``None``, this parameter will be set by :py:data:`~.scan.data.auto_center` or elsewhere *default* = ``'fftshift'`` .. py:data:: scandata.MoonFlowerScan.psize (float, tuple) Detector pixel size Dimensions of the detector pixels (in meters) *default* = ``0.000172 (>0.0)`` .. py:data:: scandata.MoonFlowerScan.distance (float) Sample to detector distance In meters. *default* = ``7.19 (>0.0)`` .. py:data:: scandata.MoonFlowerScan.energy (float) Photon energy of the incident radiation in keV *default* = ``7.2 (>0.0)`` .. py:data:: scandata.MoonFlowerScan.add_poisson_noise (bool) Decides whether the scan should have poisson noise or not *default* = ``True`` .. py:data:: scandata.MoonFlowerScan.density (float) Position distance in fraction of illumination frame *default* = ``0.2`` .. py:data:: scandata.MoonFlowerScan.model (str) The scan pattern *default* = ``'round'`` .. py:data:: scandata.MoonFlowerScan.photons (float) Total number of photons for Poisson noise *default* = ``100000000.0`` .. py:data:: scandata.MoonFlowerScan.psf (float) Point spread function of the detector *default* = ``0.0`` .. py:data:: scandata.MoonFlowerScan.block_wait_count (int) Signals a WAIT to the model after this many blocks. *default* = ``0`` scandata.QuickScan ------------------ .. py:data:: scandata.QuickScan (Param) *default* = ``Param({})`` .. py:data:: scandata.QuickScan.name (str) *default* = ``'MoonFlowerScan'`` .. py:data:: scandata.QuickScan.dfile (str) File path where prepared data will be saved in the ``ptyd`` format. *default* = ``None`` .. py:data:: scandata.QuickScan.chunk_format (str) Appendix to saved files if save == 'link' *default* = ``'.chunk%02d'`` .. py:data:: scandata.QuickScan.save (str) Saving mode Mode to use to save data to file. - ``None``: No saving - ``'merge'``: attemts to merge data in single chunk **[not implemented]** - ``'append'``: appends each chunk in master \*.ptyd file - ``'link'``: appends external links in master \*.ptyd file and stores chunks separately in the path given by the link. Links file paths are relative to master file. *default* = ``None`` .. py:data:: scandata.QuickScan.auto_center (bool) Determine if center in data is calculated automatically - ``False``, no automatic centering - ``None``, only if :py:data:`center` is ``None`` - ``True``, it will be enforced *default* = ``None`` .. py:data:: scandata.QuickScan.load_parallel (str) Determines what will be loaded in parallel Choose from ``None``, ``'data'``, ``'common'``, ``'all'`` *default* = ``'data'`` .. py:data:: scandata.QuickScan.rebin (int) Rebinning factor Rebinning factor for the raw data frames. ``'None'`` or ``1`` both mean *no binning* *default* = ``None (>1, <32)`` .. py:data:: scandata.QuickScan.orientation (int, tuple, list) Data frame orientation Choose - ``None`` or ``0``: correct orientation - ``1``: invert columns (numpy.flip_lr) - ``2``: invert rows (numpy.flip_ud) - ``3``: invert columns, invert rows - ``4``: transpose (numpy.transpose) - ``4+i``: tranpose + other operations from above Alternatively, a 3-tuple of booleans may be provided ``(do_transpose, do_flipud, do_fliplr)`` *default* = ``None`` .. py:data:: scandata.QuickScan.min_frames (int) Minimum number of frames loaded by each node *default* = ``1 (>1)`` .. py:data:: scandata.QuickScan.positions_theory (ndarray) Theoretical positions for this scan If provided, experimental positions from :py:class:`PtyScan` subclass will be ignored. If data preparation is called from Ptycho instance, the calculated positions from the :py:func:`ptypy.core.xy.from_pars` dict will be inserted here *default* = ``None`` .. py:data:: scandata.QuickScan.num_frames (int) Number of frames to simulate *default* = ``100`` .. py:data:: scandata.QuickScan.label (str) The scan label Unique string identifying the scan *default* = ``None`` .. py:data:: scandata.QuickScan.experimentID (str) Name of the experiment If None, a default value will be provided by the recipe. **unused** *default* = ``None`` .. py:data:: scandata.QuickScan.version (float) TODO: Explain this and decide if it is a user parameter. *default* = ``0.1`` .. py:data:: scandata.QuickScan.shape (int, tuple) Shape of the region of interest cropped from the raw data. Cropping dimension of the diffraction frame Can be None, (dimx, dimy), or dim. In the latter case shape will be (dim, dim). *default* = ``64`` .. py:data:: scandata.QuickScan.center (list, tuple, str) Center (pixel) of the optical axes in raw data If ``None``, this parameter will be set by :py:data:`~.scan.data.auto_center` or elsewhere *default* = ``'fftshift'`` .. py:data:: scandata.QuickScan.psize (float, tuple) Detector pixel size Dimensions of the detector pixels (in meters) *default* = ``0.000172 (>0.0)`` .. py:data:: scandata.QuickScan.distance (float) Sample to detector distance In meters. *default* = ``7.19 (>0.0)`` .. py:data:: scandata.QuickScan.energy (float) Photon energy of the incident radiation in keV *default* = ``7.2 (>0.0)`` .. py:data:: scandata.QuickScan.add_poisson_noise (bool) Decides whether the scan should have poisson noise or not *default* = ``False`` .. py:data:: scandata.QuickScan.density (float) Position distance in fraction of illumination frame *default* = ``0.05`` scandata.SimScan ---------------- .. py:data:: scandata.SimScan (Param) *default* = ``Param({})`` .. py:data:: scandata.SimScan.illumination (Param, str) Illumination parameters *default* = ``Param({})`` .. py:data:: scandata.SimScan.illumination.aperture (Param) Beam aperture parameters *default* = ``Param({})`` .. py:data:: scandata.SimScan.illumination.aperture.rotate (float) Rotate aperture by this value *default* = ``0.0`` .. py:data:: scandata.SimScan.illumination.aperture.central_stop (float) size of central stop as a fraction of aperture.size If not None: places a central beam stop in aperture. The value given here is the fraction of the beam stop compared to `size` *default* = ``None (>0.0, <1.0)`` .. py:data:: scandata.SimScan.illumination.aperture.diffuser (tuple) Noise in the transparen part of the aperture Can be either: - ``None`` : no noise - ``2-tuple`` : noise in phase (amplitude (rms), minimum feature size) - ``4-tuple`` : noise in phase & modulus (rms, mfs, rms_mod, mfs_mod) *default* = ``None`` .. py:data:: scandata.SimScan.illumination.aperture.edge (float) Edge width of aperture (in pixels!) *default* = ``2.0`` .. py:data:: scandata.SimScan.illumination.aperture.form (NoneType, str) One of None, 'rect' or 'circ' One of: - ``None`` : no aperture, this may be useful for nearfield - ``'rect'`` : rectangular aperture - ``'circ'`` : circular aperture *default* = ``'circ'`` .. py:data:: scandata.SimScan.illumination.aperture.offset (float, tuple, list) Offset between center of aperture and optical axes May also be a tuple (vertical,horizontal) for size in case of an asymmetric offset *default* = ``0.0`` .. py:data:: scandata.SimScan.illumination.aperture.size (float, tuple, list) Aperture width or diameter May also be a tuple *(vertical,horizontal)* in case of an asymmetric aperture *default* = ``None (>0.0)`` .. py:data:: scandata.SimScan.illumination.diversity (Param, NoneType) Probe mode(s) diversity parameters Can be ``None`` i.e. no diversity *default* = ``Param({})`` .. py:data:: scandata.SimScan.illumination.diversity.noise (tuple, list) Noise in each non-primary mode of the illumination. Can be either: - ``None`` : no noise - ``2-tuple`` : noise in phase (amplitude (rms), minimum feature size) - ``4-tuple`` : noise in phase & modulus (rms, mfs, rms_mod, mfs_mod) *default* = ``(0.5, 1.0)`` .. py:data:: scandata.SimScan.illumination.diversity.power (tuple, float, list) Power of modes relative to main mode (zero-layer) *default* = ``0.1 (>0.0, <1.0)`` .. py:data:: scandata.SimScan.illumination.diversity.shift (float) Lateral shift of modes relative to main mode **[not implemented]** *default* = ``None`` .. py:data:: scandata.SimScan.illumination.model (str, ndarray) Type of illumination model One of: - ``None`` : model initialitziation defaults to flat array filled with the specified number of photons - ``'recon'`` : load model from previous reconstruction, see `recon` Parameters - ``'stxm'`` : Estimate model from autocorrelation of mean diffraction data - ** : one of ptypys internal image resource strings - *