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

Tools: mcrun: optimization allows to specify criteria expression #1743

Merged
merged 3 commits into from
Oct 15, 2024

Conversation

farhi
Copy link
Contributor

@farhi farhi commented Oct 15, 2024

This PR provides the ability to specify an expression with --optimize-eval="EXPR" such as:

mxrun --optimize --optimize-monitor=psd1 --optimize-eval="d.intensity/d.dX" Test_Mono.instr Mono=1 OMM=14.219,14.223

This enables to optimize on existing monitors, and still use some predefined statistics within:

  • d.intensity The detector intensity;
  • d.error The detector intensity uncertainty;
  • d.values An array with [intensity, error, counts];
  • d.X0 d.Y0 Center of signal (1st moment);
  • d.dX d.dY Width of signal (2nd moment).

Default is d.intensity. Examples are:

  • d.intensity/d.dX for 1D;
  • d.intensity/d.dX/d.dY for 2D

This PR avoids to create specific monitors for optimization, as long as the 1st/2nd moments are satisfactory.

@willend willend merged commit 88bcd2b into McStasMcXtrace:main Oct 15, 2024
16 checks passed
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.

2 participants