-
Notifications
You must be signed in to change notification settings - Fork 68
Detector channels #1252
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Detector channels #1252
Changes from all commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
7157d25
Add new datatype, the union of NX_CHAR and NX_NUMBER
phyy-nx db047de
Change AXISNAME field of NXdata to allow character values
phyy-nx 3dc02ba
Whitespace
phyy-nx 6d23703
Add NXdata attribute default_slice
phyy-nx 6b2a84f
Add NX_CHAR_OR_NUMBER to the primitiveType enum
phyy-nx 4f3c73a
Whitespace
phyy-nx 81388d1
Add NXdetector_channel as a base class
phyy-nx 3382235
Apply suggestions from code review
phyy-nx ab45175
Add NXdetector_channel to NXdetector and NXmx
phyy-nx 1168f00
Merge branch 'main' into dimension_as_char
phyy-nx 4ba9645
Fix formatting
phyy-nx 6f2a056
Add example of default_sice using an integer as a string
phyy-nx 65b8c8e
Merge branch 'dimension_as_char' into detector_channel
phyy-nx 146a96a
Bring in additional fields from NXdetector into NXchannel
phyy-nx 355b408
Update base_classes/NXdetector_channel.nxdl.xml
phyy-nx 48a82e4
Bugfix in description
phyy-nx ac8c5d0
Full example
phyy-nx 6e924a0
Merge branch 'dimension_as_char' into detector_channel
phyy-nx 8ff58ed
Better example
phyy-nx bb6906e
Typo
phyy-nx d7ae84c
Added NX_CHAR as type for default_slice
phyy-nx 78566e1
Actually use NXCHAR_OR_NUMBER
phyy-nx ad0a129
Merge branch 'main' into dimension_as_char
phyy-nx d71b5f2
Merge branch 'dimension_as_char' into detector_channel
phyy-nx File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,162 @@ | ||
| <?xml version="1.0" encoding="UTF-8"?> | ||
| <?xml-stylesheet type="text/xsl" href="nxdlformat.xsl" ?> | ||
| <!-- | ||
| # NeXus - Neutron and X-ray Common Data Format | ||
| # | ||
| # Copyright (C) 2008-2022 NeXus International Advisory Committee (NIAC) | ||
| # | ||
| # This library is free software; you can redistribute it and/or | ||
| # modify it under the terms of the GNU Lesser General Public | ||
| # License as published by the Free Software Foundation; either | ||
| # version 3 of the License, or (at your option) any later version. | ||
| # | ||
| # This library is distributed in the hope that it will be useful, | ||
| # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
| # Lesser General Public License for more details. | ||
| # | ||
| # You should have received a copy of the GNU Lesser General Public | ||
| # License along with this library; if not, write to the Free Software | ||
| # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
| # | ||
| # For further information, see http://www.nexusformat.org | ||
| --> | ||
| <definition category="base" extends="NXobject" name="NXdetector_channel" | ||
| type="group" | ||
| xsi:schemaLocation="http://definition.nexusformat.org/nxdl/3.1 ../nxdl.xsd" | ||
| xmlns="http://definition.nexusformat.org/nxdl/3.1" | ||
| xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
| xmlns:xs="http://www.w3.org/2001/XMLSchema" | ||
| xmlns:ns="http://definition.nexusformat.org/nxdl/@NXDL_RELEASE@" | ||
| > | ||
|
|
||
| <symbols> | ||
| <doc> | ||
| These symbols will be used below to illustrate the coordination of the rank and sizes of datasets and the | ||
| preferred ordering of the dimensions. Each of these are optional (so the rank of the datasets | ||
| will vary according to the situation) and the general ordering principle is slowest to fastest. | ||
| The type of each dimension should follow the order of scan points, detector output (e.g. pixels), | ||
| then time-of-flight (i.e. spectroscopy, spectrometry). Note that the output of a detector is not limited | ||
| to single values (0D), lists (1D) and images (2D), but three or higher dimensional arrays can be produced | ||
| by a detector at each trigger. | ||
| </doc> | ||
|
|
||
| <symbol name="dataRank"><doc>Rank of the ``data`` field associated with this detector</doc></symbol> | ||
| <symbol name="nP"><doc>number of scan points</doc></symbol> | ||
| <symbol name="i"><doc>number of detector pixels in the slowest direction</doc></symbol> | ||
| <symbol name="j"><doc>number of detector pixels in the second slowest direction</doc></symbol> | ||
| <symbol name="k"><doc>number of detector pixels in the third slowest direction</doc></symbol> | ||
| </symbols> | ||
|
|
||
| <doc> | ||
| Description and metadata for a single channel from a multi-channel detector. | ||
|
|
||
| Given an :ref:`NXdata` group linked as part of an NXdetector group that has an axis with named channels (see the | ||
| example in :ref:`NXdata </NXdata@default_slice-attribute>`), the NXdetector will have a series of NXdetector_channel groups, one for each | ||
| channel, named CHANNELNAME_channel. | ||
|
|
||
| Example, given these axes in the NXdata group:: | ||
|
|
||
| @axes = ["image_id", "channel", ".", "."] | ||
|
|
||
| And this list of channels in the NXdata group:: | ||
|
|
||
| channel = ["threshold_1", "threshold_2", "difference"] | ||
|
|
||
| The NXdetector group would have three NXdetector_channel groups:: | ||
|
|
||
| detector:NXdetector | ||
| ... | ||
| threshold_1_channel:NXdetector_channel | ||
| threshold_energy = float | ||
| flatfield = float[i, j] | ||
| pixel_mask = uint[i, j] | ||
| flatfield_applied = bool | ||
| pixel_mask_applied = bool | ||
| threshold_2_channel:NXdetector_channel | ||
| threshold_energy = float | ||
| flatfield = float[i, j] | ||
| pixel_mask = uint[i, j] | ||
| flatfield_applied = bool | ||
| pixel_mask_applied = bool | ||
| difference_channel:NXdetector_channel | ||
| threshold_energy = float[2] | ||
|
phyy-nx marked this conversation as resolved.
|
||
| </doc> | ||
|
|
||
| <field name="threshold_energy" type="NX_FLOAT" units="NX_ENERGY"> | ||
| <doc>Energy at which a photon will be recorded</doc> | ||
| </field> | ||
|
|
||
| <field name="flatfield_applied" type="NX_BOOLEAN" > | ||
| <doc> | ||
| True when the flat field correction has been applied in the | ||
| electronics, false otherwise. | ||
| </doc> | ||
| </field> | ||
|
|
||
| <field name="flatfield" type="NX_NUMBER"> | ||
| <doc>Response of each pixel given a constant input</doc> | ||
| <dimensions rank="dataRank"> | ||
| <dim index="1" value="i" /> | ||
| <dim index="2" value="j" /> | ||
| <dim index="3" value="k" required="false"/> | ||
| </dimensions> | ||
| </field> | ||
|
|
||
| <field name="flatfield_errors" type="NX_FLOAT" > | ||
| <doc> | ||
| Errors of the flat field correction data. | ||
| The form flatfield_error is deprecated. | ||
| </doc> | ||
| <dimensions rank="2"> | ||
| <dim index="1" value="i"/> | ||
| <dim index="2" value="j"/> | ||
| </dimensions> | ||
| </field> | ||
|
|
||
| <field name="pixel_mask_applied" type="NX_BOOLEAN" > | ||
| <doc> | ||
| True when the pixel mask correction has been applied in the | ||
| electronics, false otherwise. | ||
| </doc> | ||
| </field> | ||
|
|
||
| <field name="pixel_mask" type="NX_INT"> | ||
| <doc> | ||
| Custom pixel mask for this channel. May include nP as the first dimension for | ||
| masks that vary for each scan point. | ||
| </doc> | ||
| <dimensions rank="dataRank"> | ||
| <dim index="2" value="i" /> | ||
| <dim index="3" value="j" /> | ||
| <dim index="4" value="k" required="false"/> | ||
| </dimensions> | ||
| </field> | ||
|
|
||
| <field name="saturation_value" type="NX_NUMBER"> | ||
| <doc> | ||
| The value at which the detector goes into saturation. | ||
| Especially common to CCD detectors, the data | ||
| is known to be invalid above this value. | ||
|
|
||
| For example, given a saturation_value and an underload_value, the valid | ||
| pixels are those less than or equal to the saturation_value and greater | ||
| than or equal to the underload_value. | ||
|
|
||
| The precise type should match the type of the data. | ||
| </doc> | ||
| </field> | ||
|
|
||
| <field name="underload_value" type="NX_NUMBER"> | ||
| <doc> | ||
| The lowest value at which pixels for this detector would be reasonably | ||
| measured. The data is known to be invalid below this value. | ||
|
|
||
| For example, given a saturation_value and an underload_value, the valid | ||
| pixels are those less than or equal to the saturation_value and greater | ||
| than or equal to the underload_value. | ||
|
|
||
| The precise type should match the type of the data. | ||
| </doc> | ||
| </field> | ||
| </definition> | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.