Merge branch '2411-NXmx-docs' into 'main'

version 1.0.0-rc.26 minor fixes

See merge request jungfraujoch/nextgendcu!102
This commit is contained in:
2024-11-27 16:27:41 +01:00
4 changed files with 52 additions and 10 deletions
+1
View File
@@ -4,6 +4,7 @@
#ifndef JFJOCH_AUTOINCRVECTOR_H
#define JFJOCH_AUTOINCRVECTOR_H
#include <vector>
#include "JFJochException.h"
template <class T>
+44 -6
View File
@@ -17,10 +17,12 @@ Writer needs to be started as a background service, with the following command:
jfjoch_writer {options} <address to connect via ZeroMQ to DCU>
Options:
-R<int> | --root_dir=<int> Root directory for file writing
-H<int> | --http_port=<int> HTTP port for statistics
-r<int> | --zmq_repub_port=<int> ZeroMQ port for PUSH socket to republish images
-f<int> | --zmq_file_port=<int> ZeroMQ port for PUB socket for notifications on finalized files
-w<int> | --rcv_watermark=<int> Receiving ZeroMQ socket watermark (default = 100)
-W<int> | --repub_watermark=<int> Republish ZeroMQ socket watermark (default = 1000)
```
for example:
```
@@ -111,14 +113,50 @@ For example `header_appendix` of `{"param1": "test1", "param2": ["test1", "test2
Notifications for finalized files are optional, if notification port number is omitted this functionality is not enabled.
## NXmx extensions
Jungfraujoch aims to generate files compliant with NXmx format, as well as make them as close as possible to files
written by DECTRIS Filewriter. This ensures the file compatibility of Neggia and Durin XDS plugins, as well as Albula viewer.
## HDF5 file structure
Jungfraujoch aims to generate files compliant with NXmx format, as well as make them as close as possible to files
written by DECTRIS Filewriter. This ensures the file compatibility of Neggia and Durin XDS plugins, as well as Albula viewer.
### Master file
There are custom extension to NXmx format. These will be documented in the future.
Specifically, if data collection was configured with `header_appendix` having key equal to `hdf5` and value as JSON
object with number and string values. These will be added to `/entry/user`.
### Data file
Data file has the following structure:
| Location | Description | Optional |
|------------------------------------|----------------------------------------------------------------------------------------------------------------------|:--------:|
| /entry/data/data | Images | |
| /entry/detector/timestamp | Timestamp of the image | |
| /entry/detector/exptime | Exposure time of the image | |
| /entry/detector/number | Image number; if image rejection was used this will be the original image number | |
| /entry/azint/bin_to_q | Azimuthal integration - bin-to-Q mapping | X |
| /entry/azint/image | Azimuthal integration - per image | X |
| /entry/bkg_estimate | Background estimate table | X |
| /entry/MX/peakXPosRaw | Peak position X (see [CXI format](https://raw.githubusercontent.com/cxidb/CXI/master/cxi_file_format.pdf)) | X |
| /entry/MX/peakYPosRaw | Peak position Y (see [CXI format](https://raw.githubusercontent.com/cxidb/CXI/master/cxi_file_format.pdf)) | X |
| /entry/MX/peakTotalIntensity | Peak total intensity (see [CXI format](https://raw.githubusercontent.com/cxidb/CXI/master/cxi_file_format.pdf)) | X |
| /entry/MX/nPeaks | Number of peaks per image (see [CXI format](https://raw.githubusercontent.com/cxidb/CXI/master/cxi_file_format.pdf)) | X |
| /entry/MX/strongPixels | Number of strong pixel per image | X |
| /entry/MX/nPeaksRingFiltered | Number of peaks not belonging to rings | X |
| /entry/MX/imageIndexed | Image is successfully indexed | X |
| /entry/MX/latticeIndexed | Crystal lattice for the image, assuming it is indexed | X |
| /entry/jungfrau/info | Debug field of the JF detector | X |
| /entry/jungfrau/storageCell | Storage cell number | X |
| /entry/jungfrau/rcvDelay | Receiver delay for the image (Jungfraujoch debugging) | X |
| /entry/jungfrau/rcvFreeSendBuffers | Receiver number of free send buffers at the time of sending the image (Jungfraujoch debugging) | X |
| /entry/roi/{roi_name}/max | Max pixel value for roi named {roi_name} | X |
| /entry/roi/{roi_name}/sum | Sum pixel value for roi named {roi_name} | X |
| /entry/roi/{roi_name}/npixel | Number of valid pixel for roi named {roi_name} | X |
| /entry/xfel/pulseID | Pulse ID (for XFEL only) | X |
| /entry/xfel/eventCode | Event code (for XFEL only) | X |
If spot finding is enabled, spots are written in the [CXI format](https://raw.githubusercontent.com/cxidb/CXI/master/cxi_file_format.pdf) and are recognized by CrystFEL. The following has to be added to the CrystFEL geometry file:
```
peak_list = /opt/MX
peak_list_type = cxi
```
There are custom extension to NXmx format. These will be documented in the future.
+4 -1
View File
@@ -9,12 +9,14 @@ void HDF5DataFilePluginROI::OpenFile(HDF5File &data_file, const DataMessage &msg
void HDF5DataFilePluginROI::Write(const DataMessage &msg, uint64_t image_number) {
for (const auto &r: msg.roi) {
if (roi_data.find(r.first) != roi_data.end()) {
if (roi_data.contains(r.first)) {
roi_data[r.first].max.reserve(RESERVE_IMAGES);
roi_data[r.first].sum.reserve(RESERVE_IMAGES);
roi_data[r.first].npixel.reserve(RESERVE_IMAGES);
}
roi_data[r.first].max[image_number] = r.second.max_count;
roi_data[r.first].sum[image_number] = r.second.sum;
roi_data[r.first].npixel[image_number] = r.second.pixels;
}
}
@@ -29,5 +31,6 @@ void HDF5DataFilePluginROI::WriteFinal(HDF5File &data_file) {
HDF5Group group_roi(data_file, "/entry/roi/" + r.first);
group.SaveVector("max", r.second.max.vec());
group.SaveVector("sum", r.second.sum.vec());
group.SaveVector("npixel", r.second.npixel.vec());
}
}
+3 -3
View File
@@ -5,13 +5,13 @@
#define JFJOCH_HDF5DATAFILEPLUGINROI_H
#include <map>
#include <vector>
#include "../common/AutoIncrVector.h"
#include "HDF5DataFilePlugin.h"
struct ROIData {
AutoIncrVector<float> max;
AutoIncrVector<float> sum;
AutoIncrVector<int64_t> max;
AutoIncrVector<int64_t> sum;
AutoIncrVector<int64_t> npixel;
};
class HDF5DataFilePluginROI : public HDF5DataFilePlugin {