-
Notifications
You must be signed in to change notification settings - Fork 128
AlignAndFocusPowderSlim prototype #38279
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
Merged
jmborr
merged 40 commits into
mantidproject:main
from
peterfpeterson:ewm6343_aafpff_slim
Apr 23, 2025
Merged
Changes from all commits
Commits
Show all changes
40 commits
Select commit
Hold shift + click to select a range
39b27d8
Template code from class_maker
peterfpeterson 959f0c9
Make method public so it can be reused
peterfpeterson 6e91c36
Remove unused variable
peterfpeterson 28e55d4
First version with everything hard-coded
peterfpeterson fc7c314
Add methods to DetectorInfo to make the iterator more useful
peterfpeterson 58b6a72
Add support for having focus parameters
peterfpeterson 184b029
Simple parallel event processing
peterfpeterson d4bc8d2
Multithread finding min/max and add timers
peterfpeterson 16a8f1a
Move to std::optional like the rest of mantid
peterfpeterson a23fcfd
Add Fitler By Time
rosswhitfield b5b3bc4
Fix limits
rosswhitfield 26529b0
Add loading cal file and change output to be d-spacing
rosswhitfield d422c34
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 92b22d3
Set units
rosswhitfield 5198ea1
Add binning params
rosswhitfield a0d8b06
Simplify workspace creation
rosswhitfield 4ab22d9
Use mask from calibration file
rosswhitfield da284df
Filter banks to process before starting the main processing loop
peterfpeterson a8f47b9
Refactor code in preparation of having a loading task
peterfpeterson ebc027e
Refactor code to multithread reading from disk
peterfpeterson dd2380d
Undo changes to LoadBankFromDiskTask
peterfpeterson f5add3f
Add event filtering and loading logs
peterfpeterson 3dd2af7
Read 1GB of events from disk at a time to improve perfomance on large…
peterfpeterson 03b37fe
Change name following nexus refactor
peterfpeterson c4f6403
Split binning parameters into separate properties
peterfpeterson 00e2a65
Add focus positions and set them on the instrument
peterfpeterson df040ca
Change the units of the output workspace to TOF and fix all the math
peterfpeterson 1f5a30c
Add test with default values for everything
peterfpeterson 3c79214
Add test with values appropriate for the data
peterfpeterson 8d3b458
Expose how many banks to read in a single thread and add progress bar
peterfpeterson f75663b
Move chunking parameters to be input options
peterfpeterson f939fb5
Add release notes
peterfpeterson f1682bc
Change return since it is always a known value
peterfpeterson 77e7693
Make clear this is for vulcan plus small multithreading improvements
peterfpeterson 78103b0
Ignore commit from using black on the repository
peterfpeterson 427aaee
Ban 1GB VULCAN file from system test to keep things moving
peterfpeterson b7a129a
Fix issues spotted by clang
peterfpeterson 9cd87e0
Add user docs. Most of them are limitations
peterfpeterson d406875
Lots of small changes based on review observations
peterfpeterson ef34285
Bring back make_unique for cppcheck
peterfpeterson 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 hidden or 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 hidden or 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
70 changes: 70 additions & 0 deletions
70
Framework/DataHandling/inc/MantidDataHandling/AlignAndFocusPowderSlim.h
This file contains hidden or 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,70 @@ | ||
// 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 + | ||
#pragma once | ||
|
||
#include "MantidAPI/Algorithm.h" | ||
#include "MantidAPI/MatrixWorkspace_fwd.h" | ||
#include "MantidDataHandling/DllConfig.h" | ||
#include "MantidGeometry/IDTypes.h" | ||
|
||
namespace NeXus { | ||
class File; | ||
} | ||
|
||
namespace Mantid { | ||
namespace DataHandling { | ||
|
||
/** AlignAndFocusPowderSlim : TODO: DESCRIPTION | ||
*/ | ||
class MANTID_DATAHANDLING_DLL AlignAndFocusPowderSlim : public API::Algorithm { | ||
public: | ||
const std::string name() const override; | ||
int version() const override; | ||
const std::string category() const override; | ||
const std::string summary() const override; | ||
const std::vector<std::string> seeAlso() const override; | ||
|
||
class MANTID_DATAHANDLING_DLL BankCalibration { | ||
public: | ||
BankCalibration(const detid_t idmin, const detid_t idmax, const std::map<detid_t, double> &calibration_map); | ||
const double &value(const detid_t detid) const; | ||
const detid_t &idmin() const; | ||
detid_t idmax() const; | ||
|
||
private: | ||
std::vector<double> m_calibration; | ||
detid_t m_detid_offset; | ||
}; | ||
|
||
private: | ||
void init() override; | ||
std::map<std::string, std::string> validateInputs() override; | ||
void exec() override; | ||
rboston628 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
API::MatrixWorkspace_sptr createOutputWorkspace(const size_t numHist, const bool linearBins, const double x_delta); | ||
API::MatrixWorkspace_sptr editInstrumentGeometry(API::MatrixWorkspace_sptr &wksp, const double l1, | ||
const std::vector<double> &polars, | ||
const std::vector<specnum_t> &specids, | ||
const std::vector<double> &l2s, | ||
const std::vector<double> &azimuthals); | ||
void initCalibrationConstants(API::MatrixWorkspace_sptr &wksp, const std::vector<double> &difc_focus); | ||
void loadCalFile(const API::Workspace_sptr &inputWS, const std::string &filename, | ||
const std::vector<double> &difc_focus); | ||
|
||
std::map<detid_t, double> m_calibration; // detid: 1/difc | ||
std::set<detid_t> m_masked; | ||
bool is_time_filtered{false}; | ||
size_t pulse_start_index{0}; | ||
size_t pulse_stop_index{std::numeric_limits<size_t>::max()}; | ||
/// Index to load start at in the file | ||
std::vector<int64_t> loadStart; | ||
/// How much to load in the file | ||
std::vector<int64_t> loadSize; | ||
}; | ||
|
||
} // namespace DataHandling | ||
} // namespace Mantid |
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.
Uh oh!
There was an error while loading. Please reload this page.