aboutsummaryrefslogtreecommitdiff
path: root/libcrystfel
AgeCommit message (Collapse)Author
6 daysdata_template_write_to_fh: Don't try to write coffset at top levelHEADmasterThomas White
Previously, there was a bad bug here. We would still try to write a top-level coffset even if panels have moved such that the coffset is no longer a single value. One possibility is to unset panel->cnz_offset_default when moving a panel. This works, but we have to do it on every translation, or accept a floating-point comparison with zero and associated non-determinism. It's very likely that if we move one panel, we'll be moving all panels, even if only by a small amount. So, a more stable way seems to just write separate coffset values all the time. The coffset values aren't really meant to be used at the top level anyway (that's what clen is for!), so this fits pretty well.
11 daysdata_template_write_to_fh: Fix bad region outputThomas White
Two problems: 1. Didn't take into account that bad->name already includes the prefix "bad". 2. Didn't convert the panel-relative coordinates back to slab-relative. Fixes: https://github.com/taw10/crystfel/issues/11
2024-04-26DataTemplate: Add an "all" group if no panel definitions are givenThomas White
Fixes: https://gitlab.desy.de/thomas.white/crystfel/-/issues/96
2024-04-26WhitespaceThomas White
2024-04-26crystfel_geometry(5): Mention that group definitions must come after panelsThomas White
Also mention this when complaining about the geometry file. Fixes: https://github.com/taw10/crystfel/issues/10
2024-04-25indexamajig: Avoid writing empty Mille recordsThomas White
Fixes: https://github.com/taw10/crystfel/issues/9
2024-04-22asdf: Force cell to be right-handed after refinementThomas White
In some rare cases, the cell changes from right to left handed during the vector refinement stage of asdf, while ending up at an apparently correct indexing solution. This commit just flips the axis round when necessary, in the same way that asdf already does in an earlier stage. I haven't done a proper survey, but I can say that the image I used to isolate and test this issue had very low resolution while still being what we would call "indexable". The left-handed cells appeared for six out of the 12173 hits in that run, or slightly below 0.05%. So, it's rare but not totally impossible.
2024-04-22asdf: Don't store cell volumeThomas White
It's hardly needed for re-use, and invites problems with the volume going out of sync with the vectors. Better just to calculate it when needed.
2024-04-18Merge branch 'julia'Thomas White
2024-04-16Tweak prediction refinement weightingsThomas White
2024-02-26stream_read_chunk: Set kpred to nominal wavelengthThomas White
This avoids having to awkwardly pass the wavelength separately, e.g. to the polarisation correction.
2024-02-20Set default flag for panel dimensionsThomas White
This was missed out, causing DataTemplates to be written incorrectly.
2024-02-06Ownership for Crystal.CellThomas White
2024-02-06Julia: MM semantics for Image.crystalsThomas White
2024-02-06Julia: Image/PeakList memory semantics (again)Thomas White
Previous commit a6462e1f0 was still not right. If the image gets freed, the PeakList can be left with a dangling reference. If the peak list gets replaced at the C level (e.g. by running a new peak search), Julia will have no way of knowing about it. Instead of having the PeakList know if it's associated with an image, it's better to have the Image know (at the C level) if it's responsible for freeing the ImageFeatureList. As soon as the ImageFeatureList is exposed to the Julia GC via a PeakList object, it becomes Julia's responsibility to free it. The Julia Image structure contains a reference to the Julia PeakList, to prevent this from happening until either the image is freed or a new PeakList is substituted. The two references (Julia image.peaklist and C image->features) have to be kept in sync, and we check image->features every time the peaklist is requested.
2024-02-06Expose name_equivThomas White
2024-02-06Add free_reflistiterator()Thomas White
This enables early exit from iteration over a RefList.
2024-02-06Peak search algorithms should not mutate image structureThomas White
This changes all the peak search procedures into pure functions that return a new ImageFeatureList. This takes the management of image->features out of the hands of the peak search routines, and into the calling code's responsibility. In turn, this allows a load of stuff to become const.
2024-02-06Crystal: Free UnitCell when setting a new oneThomas White
2024-02-06Fix incorrect uses of cell_freeThomas White
This also gets rid of crystal_copy_deep. From now on, all crystal_copy calls also copy the UnitCell.
2024-02-06Crystals shouldn't own RefLists (part 4)Thomas White
This fixes the general prediction/partiality parts.
2024-02-06Crystals shouldn't own RefLists (part 3)Thomas White
This fixes integration.c, peaks.c and process_hkl.c.
2024-02-06Crystals shouldn't own RefLists (part 2)Thomas White
This commit replaces image.crystals with an array of small structs, each consisting of a Crystal-RefList pair. index.c and stream.c are updated, more to follow.
2024-02-06Crystals shouldn't own RefLists (part 1)Thomas White
This is a terrible bit of API. A Crystal contains both the parameters for a calculation (e.g. prediction) and the results. Just look at post-refinement.c for an example of the mess this makes when trying to do calculations. This commit removes the reflection list from the Crystal structure. Future commits in this series will fix the resulting build carnage. This also gets rid of vestigial field pr_dud, and adds initialisers for all (remaining) fields.
2024-02-06Use libcrystfel memory allocation routines everywhereThomas White
2024-02-06Add hooks for custom memory allocation in libcrystfelThomas White
2024-02-06image_add_feature: Remove "image" argumentThomas White
It hasn't been needed for ages.
2024-02-06Crystal: Remove reference to image structure (part 1)Thomas White
2024-02-02Fix lies in documentationThomas White
2024-01-30Add data_template_write_to_fh and stream_write_data_templateThomas White
2024-01-30asdf: Use fftw_alloc_{real,complex}Thomas White
A little clearer than fftw_malloc(*sizeof)
2024-01-30asdf: Remove unnecessary fftw_cleanupThomas White
This is only needed to reset FFTW to a "pristine" state, which is not required here, and possibly even detrimental.
2024-01-30asdf: Use FFTW arrays directlyThomas White
We don't need to fish out the arrays and use FFTW's "new array execution" functions: http://fftw.org/fftw3_doc/New_002darray-Execute-Functions.html
2024-01-12indexamajig: Implement --max-mille-levelThomas White
2024-01-12align_detector: Enumerate directory contents if necessaryThomas White
2024-01-05get_hkl: Read MTZ filesThomas White
There are still some rough edges, e.g. it only works with a simple I/SIGI column (not I+/I-), and can't yet interpret the symmetry information in the file. However, it's still better than the old mtz2hkl script. Closes: https://gitlab.desy.de/thomas.white/crystfel/-/issues/7
2023-12-19Check for duplicate member in panel groupThomas White
Example: group_all = q0,q1,q2,q2
2023-12-19index_pattern: Gracefully handle image with no peaksThomas White
2023-09-23indexamajig: Re-use the image data arraysThomas White
We noticed that constant freeing and re-allocating the (potentially quite large) arrays resulted in much lower performance. Since we know that all images have the same data layout, we can safely re-use the arrays. This gives a large speedup.
2023-09-23image_create_dp_bad_sat: Don't worry about "sat"Thomas White
The saturation array is created by create_satmap when needed, which takes care that all panels get an array (so we only have to check image->sat != NULL). The array created by image_create_dp_bad_sat was actually leaked! In any case, saturation maps are rarely used. We can do without the extra allocations. The routine name has been changed accordingly, to prevent future confusion.
2023-09-23Fix a couple of profiling memory errorsThomas White
The "children" array was the wrong size, and not freed. Also, some formatting fussiness.
2023-09-22Don't complain about missing 'all' group until it's actually neededThomas White
2023-09-20Fix inappropriate use of r_devThomas White
These should be get_exerr. Following 1ae9a4582, the r_dev values are no longer useful physical quantities, only a refinement target function. This was causing the last few Git versions to not predict any reflections at all!
2023-09-19Prediction refinement: Weaken restraint and reduce number of iterationsThomas White
The restraint was way too strong, after the last round of tweaking. With a weaker restraint, the algorithm converges very quickly - it's practically linear - so ten iterations is way too much.
2023-09-18Use a*a instead of pow(a, 2)Thomas White
2023-09-18Build EXC_WEIGHT into r_devThomas White
This avoids weird weighting factors everywhere and much confusion. Since Millepede doesn't have an easy way of weighting measurements (only via altering the ESD values), treating it as a units conversion seems to be easier.
2023-09-18pred_residual: Remove vestigial conversion to metresThomas White
We want the residual in pixels, as described in the comment for EXC_WEIGHT. This routine is only used for displaying the total residuals, not for the real minimisation maths. However, we need to be clear.
2023-09-18Prediction refinement: Record excitation error and distance residuals separatelyThomas White
2023-09-18Prediction refinement: Record initial residual and total shiftsThomas White
2023-09-18Merge branch 'millepede'Thomas White
Fixes: https://gitlab.desy.de/thomas.white/crystfel/-/issues/3 Fixes: https://gitlab.desy.de/thomas.white/crystfel/-/issues/29