# This dataset corresponds to sample 7 from the CXIDB dataset #26 - https://www.cxidb.org/id-26.html


# 0) Set the GPU number in the PYNX_PU if not already done (replace '1' by your trainee number):
export PYNX_PU=.1

# 1) perform a first analysis.  Initial support must be estimated as there is a beamstop.
# Parameters are a bit tuned for a 'soft' object

pynx-cdi-id01 data=cxidb-26_sample7.cxi support=circle support_size=100 nb_raar=2000 nb_hio=2000 support_threshold=0.3,0.4 zero_mask=0 mask=negative support_smooth_width_begin=4 support_smooth_width_end=0.5 support_update_border_n=5 verbose=200 liveplot


# 2) try multiple runs, without liveplot

rm -f *LLK*.cxi  # remove old results

pynx-cdi-id01 data=cxidb-26_sample7.cxi support=circle support_size=100 nb_raar=2000 nb_hio=2000 support_threshold=0.3,0.4 zero_mask=0 mask=negative support_smooth_width_begin=4 support_smooth_width_end=0.5 support_update_border_n=5 verbose=200 nb_run=100 nb_run_keep=10


# 3) Perform a mode analysis to get the best object
pynx-cdi-analysis *LLK*.cxi modes
silx view *modes*.h5

