pynx-cdi-analysis#

Documentation for pynx-cdi-regrid to script to analyse the results from a series of CDI reconstructions: mode analysis, averaging, PRTF…

script to analyse a series of CDI reconstructions (mode decomposition, PRTF,..)

usage: pynx-cdi-analysis [-h] [--modes [MODES]] [--modes_output MODES_OUTPUT]
                         [--modes_type {abs,amplitude,complex}]
                         [--modes_crop MODES_CROP] [--average] [--subpixel]
                         [--real] [--phase_ramp] [--movie [MOVIE]] [--prtf]
                         [--nproc NPROC]
                         data [data ...]

Positional Arguments#

data

cxi files of the CDI reconstruction results for analysis. The observed intensity data file (CXI format) can also be supplied for PRTF computing. If a *.h5 file is supplied, it should be the result of the mode analysis and can be used along –movie and/or –prtf.

Named Arguments#

--modes

Use this to trigger analysis of the CDI reconstructions and decompose them into eigen-values. The first mode should represent most of the intensity. If ‘–modes N’ (N integer) is given, only the first N modes are saved. The objects are first aligned (the R_match R-factor indicates how good individual object fit, lower values are better), then the mode decomposition is performed.

Default: False

--modes_output

filename for the output of the modes analysis. By default, the longest common prefix to the input files + ‘-modes.h5’ will be used

--modes_type

Possible choices: abs, amplitude, complex

type of mode extraction. Default is ‘complex’, but ‘abs’ can be used for real-valued objects

Default: 'complex'

--modes_crop

can be ‘auto’ (the default, will crop around the support if available), or ‘no’, or an integer value to crop around the support plus a number of pixels.

Default: 'auto'

--average

use this to save the average of reconstructions in the modes.h5 file.If this is given without –modes, then only the average is computed, requiring less memory

Default: False

--subpixel

This option activates subpixel registration for object alignment for the modes analysis or averaging

Default: False

--real

if this keyword is given, the phase of the object (modes and average) will be corrected so complex values are mainly along the real axis. This should work only if a real-valued object is expected.

Default: False

--phase_ramp, --phase-ramp, --phaseramp

use this to match the phase ramp between solutions.This was previously the default, but since all solutions correspond to thesame Fourier Transform, it should not be necessary.

Default: False

--movie

use this with 3D input data to make a movie, either from the single CXI or h5 (modes) data file, or from the first two files (if the .h5 mode file is listed, it is always considered first). Some options can be given: * –movie=complex: to display the complex 3d data (the default) * –movie=amplitude: to display the amplitude * –movie=amplitude,grey: to display the amplitude using a grayscale rather than the default colormap.Possible options are ‘grey’ and ‘grey_r’. Otherwise viridis is used

Default: False

--prtf

use this to compute the Phase Retrieval Transfer Function.This requires including the experimental data CXI file among the input file (it will be automatically recognised from ‘result’ CXI files) and using the –modes keyword or giving the result modes hdf5 file as input. At least one CXI result file must be given so that the actual ROI used is known. If –modes is also used, the PRTF is saved in the modes hdf5 file

Default: False

--nproc

use this to specify the number of parallel process used to match objects. By default, the number of real CPU cores will be automatically determined, but this may be used to avoid an out-of-memory error when analysing large arrays

Examples:
pynx-cdi-analysis sample-results*.cxi –modes

=> perform modes analysis on a list of solutions (using ‘*’ to match all the result files)

pynx-cdi-analysis sample-results*.cxi –modes –movie

=> same but also make a movie of the best solution and first mode (requires ffmpeg)

pynx-cdi-analysis solution1.cxi solution2.cxi –movie

=> Just make a movie from two solutions

pynx-cdi-analysis data.cxi solution1.cxi solution2.cxi –modes –prtf
=> mode analysis, also computing the PRTF. Requires that the CXI data be included

in the list of input CXI files

pynx-cdi-analysis data.cxi solution1.cxi solution2.cxi –average –prtf
=> compute the average of solutions, and the PRTF. Averaging requires less

memory than modes analysis, since solutions are loaded sequentially.

pynx-cdi-analysis data.cxi solution1.cxi solution2.cxi –modes –average –prtf

=> modes + average + PRTF, all saved to the same .h5 file