Skip to main content
`Ctrl`+`K`

# pynx-cdi-regrid

Instructions to run the pynx-cdi-regrid command-line script to prepare a 3D cdi CXI file from multiple projections.

Rebuild the 3D reciprocal space by projecting a set of 2d speckle SAXS pattern taken at various rotation angles into a 3D regular volume

    usage: pynx-cdi-regrid [-h] [-V] [-v] [--debug] [-o OUTPUT] [-s SHAPE]
                           [--scale SCALE] [-m MASK] [--dry-run] [--profile]
                           [--maxi MAXI] [-d DISTANCE] [-b BEAM BEAM]
                           [-p PIXELSIZE] [--rot ROT] [--scan SCAN]
                           [--scan-len SCAN_LEN]
                           [--oversampling-img OVERSAMPLING_IMG]
                           [--oversampling-rot OVERSAMPLING_ROT]
                           [--device DEVICE DEVICE]
                           [IMAGE ...]

## Positional Arguments

`IMAGE`

  file with input images in Bliss format HDF5

## Named Arguments

`-V, --version`

  output version and exit

`-v, --verbose`

  show information for each conversions

  Default: `False`

`--debug`

  show debug information

  Default: `False`

## main arguments

`-o, --output`

  output filename in CXI format

  Default: `'reciprocal_volume.cxi'`

`-s, --shape`

  Size of the reciprocal volume, by default 512³

  Default: `1024`

`--scale`

  Scale (down) the voxel coordinates. For example a factor 2 is similar to a 2x2x2 binning of the volume

  Default: `1.0`

`-m, --mask`

  Path for the mask file containing both invalid pixels and beam-stop shadow

## optional behaviour arguments

`--dry-run`

  do everything except modifying the file system

  Default: `False`

`--profile`

  Turn on the profiler and print OpenCL profiling at output

  Default: `False`

`--maxi`

  Limit the processing to a given number of frames

## Experimental setup options

`-d, --distance`

  Detector distance in meter

`-b, --beam`

  Direct beam in pixels x, y, by default, the center of the image

`-p, --pixelsize`

  pixel size, by default 172µm

  Default: `0.000172`

## Scan setup

`--rot`

  Name of the rotation motor

  Default: `'ths'`

`--scan`

  Name of the rotation motor

  Default: `'dscan sz'`

`--scan-len`

  Pick scan which match that length (unless take all scans

  Default: `'1'`

## Oversampling options to reduces the moiré pattern

`--oversampling-img`

  How many sub-pixel there are in one pixel (squared)

  Default: `7`

`--oversampling-rot`

  How many times a frame is projected

  Default: `7`

## OpenCL options

`--device`

  Platform and device ids

Assumption: There is enough memory to hold all frames in memory

> return codes: 0 means a success. 1 means the conversion contains a failure, 2 means there was an error in the arguments