Skip to content

Conversation

@nvaytet
Copy link
Member

@nvaytet nvaytet commented Jun 24, 2025

Add a notebook that takes in McStas event data and stores it in a NeXus CODA file for Odin.

The idea is that the files will look as realistic nexus data as possible.

" time_of_arrival = data[\"dim_1\", 1].copy()\n",
" time_of_arrival.unit = \"s\" # Hardcoded unit from the data.\n",
" positions = data[\"dim_1\", 2:5]\n",
" counts = (probabilities / probabilities.max()) * probability_scale_factor\n",
Copy link
Member Author

Choose a reason for hiding this comment

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

hmmm I think in what we did below we are not taking into account the weights/probabilities of the mcstas events.....
We are giving a weight of 1 to everything?

Copy link
Member Author

Choose a reason for hiding this comment

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

Now using np.repeat to duplicate the events to reproduce the mcstas event statistics.

@nvaytet nvaytet merged commit 3f1b8bd into main Jun 26, 2025
4 checks passed
@nvaytet nvaytet deleted the mcstas-to-nexus branch June 26, 2025 09:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants