Skip to content

Conversation

MialLewis
Copy link
Contributor

@MialLewis MialLewis commented May 8, 2025

Description of work

Summary of work

This PR corrects the error propagation for the PolarizationEfficienciesWildes algorithm.

As part of this work a class ErrorPropagation has been added to PolarizationCorrectionsHelpers.h. This generic class utilizes the eigen AutoDiff module to automatically calculate the partials for different input variables. If there is wider interest in this class I will move it into the kernel in a separate PR.

The PolarizationEfficienciesWildes algorithm has been refactored slightly to enable use of the ErrorPropagation class and to remove the use of derived quantities in workspace arithmetic.

The theory behind the approach to error propagation can be read: #37768

Fixes #37768

To test:

  1. Check all unit tests pass. As unit tests regarding the values of the derived parameters were implemented, this proves that the calculation of the values of these parameters is unchanged.
  2. Check unit tests for the ErrorPropagation class in PolarizationCorrectionsHelpersTest. These include simple examples testErrorPropagation_linear, testErrorPropagation_quad and testErrorPropagation_mult_vars that prove the function of the class. You can check these on paper/using wolfram alpha. The latter test I copied from this blog, obtaining the same results: https://michaelspieler.com/post/eigen-autodiff/
  3. Script to run PolarizationEfficienciesWildes on some real (system test) data:
from mantid.simpleapi import *

Load(Filename=r'POLREF00032130.nxs', OutputWorkspace='POLREF00032130')
ConvertUnits(InputWorkspace='POLREF00032130', OutputWorkspace='POLREF00032130_y', Target='Wavelength', ConvertFromPointData=False)
Rebin(InputWorkspace='POLREF00032130_y', OutputWorkspace='POLREF00032130_y_rb', Params='0.01', PreserveEvents=False)
SumSpectra(InputWorkspace='POLREF00032130_y_rb', OutputWorkspace='POLREF00032130_y_rb_sum')
PolarizationEfficienciesWildes(InputNonMagWorkspace='POLREF00032130_y_rb_sum', OutputFpEfficiency='fp', OutputFaEfficiency='fa', IncludeDiagnosticOutputs=True)

  1. Check error values output are sensible (however you determine that!)

Reviewer

Please comment on the points listed below (full description).
Your comments will be used as part of the gatekeeper process, so please comment clearly on what you have checked during your review. If changes are made to the PR during the review process then your final comment will be the most important for gatekeepers. In this comment you should make it clear why any earlier review is still valid, or confirm that all requested changes have been addressed.

Code Review

  • Is the code of an acceptable quality?
  • Does the code conform to the coding standards?
  • Are the unit tests small and test the class in isolation?
  • If there is GUI work does it follow the GUI standards?
  • If there are changes in the release notes then do they describe the changes appropriately?
  • Do the release notes conform to the release notes guide?

Functional Tests

  • Do changes function as described? Add comments below that describe the tests performed?
  • Do the changes handle unexpected situations, e.g. bad input?
  • Has the relevant (user and developer) documentation been added/updated?

Does everything look good? Mark the review as Approve. A member of @mantidproject/gatekeepers will take care of it.

Gatekeeper

If you need to request changes to a PR then please add a comment and set the review status to "Request changes". This will stop the PR from showing up in the list for other gatekeepers.

@MialLewis MialLewis changed the title Use first order taylor series to propagate errors PolarizationEfficiencesWildes algorithm Use first order taylor series to propagate errors PolarizationEfficienciesWildes algorithm May 8, 2025
@MialLewis MialLewis changed the title Use first order taylor series to propagate errors PolarizationEfficienciesWildes algorithm Correct error propagation on PolarizationEfficienciesWildes algorithm May 8, 2025
@MialLewis MialLewis added this to the Release 6.13 milestone May 9, 2025
@MialLewis MialLewis moved this from New to Review in ISIS LSS Sprint Planning May 9, 2025
@MialLewis MialLewis added Reflectometry Issues and pull requests related to reflectometry ISIS: LSS Issue and pull requests relating to SANS and Reflectometry (Large Scale Structures) at ISIS labels May 9, 2025
@MialLewis MialLewis marked this pull request as ready for review May 12, 2025 09:04
@MialLewis MialLewis force-pushed the 37768_improve_error_calc_in_PolarizationEfficienciesWildes branch from c661b09 to 5a4dabb Compare May 13, 2025 09:57
@MialLewis
Copy link
Contributor Author

MialLewis commented May 13, 2025

This graph shoes I/Sigma for the output of ReflectometryISISCalculatePolEff before and after (new) this change. This is the wrapper algorithm that relies upon PolarizationEfficienciesWildes.

As you can see, the error is reduced relative to the signal across the board.

image

@MialLewis MialLewis force-pushed the 37768_improve_error_calc_in_PolarizationEfficienciesWildes branch from 89d0211 to 1482c70 Compare May 16, 2025 17:27
Copy link
Contributor

@adriazalvarez adriazalvarez left a comment

Choose a reason for hiding this comment

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

I'm currently having a segfault when running the test code in windows, only difference wrt the code in the example is that I load the file from the data archive as i don't have it locally:

from mantid.simpleapi import *

Load(Filename='POLREF00032130', OutputWorkspace='POLREF00032130')
ConvertUnits(InputWorkspace='POLREF00032130', OutputWorkspace='POLREF00032130_y', Target='Wavelength', ConvertFromPointData=False)
Rebin(InputWorkspace='POLREF00032130_y', OutputWorkspace='POLREF00032130_y_rb', Params='0.01')
SumSpectra(InputWorkspace='POLREF00032130_y_rb', OutputWorkspace='POLREF00032130_y_rb_sum')
PolarizationEfficienciesWildes(InputNonMagWorkspace='POLREF00032130_y_rb_sum', OutputFpEfficiency='fp', OutputFaEfficiency='fa', IncludeDiagnosticOutputs=True)

