Age | Commit message (Collapse) | Author |
|
|
|
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.
|
|
This also gets rid of crystal_copy_deep. From now on, all crystal_copy
calls also copy the UnitCell.
|
|
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.
|
|
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.
|
|
|
|
It hasn't been needed for ages.
|
|
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.
|
|
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.
|
|
|
|
This also improves is_hdf5_file() to use the proper file signature, not
just the extension. See 9040220452a9cc02706159c21c78e43b374446cf.
|
|
This code isn't needed any more, now that we don't simulate images. It
never worked very well - although we can read almost any sensible
format, writing images that match an arbitrary schema is very difficult.
See 41ed47a931e4c162c9a501981b6f19cd725f6e43 and https://gitlab.desy.de/thomas.white/crystfel/-/issues/81
|
|
|
|
It is horrible. But it's contained inside the DataTemplate module.
|
|
|
|
It seems to make more sense here, because it's all about interpreting
the contents of the DataTemplate structure.
|
|
|
|
This adds a central procedure (image_create_dp_bad_sat) to create all
the arrays. Then it's up to the loading procedure to put the values
into the arrays.
This also makes the loading procedures responsible for marking NaN/inf
pixels in the bad pixel map. This avoids an additional sweep through
the image data, and makes it possible to skip the NaN/inf check
altogether if the image data comes, as it often does, in format which
can't represent NaN/inf anyway.
Finally, it removes quite a lot of duplicated code.
|
|
|
|
These FP calls seem to be slower than expected. Using only one doubles
the speed.
|
|
|
|
|
|
Previously, a placeholder was put in the queue ("ZMQdata //" or
"ASAPOdata //"), and replaced by image_read_data_block. Instead, the
"final" placeholder can be put in the queue already.
Note that ASAP::O, at least, will replace this placeholder with a
filename delivered by the data transport.
|
|
Improvements:
- Recursive, so we can see how things are working at different levels
- Everything is profiled, even if not explicitly labelled
- No possibility of losing time
- Detects mistakes if routines aren't wrapped correctly
|
|
|
|
|
|
|
|
|
|
No other code path under image_expand_frames() actually opens the file,
because HDF5s are currently the only format supporting multiple frames.
The aim of the existence check is to give a better error message
(compared to the HDF5 backtrace splurge), but it doesn't need to be done
so early. In fact, checking so early had the side-effect of breaking
indexamajig --wait-for-file.
Fixes: https://gitlab.desy.de/thomas.white/crystfel/-/issues/65
|
|
Closes: https://gitlab.desy.de/thomas.white/crystfel/-/issues/27
|
|
|
|
|
|
|
|
|
|
On some systems, this conflicts with DST_NONE in sys/time.h.
|
|
|
|
|
|
Big improvement on just sending NAN back.
Fixes: https://gitlab.desy.de/thomas.white/crystfel/-/issues/37
|
|
Prompted by the article linked below, for each FIXME/TODO I've either
referenced an issue in the tracker, or removed it if it's not worth
fixing.
https://schleiss.io/plotting-source-code-todos-for-open-source-projects
|
|
|
|
|
|
This clears up multiple layering violations which were starting to get
in the way. It enables "string" headers to be stored directly, and it
will make it much simpler to add new header types in the future.
Along the way, this changes all the floating point header stuff to use
double precision. This is needed for EuXFEL event IDs.
Closes: https://gitlab.desy.de/thomas.white/crystfel/-/issues/34
|
|
This removes the big potential for confusion, which has happened several
times (see e.g. 095cbebaf6). It also fixes in-tree builds with CMake
(but seriously, always use out-of-tree builds).
Fixes #2.
|
|
The unique filename is needed by the GUI for looking up results in a
stream. Otherwise, the filename is "(null)" for everything and the
lookup just returns the first chunk in the stream.
The filename is generated based on the unique serial number for each
chunk, and is therefore unique across one run of indexamajig regardless
of the number of worker processes (-j). This might have to change in future
to accommodate jobs run across multiple nodes, if there is any demand
for looking at results in one big concatenated stream.
This also changes the condition for deciding when to look for a 'real'
file, to take into account that there is always a non-NULL filename.
|
|
|
|
|
|
|
|
This moves the entry point for loading MsgPack data to a new function,
image_read_data_block. Inside image.c, the image structure can be
created using exactly the same functions as for data files.
|
|
|
|
|