-
Notifications
You must be signed in to change notification settings - Fork 125
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
Add polarisation spin state to ISIS ORSO file metadata #38468
Draft
adriazalvarez
wants to merge
19
commits into
main
Choose a base branch
from
save_pol_orso
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
5b55f50
Retrieve spin state form sample logs and add to ReflectometryDataSet …
adriazalvarez 5b935cb
Add instrument settings header file if polarization is present, also …
adriazalvarez 1f939f4
Add spin state to logs in polarization efficiencies correction algorithm
adriazalvarez b4e1fe7
Add test for checking polarization state is correctly saved on orso file
adriazalvarez 40effd8
Add release notes
adriazalvarez a110dd9
Add test for checking dataset names with different polarization/angles
adriazalvarez ff774f8
Update SaveISISReflectomtryORSO entry on docs
adriazalvarez aa1bd77
Add polarization in orso_helper_test
adriazalvarez 9127757
Don' print ws name when data is polarized
adriazalvarez 7b7888e
Fix tests printing output name when data is polarized
adriazalvarez 97ae101
Update system tests data files for save orso
adriazalvarez 568667b
Add python module for reflectometry constansts
adriazalvarez 212a7be
Add dependency on the interface:
adriazalvarez 74a7e37
change python destination path
adriazalvarez ce8c598
Add tests to check that ReflectometryReductionAuto is adding logs if …
adriazalvarez 4654bed
Add polarized parameter as is_polarized and as optional
adriazalvarez 11b29e6
Correct unique dataset names for Stitched workspaces
adriazalvarez 9b8e580
Add constants from cpp PolarizationCorrectionHelpers
adriazalvarez 14c696f
Add constants from cpp PolarizationCorrectionHelpers
adriazalvarez 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 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 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
25 changes: 25 additions & 0 deletions
25
Framework/PythonInterface/mantid/utils/reflectometry/CMakeLists.txt
This file contains 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,25 @@ | ||
# _polarization_helpers Python module | ||
|
||
set(MODULE_TEMPLATE src/polarization_helpers.cpp.in) | ||
|
||
# Files containing export definitions, these are automatically processed -- Do NOT sort this list. The order defines the | ||
# order in which the export definitions occur and some depend on their base classes being exported first -- | ||
set(EXPORT_FILES src/Exports/PolarizationCorrectionHelpers.cpp) | ||
|
||
set(MODULE_DEFINITION ${CMAKE_CURRENT_BINARY_DIR}/polarization_helpers.cpp) | ||
create_module(${MODULE_TEMPLATE} ${MODULE_DEFINITION} ${EXPORT_FILES}) | ||
|
||
# Create the target for this directory | ||
add_library(PythonReflHelpersModule ${MODULE_DEFINITION} ${EXPORT_FILES} ${PYTHON_INSTALL_FILES}) | ||
add_library(PythonReflectometryHelpersModule ALIAS PythonReflHelpersModule) | ||
|
||
set_python_properties(PythonReflHelpersModule _polarization_helpers) | ||
|
||
# Add the required dependencies | ||
target_link_libraries(PythonReflHelpersModule PRIVATE Mantid::Algorithms Mantid::PythonInterfaceCore) | ||
|
||
# Installation settings | ||
set_target_properties(PythonReflHelpersModule PROPERTIES INSTALL_RPATH "${EXT_INSTALL_RPATH}") | ||
mtd_install_shared_library( | ||
TARGETS PythonReflHelpersModule DESTINATION ${Python_SITELIB_RELPATH}/mantid/utils/reflectometry | ||
) |
9 changes: 8 additions & 1 deletion
9
Framework/PythonInterface/mantid/utils/reflectometry/__init__.py
This file contains 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 |
---|---|---|
@@ -1,6 +1,13 @@ | ||
# Mantid Repository : https://github.com/mantidproject/mantid | ||
# | ||
# Copyright © 2023 ISIS Rutherford Appleton Laboratory UKRI, | ||
# Copyright © 2024 ISIS Rutherford Appleton Laboratory UKRI, | ||
# NScD Oak Ridge National Laboratory, European Spallation Source, | ||
# Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS | ||
# SPDX - License - Identifier: GPL - 3.0 + | ||
|
||
############################################################################### | ||
# Load the C++ library and register the C++ class exports | ||
############################################################################### | ||
from mantid.utils import import_mantid_cext | ||
|
||
import_mantid_cext("._polarization_helpers", "mantid.utils.reflectometry", globals()) |
This file contains 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
26 changes: 26 additions & 0 deletions
26
.../PythonInterface/mantid/utils/reflectometry/src/Exports/PolarizationCorrectionHelpers.cpp
This file contains 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,26 @@ | ||
// Mantid Repository : https://github.com/mantidproject/mantid | ||
// | ||
// Copyright © 2024 ISIS Rutherford Appleton Laboratory UKRI, | ||
// NScD Oak Ridge National Laboratory, European Spallation Source, | ||
// Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS | ||
// SPDX - License - Identifier: GPL - 3.0 + | ||
|
||
#include "MantidAlgorithms/PolarizationCorrections/PolarizationCorrectionsHelpers.h" | ||
#include <boost/python/class.hpp> | ||
|
||
namespace { | ||
class SpinStatesORSO {}; | ||
} // namespace | ||
|
||
void export_SpinStatesORSO() { | ||
using namespace boost::python; | ||
|
||
class_<SpinStatesORSO>("SpinStatesORSO") | ||
.def_readonly("PP", &Mantid::Algorithms::SpinStatesORSO::PP) | ||
.def_readonly("PM", &Mantid::Algorithms::SpinStatesORSO::PM) | ||
.def_readonly("MP", &Mantid::Algorithms::SpinStatesORSO::MP) | ||
.def_readonly("MM", &Mantid::Algorithms::SpinStatesORSO::MM) | ||
.def_readonly("PO", &Mantid::Algorithms::SpinStatesORSO::PO) | ||
.def_readonly("MO", &Mantid::Algorithms::SpinStatesORSO::MO) | ||
.def_readonly("LOG_NAME", &Mantid::Algorithms::SpinStatesORSO::LOG_NAME); | ||
} |
20 changes: 20 additions & 0 deletions
20
Framework/PythonInterface/mantid/utils/reflectometry/src/polarization_helpers.cpp.in
This file contains 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,20 @@ | ||
// Mantid Repository : https://github.com/mantidproject/mantid | ||
// | ||
// Copyright © 2024 ISIS Rutherford Appleton Laboratory UKRI, | ||
// NScD Oak Ridge National Laboratory, European Spallation Source, | ||
// Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS | ||
// SPDX - License - Identifier: GPL - 3.0 + | ||
|
||
@AUTO_GENERATE_WARNING@ | ||
/********** Source = polarization_helpers.cpp.in **********************************************************/ | ||
|
||
#include <boost/python/def.hpp> | ||
#include <boost/python/module.hpp> | ||
|
||
// Forward declare | ||
@EXPORT_DECLARE@ | ||
|
||
BOOST_PYTHON_MODULE(_polarization_helpers) | ||
{ | ||
@EXPORT_FUNCTIONS@ | ||
} |
This file contains 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 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 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 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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here I have decided to return early because if the dataset is polarized is not necessary to prepend the ws name for unique datasets and in some cases the ws name would be repeated.