Seems the segfault is happening when calling evaluate workspaces in the error propagation class.

I have added a few minor comments here and there.

}

private:
Func compute_func;
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe camelCase is better here?

Suggested change
Func compute_func;
Func computeFunc;

}
};

template <size_t N, typename Func> auto make_error_propagation(Func &&func) {
Copy link
Contributor

Choose a reason for hiding this comment

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

idem previous camel case comment

const size_t specSize = outWs->blocksize();

// cppcheck-suppress unreadVariable
const bool condition = Kernel::threadSafe((*args)..., *outWs);
Copy link
Contributor

Choose a reason for hiding this comment

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

Could this be renamed differently? isThreadSafe perhaps?

}

PolarizationEfficienciesWildes::FlipperWorkspaces PolarizationEfficienciesWildes::getFlipperWorkspaces(const bool mag) {
if (mag) {
Copy link
Contributor

Choose a reason for hiding this comment

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

can mag be renamed to something like isMagneticWs or similar?

void PolarizationEfficienciesWildes::mapSpinStateWorkspaces() {
const WorkspaceGroup_sptr magWsGrp = getProperty(PropNames::INPUT_MAG_WS);
const WorkspaceGroup_sptr nonMagWsGrp = getProperty(PropNames::INPUT_NON_MAG_WS);
if (magWsGrp != nullptr) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Personal preference situation, you can leave it as it is if you would prefer to be more explicit.

Suggested change
if (magWsGrp != nullptr) {
if (magWsGrp) {

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I agree, I remember spotting this but forgot to change!

const double expectedTPMO = (2 * expectedPEfficiency) - 1;
const double expectedAEfficiency = (EXPECTED_PHI / (2 * expectedTPMO)) + 0.5;
const double expectedTAMO = (2 * expectedAEfficiency) - 1;
const std::pair<double, double> expectedPEfficiency = {0.98, 0.9899494934};
Copy link
Contributor

Choose a reason for hiding this comment

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

Another preference type situation, so feel free to leave as is, i think here compiler can infer the type without ambiguity, but as there are many const std::pair<double,double>, perhaps it would make it a bit cleaner to use an alias?

Suggested change
const std::pair<double, double> expectedPEfficiency = {0.98, 0.9899494934};
const std::pair expectedPEfficiency = {0.98, 0.9899494934};

const double expectedTPMO = (2 * expectedPEfficiency) - 1;
const double expectedAEfficiency = 0.99;
const double expectedTAMO = (2 * expectedAEfficiency) - 1;
const std::pair<double, double> expectedPEfficiency = {0.98, 0.9899494934};
Copy link
Contributor

Choose a reason for hiding this comment

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

The expected value from the errors comes from the autodiff class? At least with the simplest error, we should add a test to compare with results taken from another method

Copy link
Contributor Author

@MialLewis MialLewis May 20, 2025

Choose a reason for hiding this comment

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

Yes I've taken these from the autodiff class. As I tested the errors calculated by the autodiff class against hand calculations in each of the following tests, I had confidence in these values: Framework/Algorithms/test/PolarizationCorrections/PolarizationCorrectionsHelpersTest.h

Given this, and the fact the signal remains the same as before, do you agree?

Copy link
Contributor

Choose a reason for hiding this comment

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

If you ran the numbers with another method and everything agrees, then it is fine for me, perhaps we could mention it in a comment ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I haven't run these numbers against another method, though I tested the errors calculated against hand calcs using the algorithm in general against other functions in the unit tests.

@github-project-automation github-project-automation bot moved this from Review to In Progress in ISIS LSS Sprint Planning May 20, 2025
@MialLewis
Copy link
Contributor Author

MialLewis commented May 20, 2025

I'm currently having a segfault when running the test code in windows, only difference wrt the code in the example is that I load the file from the data archive as i don't have it locally:

from mantid.simpleapi import *

Load(Filename='POLREF00032130', OutputWorkspace='POLREF00032130')
ConvertUnits(InputWorkspace='POLREF00032130', OutputWorkspace='POLREF00032130_y', Target='Wavelength', ConvertFromPointData=False)
Rebin(InputWorkspace='POLREF00032130_y', OutputWorkspace='POLREF00032130_y_rb', Params='0.01')
SumSpectra(InputWorkspace='POLREF00032130_y_rb', OutputWorkspace='POLREF00032130_y_rb_sum')
PolarizationEfficienciesWildes(InputNonMagWorkspace='POLREF00032130_y_rb_sum', OutputFpEfficiency='fp', OutputFaEfficiency='fa', IncludeDiagnosticOutputs=True)

Seems the segfault is happening when calling evaluate workspaces in the error propagation class.

I have added a few minor comments here and there.

Thanks, will have to look in to this tomorrow.

I seem to be able to reproduce a different seg fault, it's an access violation in a unexpected location, seemingly during LoadEventNexus

void MatrixWorkspace::rebuildDetectorIDGroupings() {
  const auto &detInfo = detectorInfo();
  const auto &allDetIDs = detInfo.detectorIDs();
  const auto &specDefs = m_indexInfo->spectrumDefinitions();
  const auto indexInfoSize = static_cast<int64_t>(m_indexInfo->size());
  enum class ErrorCode { None, InvalidDetIndex, InvalidTimeIndex };
  std::atomic<ErrorCode> errorValue(ErrorCode::None);
#pragma omp parallel for <-------SEG FAULT HERE
  for (int64_t i = 0; i < indexInfoSize; ++i) {

I replicated this using data stored locally.

Mantid logs until fault:

AnalysisDataService-[Debug] class Mantid::Kernel::DataService<class Mantid::API::Workspace> * __ptr64 cleared.
AlgorithmManager-[Debug] 2 Finished algorithms removed from the managed algorithms list. 0 remaining.
ConfigService-[Debug] Looking for POLREF at ISIS.
FacilityInfo-[Debug] Instrument 'POLREF' found as POLREF at ISIS.
ConfigService-[Debug] Looking for POLREF at ISIS.
FacilityInfo-[Debug] Instrument 'POLREF' found as POLREF at ISIS.
FileFinder-[Debug] vector findRun('POLREF00032133', exts[18])
ConfigService-[Debug] Looking for POLREF at ISIS.
FacilityInfo-[Debug] Instrument 'POLREF' found as POLREF at ISIS.
FileFinder-[Debug] getExtension(POLREF00032133, exts[7])
FileFinder-[Debug] Failed to find extension. Just using last '.'
FileFinder-[Debug] toInstrumentAndNumber(POLREF00032133)
ConfigService-[Debug] Looking for POLREF at ISIS.
FacilityInfo-[Debug] Instrument 'POLREF' found as POLREF at ISIS.
FileFinder-[Debug] get archive search for the facility...ISISDataSearch
FileFinder-[Information] Found path = 1
FileLoaderRegistry-[Debug] Trying to find loader for 'C:\repos\mantid_build_311\ExternalData\Testing\Data\SystemTest\POLREF00032133.nxs'
FileLoaderRegistry-[Debug] Checking LoadEMUHdf version 1
FileLoaderRegistry-[Debug] LoadEMUHdf returned with confidence=0
FileLoaderRegistry-[Debug] Checking LoadEventNexus version 1
FileLoaderRegistry-[Debug] LoadEventNexus returned with confidence=80
FileLoaderRegistry-[Debug] Checking LoadILLDiffraction version 1
FileLoaderRegistry-[Debug] LoadILLDiffraction returned with confidence=0
FileLoaderRegistry-[Debug] Checking LoadILLIndirect version 2
FileLoaderRegistry-[Debug] LoadILLIndirect returned with confidence=0
FileLoaderRegistry-[Debug] Checking LoadILLLagrange version 1
FileLoaderRegistry-[Debug] LoadILLLagrange returned with confidence=0
FileLoaderRegistry-[Debug] Checking LoadILLPolarizedDiffraction version 1
FileLoaderRegistry-[Debug] LoadILLPolarizedDiffraction returned with confidence=0
FileLoaderRegistry-[Debug] Checking LoadILLReflectometry version 1
FileLoaderRegistry-[Debug] LoadILLReflectometry returned with confidence=0
FileLoaderRegistry-[Debug] Checking LoadILLSALSA version 1
FileLoaderRegistry-[Debug] LoadILLSALSA returned with confidence=0
FileLoaderRegistry-[Debug] Checking LoadILLSANS version 1
FileLoaderRegistry-[Debug] LoadILLSANS returned with confidence=0
FileLoaderRegistry-[Debug] Checking LoadILLTOF version 3
FileLoaderRegistry-[Debug] LoadILLTOF returned with confidence=0
FileLoaderRegistry-[Debug] Checking LoadISISNexus version 2
FileLoaderRegistry-[Debug] LoadISISNexus returned with confidence=75
FileLoaderRegistry-[Debug] Checking LoadMD version 1
FileLoaderRegistry-[Debug] LoadMD returned with confidence=0
FileLoaderRegistry-[Debug] Checking LoadMLZ version 1
FileLoaderRegistry-[Debug] LoadMLZ returned with confidence=0
FileLoaderRegistry-[Debug] Checking LoadMcStas version 1
FileLoaderRegistry-[Debug] LoadMcStas returned with confidence=0
FileLoaderRegistry-[Debug] Checking LoadMcStasNexus version 1
FileLoaderRegistry-[Debug] LoadMcStasNexus returned with confidence=0
FileLoaderRegistry-[Debug] Checking LoadMuonNexusV2 version 1
FileLoaderRegistry-[Debug] LoadMuonNexusV2 returned with confidence=0
FileLoaderRegistry-[Debug] Checking LoadNXSPE version 1
FileLoaderRegistry-[Debug] LoadNXSPE returned with confidence=0
FileLoaderRegistry-[Debug] Checking LoadNXcanSAS version 1
FileLoaderRegistry-[Debug] LoadNXcanSAS returned with confidence=0
FileLoaderRegistry-[Debug] Checking LoadNexusProcessed version 1
FileLoaderRegistry-[Debug] LoadNexusProcessed returned with confidence=0
FileLoaderRegistry-[Debug] Checking LoadNexusProcessed version 2
FileLoaderRegistry-[Debug] LoadNexusProcessed returned with confidence=0
FileLoaderRegistry-[Debug] Checking LoadPLN version 1
FileLoaderRegistry-[Debug] LoadPLN returned with confidence=0
FileLoaderRegistry-[Debug] Checking LoadQKK version 1
FileLoaderRegistry-[Debug] LoadQKK returned with confidence=0
FileLoaderRegistry-[Debug] Checking LoadSINQFocus version 1
FileLoaderRegistry-[Debug] LoadSINQFocus returned with confidence=0
FileLoaderRegistry-[Debug] Checking LoadSassena version 1
FileLoaderRegistry-[Debug] LoadSassena returned with confidence=0
FileLoaderRegistry-[Debug] Checking LoadTOFRawNexus version 1
FileLoaderRegistry-[Debug] LoadTOFRawNexus returned with confidence=0
FileLoaderRegistry-[Debug] Found loader LoadEventNexus for file 'C:\repos\mantid_build_311\ExternalData\Testing\Data\SystemTest\POLREF00032133.nxs'
Load-[Notice] Load started
Load-[Information] Algorithm: Load v1
Load-[Information] Execution Date: 2025-05-20 22:24:39.521444000
Load-[Information] Execution Duration: -1 seconds
Load-[Information] UUID: a1be6ef3-da3f-4553-a059-a2a3cd52e6fe
Load-[Information] Parameters:
Load-[Information]   Name: Filename, Value: C:\repos\mantid_build_311\ExternalData\Testing\Data\SystemTest\POLREF00032133.nxs, Default?: No, Direction: Input
Load-[Information]   Name: OutputWorkspace, Value: POLREF00032130, Default?: No, Direction: Output
Load-[Information]   Name: LoaderName, Value: LoadEventNexus, Default?: No, Direction: Output
Load-[Information]   Name: LoaderVersion, Value: 1, Default?: No, Direction: Output
Load-[Information]   Name: NXentryName, Value: , Default?: Yes, Direction: Input
Load-[Information]   Name: FilterByTofMin, Value: 8.9884656743115785e+307, Default?: Yes, Direction: Input
Load-[Information]   Name: FilterByTofMax, Value: 8.9884656743115785e+307, Default?: Yes, Direction: Input
Load-[Information]   Name: FilterByTimeStart, Value: 8.9884656743115785e+307, Default?: Yes, Direction: Input
Load-[Information]   Name: FilterByTimeStop, Value: 8.9884656743115785e+307, Default?: Yes, Direction: Input
Load-[Information]   Name: FilterBadPulsesLowerCutoff, Value: 8.9884656743115785e+307, Default?: Yes, Direction: Input
Load-[Information]   Name: BankName, Value: , Default?: Yes, Direction: Input
Load-[Information]   Name: SingleBankPixelsOnly, Value: 1, Default?: Yes, Direction: Input
Load-[Information]   Name: Precount, Value: 1, Default?: Yes, Direction: Input
Load-[Information]   Name: CompressTolerance, Value: 8.9884656743115785e+307, Default?: Yes, Direction: Input
Load-[Information]   Name: CompressBinningMode, Value: Default, Default?: Yes, Direction: Input
Load-[Information]   Name: ChunkNumber, Value: 2147483647, Default?: Yes, Direction: Input
Load-[Information]   Name: TotalChunks, Value: 2147483647, Default?: Yes, Direction: Input
Load-[Information]   Name: LoadMonitors, Value: 0, Default?: Yes, Direction: Input
Load-[Information]   Name: MonitorsLoadOnly, Value: , Default?: Yes, Direction: Input
Load-[Information]   Name: FilterMonByTofMin, Value: 8.9884656743115785e+307, Default?: Yes, Direction: Input
Load-[Information]   Name: FilterMonByTofMax, Value: 8.9884656743115785e+307, Default?: Yes, Direction: Input
Load-[Information]   Name: FilterMonByTimeStart, Value: 8.9884656743115785e+307, Default?: Yes, Direction: Input
Load-[Information]   Name: FilterMonByTimeStop, Value: 8.9884656743115785e+307, Default?: Yes, Direction: Input
Load-[Information]   Name: SpectrumMin, Value: 2147483647, Default?: Yes, Direction: Input
Load-[Information]   Name: SpectrumMax, Value: 2147483647, Default?: Yes, Direction: Input
Load-[Information]   Name: SpectrumList, Value: , Default?: Yes, Direction: Input
Load-[Information]   Name: MetaDataOnly, Value: 0, Default?: Yes, Direction: Input
Load-[Information]   Name: LoadLogs, Value: 1, Default?: Yes, Direction: Input
Load-[Information]   Name: LoadAllLogs, Value: 0, Default?: Yes, Direction: Input
Load-[Information]   Name: LoadType, Value: Default, Default?: Yes, Direction: Input
Load-[Information]   Name: LoadNexusInstrumentXML, Value: 1, Default?: Yes, Direction: Input
Load-[Information]   Name: NumberOfBins, Value: 500, Default?: Yes, Direction: Input
Load-[Information]   Name: AllowList, Value: , Default?: Yes, Direction: Input
Load-[Information]   Name: BlockList, Value: , Default?: Yes, Direction: Input
Load-[Information] Using LoadEventNexus version 1.
LoadEventNexus-[Information] Loading logs from NeXus file...
LoadNexusLogs-[Debug]    done reading "time" array
LoadNexusLogs-[Debug]    done reading "value" array
LoadNexusLogs-[Debug]    done reading "time" array
LoadNexusLogs-[Debug]    done reading "value" array
LoadNexusLogs-[Debug]    done reading "time" array
LoadNexusLogs-[Debug]    done reading "value" array
LoadNexusLogs-[Debug]    done reading "time" array
LoadNexusLogs-[Debug]    done reading "value" array
LoadNexusLogs-[Debug]    done reading "time" array
LoadNexusLogs-[Debug]    done reading "value" array
LoadNexusLogs-[Debug]    done reading "time" array
LoadNexusLogs-[Debug]    done reading "value" array
LoadNexusLogs-[Debug]    done reading "time" array
LoadNexusLogs-[Debug]    done reading "value" array
LoadNexusLogs-[Debug]    done reading "time" array
LoadNexusLogs-[Debug]    done reading "value" array
LoadNexusLogs-[Debug]    done reading "time" array
LoadNexusLogs-[Debug]    done reading "value" array
LoadNexusLogs-[Debug]    done reading "time" array
LoadNexusLogs-[Debug]    done reading "value" array
LoadNexusLogs-[Debug]    done reading "time" array
LoadNexusLogs-[Debug]    done reading "value" array
LoadNexusLogs-[Debug]    done reading "time" array
LoadNexusLogs-[Debug]    done reading "value" array
LoadNexusLogs-[Debug]    done reading "time" array
LoadNexusLogs-[Debug]    done reading "value" array
LoadNexusLogs-[Debug]    done reading "time" array
LoadNexusLogs-[Debug]    done reading "value" array
LoadNexusLogs-[Debug]    done reading "time" array
LoadNexusLogs-[Debug]    done reading "value" array
LoadNexusLogs-[Debug]    done reading "time" array
LoadNexusLogs-[Debug]    done reading "value" array
LoadNexusLogs-[Debug]    done reading "time" array
LoadNexusLogs-[Debug]    done reading "value" array
LoadNexusLogs-[Debug]    done reading "time" array
LoadNexusLogs-[Debug]    done reading "value" array
LoadNexusLogs-[Debug]    done reading "time" array
LoadNexusLogs-[Debug]    done reading "value" array
LoadNexusLogs-[Debug]    done reading "time" array
LoadNexusLogs-[Debug]    done reading "value" array
LoadNexusLogs-[Debug]    done reading "time" array
LoadNexusLogs-[Debug]    done reading "value" array
LoadNexusLogs-[Debug]    done reading "time" array
LoadNexusLogs-[Debug]    done reading "value" array
LoadNexusLogs-[Debug]    done reading "time" array
LoadNexusLogs-[Debug]    done reading "value" array
LoadNexusLogs-[Debug]    done reading "time" array
LoadNexusLogs-[Debug]    done reading "value" array
LoadNexusLogs-[Debug]    done reading "time" array
LoadNexusLogs-[Debug]    done reading "value" array
LoadNexusLogs-[Debug]    done reading "time" array
LoadNexusLogs-[Debug]    done reading "value" array
LoadNexusLogs-[Debug]    done reading "time" array
LoadNexusLogs-[Debug]    done reading "value" array
LoadNexusLogs-[Debug]    done reading "time" array
LoadNexusLogs-[Debug]    done reading "value" array
LoadNexusLogs-[Debug]    done reading "time" array
LoadNexusLogs-[Debug]    done reading "value" array
LoadNexusLogs-[Debug]    done reading "time" array
LoadNexusLogs-[Debug]    done reading "value" array
LoadNexusLogs-[Debug]    done reading "time" array
LoadNexusLogs-[Debug]    done reading "value" array
LoadNexusLogs-[Debug]    done reading "time" array
LoadNexusLogs-[Debug]    done reading "value" array
LoadNexusLogs-[Debug]    done reading "time" array
LoadNexusLogs-[Debug]    done reading "value" array
LoadNexusLogs-[Debug]    done reading "time" array
LoadNexusLogs-[Debug]    done reading "value" array
TimeSeriesProperty-[Information] TimeSeriesProperty "EPICS_PUTLOG" is not sorted.  Sorting is operated on it.
LoadNexusLogs-[Debug]    done reading "time" array
LoadNexusLogs-[Debug]    done reading "value" array
LoadNexusLogs-[Debug]    done reading "time" array
LoadNexusLogs-[Debug]    done reading "value" array
LoadNexusLogs-[Debug]    done reading "time" array
LoadNexusLogs-[Debug]    done reading "value" array
LoadNexusLogs-[Debug]    done reading "time" array
LoadNexusLogs-[Debug]    done reading "value" array
LoadNexusLogs-[Debug]    done reading "time" array
LoadNexusLogs-[Debug]    done reading "value" array
LoadNexusLogs-[Debug]    done reading "time" array
LoadNexusLogs-[Debug]    done reading "value" array
LoadNexusLogs-[Debug]    done reading "time" array
LoadNexusLogs-[Debug]    done reading "value" array
LoadNexusLogs-[Debug]    done reading "time" array
LoadNexusLogs-[Debug]    done reading "value" array
LoadNexusLogs-[Debug]    done reading "time" array
LoadNexusLogs-[Debug]    done reading "value" array
LoadNexusLogs-[Debug]    done reading "time" array
LoadNexusLogs-[Debug]    done reading "value" array
LoadNexusLogs-[Debug]    done reading "time" array
LoadNexusLogs-[Debug]    done reading "value" array
LoadNexusLogs-[Debug]    done reading "time" array
LoadNexusLogs-[Debug]    done reading "value" array
LoadNexusLogs-[Debug]    done reading "time" array
LoadNexusLogs-[Debug]    done reading "value" array
LoadNexusLogs-[Debug]    done reading "time" array
LoadNexusLogs-[Debug]    done reading "value" array
LoadNexusLogs-[Debug]    done reading "time" array
LoadNexusLogs-[Debug]    done reading "value" array
LoadNexusLogs-[Debug]    done reading "time" array
LoadNexusLogs-[Debug]    done reading "value" array
LoadNexusLogs-[Debug]    done reading "time" array
LoadNexusLogs-[Debug]    done reading "value" array
LoadNexusLogs-[Debug]    done reading "time" array
LoadNexusLogs-[Debug]    done reading "value" array
LoadNexusLogs-[Debug]    done reading "time" array
LoadNexusLogs-[Debug]    done reading "value" array
LoadNexusLogs-[Debug]    done reading "time" array
LoadNexusLogs-[Debug]    done reading "value" array
LoadNexusLogs-[Debug]    done reading "time" array
LoadNexusLogs-[Debug]    done reading "value" array
LoadNexusLogs-[Debug]    done reading "time" array
LoadNexusLogs-[Debug]    done reading "value" array
LoadNexusLogs-[Debug]    done reading "time" array
LoadNexusLogs-[Debug]    done reading "value" array
LoadNexusLogs-[Debug]    done reading "time" array
LoadNexusLogs-[Debug]    done reading "value" array
LoadNexusLogs-[Debug]    done reading "time" array
LoadNexusLogs-[Debug]    done reading "value" array
LoadNexusLogs-[Debug]    done reading "time" array
LoadNexusLogs-[Debug]    done reading "value" array
LoadNexusLogs-[Debug]    done reading "time" array
LoadNexusLogs-[Debug]    done reading "value" array
LoadNexusLogs-[Debug]    done reading "time" array
LoadNexusLogs-[Debug]    done reading "value" array
LoadNexusLogs-[Debug]    done reading "time" array
LoadNexusLogs-[Debug]    done reading "value" array
LoadNexusLogs-[Debug]    done reading "time" array
LoadNexusLogs-[Debug]    done reading "value" array
LoadNexusLogs-[Debug]    done reading "time" array
LoadNexusLogs-[Debug]    done reading "value" array
LoadNexusLogs-[Debug]    done reading "time" array
LoadNexusLogs-[Debug]    done reading "value" array
LoadNexusLogs-[Debug]    done reading "time" array
LoadNexusLogs-[Debug]    done reading "value" array
LoadNexusLogs-[Debug]    done reading "time" array
LoadNexusLogs-[Debug]    done reading "value" array
LoadNexusLogs-[Debug]    done reading "time" array
LoadNexusLogs-[Debug]    done reading "value" array
LoadNexusLogs-[Debug]    done reading "time" array
LoadNexusLogs-[Debug]    done reading "value" array
LoadNexusLogs-[Debug]    done reading "time" array
LoadNexusLogs-[Debug]    done reading "value" array
LoadNexusLogs-[Debug]    done reading "time" array
LoadNexusLogs-[Debug]    done reading "value" array
LoadNexusLogs-[Debug]    done reading "time" array
LoadNexusLogs-[Debug]    done reading "value" array
LoadNexusLogs-[Debug]    done reading "time" array
LoadNexusLogs-[Debug]    done reading "value" array
LoadNexusLogs-[Debug]    done reading "time" array
LoadNexusLogs-[Debug]    done reading "value" array
LoadNexusLogs-[Debug]    done reading "time" array
LoadNexusLogs-[Debug]    done reading "value" array
LoadNexusLogs-[Debug]    done reading "time" array
LoadNexusLogs-[Debug]    done reading "value" array
LoadNexusLogs-[Debug]    done reading "time" array
LoadNexusLogs-[Debug]    done reading "value" array
LoadNexusLogs-[Debug]    done reading "time" array
LoadNexusLogs-[Debug]    done reading "value" array
LoadNexusLogs-[Debug]    done reading "time" array
LoadNexusLogs-[Debug]    done reading "value" array
LoadNexusLogs-[Debug]    done reading "time" array
LoadNexusLogs-[Debug]    done reading "value" array
LoadNexusLogs-[Debug]    done reading "time" array
LoadNexusLogs-[Debug]    done reading "value" array
LoadNexusLogs-[Debug]    done reading "time" array
LoadNexusLogs-[Debug]    done reading "value" array
LoadNexusLogs-[Debug]    done reading "time" array
LoadNexusLogs-[Debug]    done reading "value" array
LoadNexusLogs-[Debug]    done reading "time" array
LoadNexusLogs-[Debug]    done reading "value" array
LoadNexusLogs-[Debug]    done reading "time" array
LoadNexusLogs-[Debug]    done reading "value" array
LoadNexusLogs-[Debug]    done reading "time" array
LoadNexusLogs-[Debug]    done reading "value" array
LoadNexusLogs-[Debug]    done reading "time" array
LoadNexusLogs-[Debug]    done reading "value" array
LoadNexusLogs-[Debug]    done reading "time" array
LoadNexusLogs-[Debug]    done reading "value" array
LoadNexusLogs-[Debug]    done reading "time" array
LoadNexusLogs-[Debug]    done reading "value" array
LoadNexusLogs-[Debug]    done reading "time" array
LoadNexusLogs-[Debug]    done reading "value" array
LoadNexusLogs-[Debug]    done reading "time" array
LoadNexusLogs-[Debug]    done reading "value" array
LoadNexusLogs-[Debug]    done reading "time" array
LoadNexusLogs-[Debug]    done reading "value" array
LoadNexusLogs-[Debug]    done reading "time" array
LoadNexusLogs-[Debug]    done reading "value" array
LoadNexusLogs-[Debug]    done reading "time" array
LoadNexusLogs-[Debug]    done reading "value" array
LoadNexusLogs-[Debug]    done reading "time" array
LoadNexusLogs-[Debug]    done reading "value" array
LoadNexusLogs-[Debug]    done reading "time" array
LoadNexusLogs-[Debug]    done reading "value" array
LoadNexusLogs-[Debug]    done reading "time" array
LoadNexusLogs-[Debug]    done reading "value" array
LoadNexusLogs-[Debug]    done reading "time" array
LoadNexusLogs-[Debug]    done reading "value" array
LoadNexusLogs-[Debug]    done reading "time" array
LoadNexusLogs-[Debug]    done reading "value" array
LoadNexusLogs-[Debug]    done reading "time" array
LoadNexusLogs-[Debug]    done reading "value" array
LoadNexusLogs-[Debug]    done reading "time" array
LoadNexusLogs-[Debug]    done reading "value" array
LoadNexusLogs-[Debug]    done reading "time" array
LoadNexusLogs-[Debug]    done reading "value" array
LoadNexusLogs-[Debug]    done reading "time" array
LoadNexusLogs-[Debug]    done reading "value" array
LoadNexusLogs-[Debug]    done reading "time" array
LoadNexusLogs-[Debug]    done reading "value" array
LoadNexusLogs-[Debug]    done reading "time" array
LoadNexusLogs-[Debug]    done reading "value" array
LoadNexusLogs-[Debug]    done reading "time" array
LoadNexusLogs-[Debug]    done reading "value" array
LoadNexusLogs-[Debug]    done reading "time" array
LoadNexusLogs-[Debug]    done reading "value" array
LoadNexusLogs-[Debug]    done reading "time" array
LoadNexusLogs-[Debug]    done reading "value" array
LoadNexusLogs-[Debug]    done reading "time" array
LoadNexusLogs-[Debug]    done reading "value" array
LoadNexusLogs-[Debug]    done reading "time" array
LoadNexusLogs-[Debug]    done reading "value" array
LoadNexusLogs-[Debug]    done reading "time" array
LoadNexusLogs-[Debug]    done reading "value" array
LoadNexusLogs-[Debug]    done reading "time" array
LoadNexusLogs-[Debug]    done reading "value" array
LoadNexusLogs-[Debug]    done reading "time" array
LoadNexusLogs-[Debug]    done reading "value" array
LoadNexusLogs-[Debug]    done reading "time" array
LoadNexusLogs-[Debug]    done reading "value" array
LoadNexusLogs-[Debug]    done reading "time" array
LoadNexusLogs-[Debug]    done reading "value" array
LoadNexusLogs-[Debug]    done reading "time" array
LoadNexusLogs-[Debug]    done reading "value" array
LoadNexusLogs-[Debug]    done reading "time" array
LoadNexusLogs-[Debug]    done reading "value" array
LoadNexusLogs-[Debug]    done reading "time" array
LoadNexusLogs-[Debug]    done reading "value" array
LoadNexusLogs-[Debug]    done reading "time" array
LoadNexusLogs-[Debug]    done reading "value" array
LoadNexusLogs-[Debug]    done reading "time" array
LoadNexusLogs-[Debug]    done reading "value" array
LoadNexusLogs-[Debug]    done reading "time" array
LoadNexusLogs-[Debug]    done reading "value" array
LoadNexusLogs-[Debug]    done reading "time" array
LoadNexusLogs-[Debug]    done reading "value" array
LoadNexusLogs-[Debug]    done reading "time" array
LoadNexusLogs-[Debug]    done reading "value" array
LoadNexusLogs-[Debug]    done reading "time" array
LoadNexusLogs-[Debug]    done reading "value" array
LoadNexusLogs-[Debug]    done reading "time" array
LoadNexusLogs-[Debug]    done reading "value" array
LoadNexusLogs-[Debug]    done reading "time" array
LoadNexusLogs-[Debug]    done reading "value" array
LoadNexusLogs-[Debug]    done reading "time" array
LoadNexusLogs-[Debug]    done reading "value" array
LoadNexusLogs-[Debug]    done reading "time" array
LoadNexusLogs-[Debug]    done reading "value" array
LoadNexusLogs-[Debug] processing count_rate:NXlog
LoadNexusLogs-[Debug]    done reading "time" array
LoadNexusLogs-[Debug]    done reading "value" array
LoadNexusLogs-[Debug] processing dae_beam_current:NXlog
LoadNexusLogs-[Debug]    done reading "time" array
LoadNexusLogs-[Debug]    done reading "value" array
LoadNexusLogs-[Debug] processing good_frames:NXlog
LoadNexusLogs-[Debug]    done reading "time" array
LoadNexusLogs-[Debug]    done reading "value" array
LoadNexusLogs-[Debug] processing good_uah_log:NXlog
LoadNexusLogs-[Debug]    done reading "time" array
LoadNexusLogs-[Debug]    done reading "value" array
LoadNexusLogs-[Debug] processing icp_event:NXlog
LoadNexusLogs-[Debug]    done reading "time" array
LoadNexusLogs-[Debug]    done reading "value" array
LoadNexusLogs-[Debug] processing is_running:NXlog
LoadNexusLogs-[Debug]    done reading "time" array
LoadNexusLogs-[Debug]    done reading "value" array
LoadNexusLogs-[Debug] processing is_waiting:NXlog
LoadNexusLogs-[Debug]    done reading "time" array
LoadNexusLogs-[Debug]    done reading "value" array
LoadNexusLogs-[Debug] processing monitor_sum_1:NXlog
LoadNexusLogs-[Debug]    done reading "time" array
LoadNexusLogs-[Debug]    done reading "value" array
LoadNexusLogs-[Debug] processing np_ratio:NXlog
LoadNexusLogs-[Debug]    done reading "time" array
LoadNexusLogs-[Debug]    done reading "value" array
LoadNexusLogs-[Debug] processing period:NXlog
LoadNexusLogs-[Debug]    done reading "time" array
LoadNexusLogs-[Debug]    done reading "value" array
LoadNexusLogs-[Debug] processing period_change_log:NXlog
LoadNexusLogs-[Debug]    done reading "time" array
LoadNexusLogs-[Debug]    done reading "value" array
LoadNexusLogs-[Debug] processing raw_frames:NXlog
LoadNexusLogs-[Debug]    done reading "time" array
LoadNexusLogs-[Debug]    done reading "value" array
LoadNexusLogs-[Debug] processing raw_uah_log:NXlog
LoadNexusLogs-[Debug]    done reading "time" array
LoadNexusLogs-[Debug]    done reading "value" array
LoadNexusLogs-[Debug] processing run_status:NXlog
LoadNexusLogs-[Debug]    done reading "time" array
LoadNexusLogs-[Debug]    done reading "value" array
LoadNexusLogs-[Debug] processing total_counts:NXlog
LoadNexusLogs-[Debug]    done reading "time" array
LoadNexusLogs-[Debug]    done reading "value" array
LoadNexusLogs-[Debug] processing veto_log:NXlog
LoadNexusLogs-[Debug]    done reading "time" array
LoadNexusLogs-[Debug]    done reading "value" array
LoadNexusLogs-[Debug] processing events_log:NXlog
LoadNexusLogs-[Debug]    done reading "time" array
LoadNexusLogs-[Debug]    done reading "value" array
LoadNexusLogs-[Debug] processing frame_log:NXlog
LoadNexusLogs-[Debug]    done reading "time" array
LoadNexusLogs-[Debug]    done reading "value" array
LoadNexusLogs-[Debug] processing good_frame_log:NXlog
LoadNexusLogs-[Debug]    done reading "time" array
LoadNexusLogs-[Debug]    done reading "value" array
LoadNexusLogs-[Debug] processing period_log:NXlog
LoadNexusLogs-[Debug]    done reading "time" array
LoadNexusLogs-[Debug]    done reading "value" array
LoadNexusLogs-[Debug] processing proton_charge:NXlog
LoadNexusLogs-[Debug]    done reading "time" array
LoadNexusLogs-[Debug]    done reading "value" array
LoadNexusLogs-[Debug] processing raw_events_log:NXlog
LoadNexusLogs-[Debug]    done reading "time" array
LoadNexusLogs-[Debug]    done reading "value" array
LoadNexusLogs-[Debug] Time to validate properties: 0.000714 seconds
Time for other input validation: 0.000003 seconds
Time for other initialization: 0.001467 seconds
Time to run exec: 0.417362 seconds

LoadNexusLogs-[Debug] LoadNexusLogs finished with isChild = 1
AlgoTimeRegister-[Debug] performancelog.write is disabled (off/0/false)
LoadEventNexus-[Information] No instrument XML definition found in C:\repos\mantid_build_311\ExternalData\Testing\Data\SystemTest\POLREF00032133.nxs at raw_data_1/instrument
LoadEventNexus-[Debug] Instrument name read from NeXus file is POLREF
InstrumentFileFinder-[Debug] Looking for instrument file for POLREF that is valid on '2020-10-10T05:20:14'
ConfigService-[Debug] Looking for POLREF at ISIS.
FacilityInfo-[Debug] Instrument 'POLREF' found as POLREF at ISIS.
InstrumentFileFinder-[Debug] Found file: 'C:\repos\mantid\instrument\POLREF_Definition.xml'
InstrumentFileFinder-[Debug] File 'C:\repos\mantid\instrument\POLREF_Definition.xml valid dates: from '1901-01-01 00:01:00' to '2016-06-27 23:59:59'
InstrumentFileFinder-[Debug] Found file: 'C:\repos\mantid\instrument\POLREF_Definition_2016.xml'
InstrumentFileFinder-[Debug] File 'C:\repos\mantid\instrument\POLREF_Definition_2016.xml valid dates: from '2016-06-28 00:01:00' to '2100-01-31 23:59:59'
InstrumentFileFinder-[Debug] Instrument file selected is C:\repos\mantid\instrument\POLREF_Definition_2016.xml
ConfigService-[Debug] Unable to find instrumentDefinition.vtp.directory in the properties file
LoadInstrument-[Debug] Loading the parameter definition...
LoadInstrument-[Debug] Parameter file: C:\repos\mantid\instrument\POLREF_Parameters.xml
LoadParameterFile-[Information] Parsing from XML file: C:\repos\mantid\instrument\POLREF_Parameters.xml
LoadParameterFile-[Debug] Time to validate properties: 0.000015 seconds
Time for other input validation: 0.000005 seconds
Time for other initialization: 0.002189 seconds
Time to run exec: 0.005803 seconds

LoadParameterFile-[Debug] LoadParameterFile finished with isChild = 1
AlgoTimeRegister-[Debug] performancelog.write is disabled (off/0/false)
LoadInstrument-[Debug] Parameters loaded successfully.
LoadInstrument-[Debug] Time to validate properties: 0.000017 seconds
Time for other input validation: 0.000002 seconds
Time for other initialization: 0.001335 seconds
Time to run exec: 0.016359 seconds

LoadInstrument-[Debug] LoadInstrument finished with isChild = 1
AlgoTimeRegister-[Debug] performancelog.write is disabled (off/0/false)
LoadEventNexus-[Debug] Attempting to load custom spectra mapping from 'raw_data_1/isis_vms_compat'.
LoadEventNexus-[Debug] Loading only detector spectra from C:\repos\mantid_build_311\ExternalData\Testing\Data\SystemTest\POLREF00032133.nxs

EDIT: Also Unhandled exception at 0x00007FFB955F5F55 (ntdll.dll) in python.exe: 0xC0000374: A heap has been corrupted (parameters: 0x00007FFB956A80E0). at line 824 of ExperimentInfo.cpp.

@MialLewis MialLewis force-pushed the 37768_improve_error_calc_in_PolarizationEfficienciesWildes branch from 54379fc to a62caec Compare May 22, 2025 12:31
@MialLewis MialLewis requested a review from adriazalvarez May 22, 2025 15:01
adriazalvarez
adriazalvarez previously approved these changes May 22, 2025
Copy link
Contributor

@adriazalvarez adriazalvarez left a comment

Choose a reason for hiding this comment

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

Thanks for the changes

@adriazalvarez adriazalvarez changed the base branch from main to release-next May 22, 2025 15:19
@adriazalvarez adriazalvarez dismissed their stale review May 22, 2025 15:19

The base branch was changed.

Copy link
Contributor

@cailafinn cailafinn left a comment

Choose a reason for hiding this comment

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

All comments addressed. Code looks good to me.

Discussed offline: to avoid clogging CI, release note will be added as part of

@cailafinn cailafinn merged commit c319287 into release-next May 22, 2025
10 checks passed
@cailafinn cailafinn deleted the 37768_improve_error_calc_in_PolarizationEfficienciesWildes branch May 22, 2025 15:48
@github-project-automation github-project-automation bot moved this from In Progress to Done in ISIS LSS Sprint Planning May 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ISIS: LSS Issue and pull requests relating to SANS and Reflectometry (Large Scale Structures) at ISIS Reflectometry Issues and pull requests related to reflectometry
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Add correct error calculation to PolarizationEfficienciesWildes
3 participants