<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://viper.lbl.gov:8080/cctbx.xfel/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Mlxd</id>
	<title>cctbx_xfel - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="http://viper.lbl.gov:8080/cctbx.xfel/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Mlxd"/>
	<link rel="alternate" type="text/html" href="http://viper.lbl.gov:8080/cctbx.xfel/index.php/Special:Contributions/Mlxd"/>
	<updated>2026-06-13T17:43:32Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.15</generator>
	<entry>
		<id>http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=Data_Processing_at_SACLA&amp;diff=1467</id>
		<title>Data Processing at SACLA</title>
		<link rel="alternate" type="text/html" href="http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=Data_Processing_at_SACLA&amp;diff=1467"/>
		<updated>2017-11-18T01:48:08Z</updated>

		<summary type="html">&lt;p&gt;Mlxd: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Obtaining metadata like detector position ==&lt;br /&gt;
1) AgBeh (silver behenate).  Determine detector distance and beam center&lt;br /&gt;
--&amp;gt; update SACLA-provided *.geom file (CrystFEL format)&lt;br /&gt;
--&amp;gt; run sacla geom to json on *.geom to get equivalent for DIALS processing&lt;br /&gt;
&lt;br /&gt;
2) h5_mpi_submit --&amp;gt; launches dials.stills_process with process.phil, and queueing options.&lt;br /&gt;
&lt;br /&gt;
Specify what runs (integers)&lt;br /&gt;
/work/jkern/2017B8085/xrd/r234567-0/*.h5&lt;br /&gt;
&lt;br /&gt;
2.5) Data visualization. &lt;br /&gt;
&lt;br /&gt;
3) metrology refinement&lt;br /&gt;
dials.combine_experiments reference_from_experiment.detector=0.  &lt;br /&gt;
&lt;br /&gt;
Takes 1000 images, puts into 1 file.  Output:  combined_experiments.json + combined_reflections.pickle&lt;br /&gt;
&lt;br /&gt;
1 Experiment = crystal + detector + beam&lt;br /&gt;
&lt;br /&gt;
Must cherry pick data if there is scare data out to the corners. (but not covered here.  but:  largest pickle files are highly diffracting).&lt;br /&gt;
&lt;br /&gt;
dials.refine combined* hierarchy_level=[0|1] # Use 0 first (refine detector as a block) then 1(refine each panel)&lt;br /&gt;
To keep detector flat: refinement.parameterisation.detector.fix_list=Tau2,Tau3&lt;br /&gt;
&lt;br /&gt;
Level 0: refine dist, shift1, shift2.  Fix: tau&lt;br /&gt;
&lt;br /&gt;
Level 1: refine shift1, shift2, tau1  Fix: dist, tau2, tau3&lt;br /&gt;
&lt;br /&gt;
Evaluation--how do you know if it made a difference?&lt;br /&gt;
&lt;br /&gt;
dev.cctbx.xfel.detector_residuals json pickle # also specify hierarchy_level=1 residuals.plot_max=0.3&lt;br /&gt;
&lt;br /&gt;
program -c -e 10 -a 2# gets all config parameters for a program at expert level 10, giving all help strings.&lt;br /&gt;
&lt;br /&gt;
4) redo integration with reference geometry:&lt;br /&gt;
&lt;br /&gt;
reference_geometry=refined_experiments.json&lt;br /&gt;
&lt;br /&gt;
5) merge&lt;br /&gt;
&lt;br /&gt;
take merging script from LQ79.  Take it verbatim.  Use cxi.merge&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
#PBS -q [smp|serial]&lt;br /&gt;
&lt;br /&gt;
smp: lots of memory up to 44 pros&lt;br /&gt;
serial: up to 14 pros, 1 node&lt;br /&gt;
b13-occupancy: reserved for you&lt;br /&gt;
&lt;br /&gt;
== DIALS workflow ==&lt;br /&gt;
dials.import file.h5 (the h5 will have 1000&#039;s of images in it)&lt;br /&gt;
--&amp;gt; datablock.json.  Has experimental models as abstracted from image header&lt;br /&gt;
&lt;br /&gt;
dials.find_spots datablock.json&lt;br /&gt;
--&amp;gt; strong.pickle&lt;br /&gt;
&lt;br /&gt;
dials.index strong.pickle datablock.json&lt;br /&gt;
--&amp;gt; indexed.pickle experiments.json&lt;br /&gt;
&lt;br /&gt;
dials.refine&lt;br /&gt;
--&amp;gt; refined_experiments.json refined_reflections.pickle&lt;br /&gt;
&lt;br /&gt;
dials.integrate&lt;br /&gt;
&lt;br /&gt;
== Aggregate processing at XFELS ==&lt;br /&gt;
Need to submit a single job for each *.h5 file (manually, or write a script)&lt;br /&gt;
Instead of running the individual steps:&lt;br /&gt;
dials.stills_process *.h5 process.phil&lt;br /&gt;
&lt;br /&gt;
Phil file must have good parameters for data processing.  Take one from previous users.&lt;br /&gt;
&lt;br /&gt;
== Converting SACLA pipeline geometry file to DIALS ==&lt;br /&gt;
libtbx.python modules/cctbx_project/xfel/sacla/mpccd_geom2json.py &amp;lt;SACLA_GEOM&amp;gt; distance=&amp;lt;DETECTOR DISTANCE&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Modifications to detector distance ==&lt;br /&gt;
Distance can be specified by modifying line 55 of&lt;br /&gt;
/home/jkern/xfel_env/conda_install/modules/cctbx_project/dxtbx/format/FormatHDF5SaclaMPCCD.py&lt;br /&gt;
&lt;br /&gt;
`self.distance = 100.0`&lt;br /&gt;
&lt;br /&gt;
== Submission of jobs == &lt;br /&gt;
Use the file &#039;/work/jkern/2017B8085/xrd/run_scripts/test_pierre.sh&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
echo -n &amp;quot;enter phil file to use:&amp;quot;&lt;br /&gt;
read phil_inp&lt;br /&gt;
echo $phil_inp&lt;br /&gt;
&lt;br /&gt;
for run in $(seq $1 $2);&lt;br /&gt;
do&lt;br /&gt;
&lt;br /&gt;
	for chunk in $(seq $3 $4)&lt;br /&gt;
        do&lt;br /&gt;
&lt;br /&gt;
		cxi.mpi_submit input.data_dir=/work/jkern/2017B8085/xrd/data/${run}-${chunk} input.run_num=${run} \&lt;br /&gt;
  		input.dispatcher=dials.stills_process output.output_dir=/work/jkern/2017B8085/xrd/results \&lt;br /&gt;
  		input.target=&amp;quot;/work/jkern/2017B8085/xrd/processing_phils/${phil_inp}&amp;quot; input.run_chunk=$chunk\&lt;br /&gt;
  		mp.method=pbs mp.queue=bl2-occupancy mp.nnodes=1 mp.nproc_per_node=28 \&lt;br /&gt;
  		mp.env_script=/home/jkern/xfel_env/setup_env.sh input.data_template=&amp;quot;run%d-%d.h5&amp;quot;&lt;br /&gt;
&lt;br /&gt;
	done&lt;br /&gt;
done&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;/div&gt;</summary>
		<author><name>Mlxd</name></author>
	</entry>
	<entry>
		<id>http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=Data_Processing_at_SACLA&amp;diff=1466</id>
		<title>Data Processing at SACLA</title>
		<link rel="alternate" type="text/html" href="http://viper.lbl.gov:8080/cctbx.xfel/index.php?title=Data_Processing_at_SACLA&amp;diff=1466"/>
		<updated>2017-11-18T01:41:07Z</updated>

		<summary type="html">&lt;p&gt;Mlxd: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Obtaining metadata like detector position ==&lt;br /&gt;
1) AgBeh (silver behenate).  Determine detector distance and beam center&lt;br /&gt;
--&amp;gt; update SACLA-provided *.geom file (CrystFEL format)&lt;br /&gt;
--&amp;gt; run sacla geom to json on *.geom to get equivalent for DIALS processing&lt;br /&gt;
&lt;br /&gt;
2) h5_mpi_submit --&amp;gt; launches dials.stills_process with process.phil, and queueing options.&lt;br /&gt;
&lt;br /&gt;
Specify what runs (integers)&lt;br /&gt;
/work/jkern/2017B8085/xrd/r234567-0/*.h5&lt;br /&gt;
&lt;br /&gt;
2.5) Data visualization. &lt;br /&gt;
&lt;br /&gt;
3) metrology refinement&lt;br /&gt;
dials.combine_experiments reference_from_experiment.detector=0.  &lt;br /&gt;
&lt;br /&gt;
Takes 1000 images, puts into 1 file.  Output:  combined_experiments.json + combined_reflections.pickle&lt;br /&gt;
&lt;br /&gt;
1 Experiment = crystal + detector + beam&lt;br /&gt;
&lt;br /&gt;
Must cherry pick data if there is scare data out to the corners. (but not covered here.  but:  largest pickle files are highly diffracting).&lt;br /&gt;
&lt;br /&gt;
dials.refine combined* hierarchy_level=[0|1] # Use 0 first (refine detector as a block) then 1(refine each panel)&lt;br /&gt;
To keep detector flat: refinement.parameterisation.detector.fix_list=Tau2,Tau3&lt;br /&gt;
&lt;br /&gt;
Level 0: refine dist, shift1, shift2.  Fix: tau&lt;br /&gt;
&lt;br /&gt;
Level 1: refine shift1, shift2, tau1  Fix: dist, tau2, tau3&lt;br /&gt;
&lt;br /&gt;
Evaluation--how do you know if it made a difference?&lt;br /&gt;
&lt;br /&gt;
dev.cctbx.xfel.detector_residuals json pickle # also specify hierarchy_level=1 residuals.plot_max=0.3&lt;br /&gt;
&lt;br /&gt;
program -c -e 10 -a 2# gets all config parameters for a program at expert level 10, giving all help strings.&lt;br /&gt;
&lt;br /&gt;
4) redo integration with reference geometry:&lt;br /&gt;
&lt;br /&gt;
reference_geometry=refined_experiments.json&lt;br /&gt;
&lt;br /&gt;
5) merge&lt;br /&gt;
&lt;br /&gt;
take merging script from LQ79.  Take it verbatim.  Use cxi.merge&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
#PBS -q [smp|serial]&lt;br /&gt;
&lt;br /&gt;
smp: lots of memory up to 44 pros&lt;br /&gt;
serial: up to 14 pros, 1 node&lt;br /&gt;
b13-occupancy: reserved for you&lt;br /&gt;
&lt;br /&gt;
== DIALS workflow ==&lt;br /&gt;
dials.import file.h5 (the h5 will have 1000&#039;s of images in it)&lt;br /&gt;
--&amp;gt; datablock.json.  Has experimental models as abstracted from image header&lt;br /&gt;
&lt;br /&gt;
dials.find_spots datablock.json&lt;br /&gt;
--&amp;gt; strong.pickle&lt;br /&gt;
&lt;br /&gt;
dials.index strong.pickle datablock.json&lt;br /&gt;
--&amp;gt; indexed.pickle experiments.json&lt;br /&gt;
&lt;br /&gt;
dials.refine&lt;br /&gt;
--&amp;gt; refined_experiments.json refined_reflections.pickle&lt;br /&gt;
&lt;br /&gt;
dials.integrate&lt;br /&gt;
&lt;br /&gt;
== Aggregate processing at XFELS ==&lt;br /&gt;
Need to submit a single job for each *.h5 file (manually, or write a script)&lt;br /&gt;
Instead of running the individual steps:&lt;br /&gt;
dials.stills_process *.h5 process.phil&lt;br /&gt;
&lt;br /&gt;
Phil file must have good parameters for data processing.  Take one from previous users.&lt;br /&gt;
&lt;br /&gt;
== Converting SACLA pipeline geometry file to DIALS ==&lt;br /&gt;
libtbx.python modules/cctbx_project/xfel/sacla/mpccd_geom2json.py &amp;lt;SACLA_GEOM&amp;gt; distance=&amp;lt;DETECTOR DISTANCE&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Modifications to detector distance ==&lt;br /&gt;
Distance can be specified by modifying line 55 of&lt;br /&gt;
/home/jkern/xfel_env/conda_install/modules/cctbx_project/dxtbx/format/FormatHDF5SaclaMPCCD.py&lt;br /&gt;
&lt;br /&gt;
`self.distance = 100.0`&lt;/div&gt;</summary>
		<author><name>Mlxd</name></author>
	</entry>
</feed>