Frequently asked (and anticipated) questions

create-mtz fails with "f2mtz: problems reading reflection"

The error might look like this:

$ ./create-mtz mydata.hkl
 Input: mydata.hkl
Output: mydata.mtz
Running 'f2mtz'...
 f2mtz:  problems reading reflection   56164


Make sure you're using the latest version of the create-mtz script. Copy a new version from the download folder if in doubt. It's OK to use a new version with old CrystFEL data.

How do I convert my data to HDF5 format?

Since version 0.6.3, CBF files can be read directly by CrystFEL, so maybe you don't need to!

HDF5 is a "container" format, and there are bindings for a large number of different programming and scripting languages. For data from LCLS, SACLA and several other sources, you can use Cheetah to turn the raw data (in "XTC" format) to HDF5s, simultaneously filtering out the blank frames. OnDA and CASS can also perform this function (and lots more!). The multi-event HDF5 files generated by the LCLS and SACLA DAQ systems are supported by CrystFEL since version 0.6.0.

If your files came from a MAR detector, take a look at the mar2hdf5 and cbf2hdf5 programs on the extra programs page.

I don't see a graph window when using scripts/detector-shift or other graphic scripts

Some systems don't set up the default backend for matplotlib. Edit ~/.config/matplotlib/matplotlibrc and add the line backend: TkAgg.

When I use partialator's custom splitting (--custom-split), the dataset files are all empty

The filenames in the custom split file must be exactly the same as those in the stream, including all parts of any path prefix. The filenames (and event IDs) are compared using a string comparison which isn't even aware of what they are, or that different filenames might ultimately represent the same file. If you're unsure about what's in the stream, run this command: grep "Image filename"

I can't index anything with Mosflm, but other methods work

Do you see a warning message which says "Failed to read newmat file"? If so, then your version of Mosflm might be too old. Try upgrading to the latest version, which is most easily done by upgrading your entire CCP4 installation.

I'm running on Mac OS X and I get "No response from MOSFLM"

This seems to be related this issue, so try the workaround mentioned in the linked post, which is to install Mosflm from the Mosflm website instead of using the CCP4 version.

I get "undefined reference to 'cairo_surface_show_page'"

This is because your version of Cairo is too old. The error should mention a file and a line number, and you can just comment that line out. If you do this, partialator's scaling report will come out mangled but the rest of CrystFEL will work fine.

The PDF file from render_hkl is empty or corrupted

This happens when running render_hkl at SLAC. Due to a bug in the version of Cairo installed there, PDF output unfortunately doesn't work. The only workaround is to run render_hkl on a different machine.

I get a strange error about -fPIC

The error might look like this:

/usr/bin/ld: /usr/lib/libfftw3.a(mapflags.o): relocation R_X86_64_32 against `.rodata' can not be used when making a shared object; recompile with -fPIC
/usr/lib/libfftw3.a: could not read symbols: Bad value

Because CrystFEL uses FFTW from within libcrystfel (itself a shared library), FFTW needs to be compiled appropriately. This doesn't seem to be the default for the FFTW packages in many distributions, so you might need to uninstall your distribution's version and compile your own from source. Add "--enable-shared" to the arguments for FFTW's ./configure.

Where is sum_stack?

sum_stack was removed from the core of CrystFEL because it wasn't often used and was a maintenance headache. This kind of thing is best done at the 'hit finding' stage..

How do I plot 3D pictures with render_hkl?

Like sum_stack, this functionality was not very general and so was removed from the core of CrystFEL. render_hkl required modifications every time it was used, to customise the appearance of the picture. This is a great example of the sort of thing that libcrystfel is designed for.

How do I get GPU accelerated simulation in pattern_sim?

On the first step of installation, add --with-opencl to your configuration options: ./configure --with-opencl. Then add the --gpu option when you run pattern_sim.

Why do I get strange HDF5 errors?

Make sure you compiled the HDF5 library with ./configure --enable-threadsafe. However, note that a thread-safe HDF5 installation is no longer required for most users of CrystFEL. Thread-safe HDF5 is only needed if you use partial_sim --image.

I couldn't compile HDF5 with --enable-threadsafe

Add the option --with-pthread=/usr to the configuration options for HDF5, in addition to --enable-threadsafe. I don't know why this isn't the default. However, see the answer to the previous question: thread-safe HDF5 is not needed for most users any more.

hdfsee complains that it "Couldn't get wavelength from HDF5 file"

If you don't need to plot resolution rings, you can safely ignore this.

hdfsee gives "Error: Gtk-Message: Failed to load module pk-gtk-module"

This just means that your distribution hasn't set up some things related to GTK themes quite correctly. You can safely ignore it.