aboutsummaryrefslogtreecommitdiff
path: root/libcrystfel/src/image-hdf5.c
AgeCommit message (Collapse)Author
2023-07-26Fix memory leaks in header cachingThomas White
2023-05-05Formatting (fussiness)Thomas White
2023-05-05Move is_{hdf5,cbf,cbfgz}_file() to image.cThomas White
This also improves is_hdf5_file() to use the proper file signature, not just the extension. See 9040220452a9cc02706159c21c78e43b374446cf.
2023-05-02Remove image_write() and image_hdf5_write()Thomas White
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
2022-09-21Avoid nan/inf check unless data was given in float formatThomas White
2022-09-20load_hdf5_hyperslab: Add missing cleanupThomas White
2022-08-18Restructure image data array creationThomas White
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.
2022-05-04Add improved profilingThomas White
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
2022-04-20Recognise .nx5 as HDF5Thomas White
2022-03-09Meson: enable building without HDF5Thomas White
2022-03-08Fix slabbiness assumptionsThomas White
This adds a new routine, data_template_slabby_file_to_panel_coords, to be used (only!) in places where external forces require assumptions of slabbiness: pixel maps and MsgPack/HDF5 peak lists (including CXI-style). This also fixes the prototype of data_template_file_to_panel_coords to make the panel number strictly an input parameter. This was an oversight in the implementation of DataTemplate, and caused problems when reading non-slabby streams. Fixes: https://gitlab.desy.de/thomas.white/crystfel/-/issues/66
2022-03-02Move file_exists() check to right before opening the HDF5Thomas White
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
2022-03-02Formatting and increased verbosityThomas White
2021-10-20image_hdf5_read_peaks_cxi: Make sure array is big enoughThomas White
2021-10-20FussinessThomas White
2021-10-20image_hdf5_read_header_to_cache: Make space for terminatorThomas White
2021-09-17Handle headers from in-memory HDF5sThomas White
2021-09-17Handle in-memory HDF5sThomas White
2021-09-17Avoid pointless passing of image/eventThomas White
2021-09-07image_hdf5_read_header_to_cache: Remove double free on error pathThomas White
2021-07-23image_hdf5_write: Avoid weird pass-by-referenceThomas White
2021-07-23FormattingThomas White
2021-07-22Clean up shadowed variablesThomas White
2021-07-21image_hdf5_read_peaks_cxi: Fix error checksThomas White
2021-07-21Add missing cleanup on error pathsThomas White
2021-06-22Add string terminator for fixed-length HDF5 strings from arraysThomas White
2021-06-21Restore HDF5 string handlingThomas White
Closes: https://gitlab.desy.de/thomas.white/crystfel/-/issues/36
2021-05-28Pass errors back when retrieving values for wavelength etcThomas White
Big improvement on just sending NAN back. Fixes: https://gitlab.desy.de/thomas.white/crystfel/-/issues/37
2021-05-17Resolve FIXMEs and TODOsThomas White
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
2021-05-12Rework header caching layerThomas White
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
2021-04-27Rename libcrystfel's config.h to libcrystfel-config.hThomas White
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.
2021-04-01Implement loading of saturation mapThomas White
2021-03-30Add header caching layerThomas White
This simultaneously implements --copy-header/--copy-hdf5-field and gives access to metadata (e.g. detector position or wavelength) when loading from a stream with header-specified values.
2021-03-22Allow HDF5 path substitution when there are too many placeholder valuesThomas White
This allows, for example, masks which have fewer % signs in their HDF5 locations than the main data.
2021-03-09Add the ability to use multiple bad pixel masks at onceThomas White
2021-03-05Mass update of copyright dates in source code commentsThomas White
2020-09-16image_hdf5_read: Don't call image_freeThomas White
You didn't allocate it, so you don't free it.
2020-09-16Fix incorrect logic in HDF5 expansionThomas White
2020-09-07Catch another "NULL" event -> //Thomas White
2020-08-04Add image_write()Thomas White
This is a one-to-one transfer of the old hdf5_write_image()
2020-07-30Add missing config.h includesThomas White
2020-07-30Eliminate duplicate symbolsThomas White
This makes searching easier, and also permits Meson's unity build mode.
2020-07-29Fix a couple of memory bugs in event expansionThomas White
2020-07-29const-cleaningThomas White
2020-07-29Move image structure creation up to image_read()Thomas White
2020-07-29Add missing newlinesThomas White
2020-07-29Handle scalar values for HDF5 headersThomas White
2020-07-29Set default event ID when reading from HDF5 with NULL eventThomas White
2020-07-29Avoid segfault if there are no panels in DataTemplateThomas White
Obviously, this should never happen.
2020-07-29Recognise .cxi extension as HDF5Thomas White