Skip to content
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

NXmx: incident_wavelength_weight --> incident_wavelength_weights #837

Closed
prjemian opened this issue Oct 20, 2020 · 1 comment · Fixed by #839
Closed

NXmx: incident_wavelength_weight --> incident_wavelength_weights #837

prjemian opened this issue Oct 20, 2020 · 1 comment · Fixed by #839

Comments

@prjemian
Copy link
Contributor

Per the NIAC decision to reserve the _weights suffix, the NXmx is noted for its use of incident_wavelength_weight. The existing field should be deprecated and a new field incident_wavelength_weights introduced to replace it.

@prjemian
Copy link
Contributor Author

Also, NXmx does not have a version number. I suggest adding a version attribute to track changes in the definition. Here is the definition from NXcanSAS:

    <attribute name="version" optional="true">
      <doc>
        Describes the version of the canSAS standard used to write this data. 
        This must be a text (not numerical) representation. Such as::
        
          @version="1.1"

      </doc>
      <enumeration>
        <item value="1.1" />
      </enumeration>
    </attribute>

prjemian added a commit that referenced this issue Oct 20, 2020
phyy-nx added a commit to cctbx/dxtbx that referenced this issue Aug 23, 2022
phyy-nx added a commit to cctbx/dxtbx that referenced this issue Sep 9, 2022
phyy-nx added a commit to cctbx/dxtbx that referenced this issue Sep 10, 2022
This is mostly a port (copy) of the spectrum reading code from FormatNexus.  I imagine we'll want to eliminate one of the two copies at some point. Includes fixes for non-contiguous masks, caching, tests, and a fix for FormatNexus which caused an off-by-one pixel read error for detector positions.

Details:
* Move file handle caching to the start method.  Needed since new implementation of beam/spectra needs access to the file handle outside of get_raw_data
* Update xfailing test of JF16M data to AssertionError test now that it reads the JF16M data using FormatNXmx, but there is a one pixel offset compared to FormatNexus
* Switch to using pint
* Bugfix in FormatNexus: remove extra pixel offset in fast direction.  There were two problems when constructing the panel object as a leaf of the detector hierarchy using the fast_pixel_direction NeXus field. The fast and slow directions are ready out correctly, but the origin was read out using get_cumulative_change_of_basis in order to include any offsets.  However, since the pixel size is the value of this field, it was included as an offset, leading to an extra pixel added in the fast direction. Additionally, get_cumulative_change_of_basis relies on the equipment_component chain, which fast_pixel_direction doesn't use, so only the fast_pixel_direction offset was picked up.  This is why there isn't an extra pixel in the slow direction.  Fix is to not include fast_pixel_direction field value when reading out the offset and to explicitly also read the slow_pixel_direction offset.
* Mark test as passing.  Off-by-one error fixed in in FormatNexus
* Include the offsets in fast and slow pixel direction. (these are usually 0)
* Need to add unit conversion
* Handle deprecation for weight vs. weights. See nexusformat/definitions#837
* Add tests for FormatNXmx reading spectra.  Uses the in memory version of testing. Tests both a single spectra for a dataset and a set of 3 spectra using variants derived from calibrated energies.
* Add comment pointing to new issue #549

Co-authored-by: Graeme Winter <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant