- Capitalize Rugnux as a proper noun throughout the prose; the command stays lowercase `rugnux` in code font. RUGNUX_OVERVIEW.md is retitled "What Rugnux does". - ACKNOWLEDGEMENT.md cites the raw-data repositories only: dataset counts and DOI prefixes moved out (EXTERNAL_TEST_DATA.md owns them), the ESRF data portal gains its citation (Dimper et al. 2019), and MXRDR remains name + link - it has no canonical citation paper. - RUGNUX_FORMATS.md: the CCD formats (marCCD, SMV) are supported as-is with very limited scope, and per-panel XFEL data is not read. - Fix wrong facts a reader would act on: nonexistent `make jfjoch` targets, invalid udev rules, PUSH sockets documented as PULL, swapped writer width/height, underload semantics, the transposed pixel-mask numpy example (the server checks width and height separately), the Durin/Neggia mask-bit table, FPGA threshold register addresses and the mailbox bit field, the I2C core's document number (PG090), an inverted MODEL_FIT_SIGMA formula, a self-inconsistent worked report example, and 11 cross-page anchors whose slugs carry MyST section numbers. - Unify CC1/2 spelling in prose; math notation and report keys unchanged. - Sweep grammar, typos and editing residue across the FPGA, deployment, streaming and analysis pages, including historical CHANGELOG typos. - rugnux_cli.cpp: the -S usage/error examples pair 96 with P43212; 92 names a different group. - Root THIRD_PARTY_NOTICES.md: scope the GPL-compatibility claim (CUDA EULA) and the vendored-table intro (traccc); the docs copy regenerates via update_version.sh. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
52 lines
2.0 KiB
Markdown
52 lines
2.0 KiB
Markdown
# Pixel mask
|
|
|
|
## Mask format
|
|
|
|
Jungfraujoch generally follows the [NXmx format](https://manual.nexusformat.org/classes/applications/NXmx.html) for the pixel mask.
|
|
The pixel mask is a 32-bit unsigned integer array of the same size as the image.
|
|
The conditions for masking a pixel are encoded by setting a particular bit to one. This makes it possible to record the reason why a pixel is included in the mask, and several reasons can be recorded for one pixel at the same time.
|
|
|
|
Bit values are set as follows:
|
|
|
|
Bit 0 - gap (pixel with no sensor)
|
|
|
|
Bit 1 - error pixel (for PSI JUNGFRAU: pixel doesn't set proper gain during pedestal, for DECTRIS: pixel is part of detector pixel mask)
|
|
|
|
Bit 4 - noisy pixel (for PSI JUNGFRAU: pixel pedestal G0 RMS is over threshold, for DECTRIS: pixel was flagged with signal during dark data collection at initialization)
|
|
|
|
Bit 8 - user defined mask
|
|
|
|
Bit 9 - beam stop shadow (found by `rugnux --detect-beam-stop`, on by default; see [Rugnux](RUGNUX.md)).
|
|
Unlike the other bits this one belongs to the run that found it, not to the dataset: Rugnux clears it
|
|
at the start of every run, so a mask read back from a file that carries one starts clear. The user
|
|
mask (bit 8) is left alone.
|
|
|
|
Bit 30 - module edge (only for PSI systems)
|
|
|
|
Bit 31 - chip edge interpolated pixel (multipixel)
|
|
|
|
## Custom user mask
|
|
|
|
Jungfraujoch allows a custom user mask to be uploaded. This happens in two steps. First create the mask in TIFF format:
|
|
|
|
```python
|
|
import numpy as np
|
|
import tifffile as tiff
|
|
|
|
# Create an array matching a 2068 x 2164 (width x height) image: 2164 rows, 2068 columns
|
|
array = np.zeros((2164, 2068), dtype=np.uint32)
|
|
|
|
# Mark the pixel at column 400, row 300 with the value 1
|
|
array[300, 400] = 1
|
|
|
|
# Save the array as a TIFF file
|
|
tiff.imwrite('mask.tiff', array)
|
|
```
|
|
|
|
Pixels with non-zero value in the TIFF file will be marked as belonging to the user mask (bit 8).
|
|
|
|
Then upload the mask to Jungfraujoch server:
|
|
```shell
|
|
curl -v http://<jfjoch_broker http address>/config/user_mask.tiff -XPUT --data-binary @mask.tiff
|
|
```
|