Skip to content

Conversation

@jokasimr
Copy link
Contributor

@jokasimr jokasimr commented May 6, 2025

Previously the min-max range of wavelength and incident angle in the orso files could be nan if such values occurred in the data. That happened because we don't explicitly add a mask for events with nan in the coordinates, we don't need an explicit mask to exclude such events in the reduction because they are discarded in the binning anyway.

@github-project-automation github-project-automation bot moved this to In progress in Development Board May 6, 2025
@jokasimr jokasimr moved this from In progress to Selected in Development Board May 6, 2025
min_ = coord.min().value
max_ = coord.max().value
min_ = coord.nanmin().value
max_ = coord.nanmax().value
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just for curiosity when do events end up with a nan coord?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That typically happens when we are unable to estimate the wavelength of the neutron.
We are unable to estimate the wavelength of the neutron if it arrived at a time, at a place in the detector where

  • we don't expect to see any events, or
  • the wavelength of the neutron is ambiguous.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As an example, here is where the wavelength is computed in the Amor workflow: https://github.com/scipp/essreflectometry/blob/main/src/ess/amor/conversions.py#L122-L130

If the arrival time is outside of the expected range it's assigned nan.

@jokasimr jokasimr merged commit 49e72e1 into main May 7, 2025
4 checks passed
@jokasimr jokasimr deleted the fix-orso-aggregates branch May 7, 2025 12:33
@github-project-automation github-project-automation bot moved this from Selected to Done in Development Board May 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants