Skip to content
Snippets Groups Projects
This project is mirrored from https://github.com/mantidproject/mantid.git. Pull mirroring updated .
  1. Apr 08, 2020
  2. Jan 23, 2020
  3. Jan 22, 2020
  4. Jan 21, 2020
  5. Jan 20, 2020
    • Danny Hindson's avatar
      Improve sampling of scatter pts in absorption correction simulation · e2af417f
      Danny Hindson authored
      The sampling is now performed according to the volume of each part of
      the sample\environment that intersects the beam profile
      
      Following changes have been made:
      
      a) the function IObject::generatePointInObject has been modified so that it returns
      false rather than raising an exception if it fails to generate a point inside
      the object that is also in the active region. This is more efficient when it is
      being called with a maxAttempts value of 1 in an attempt to fairly sample the
      scatter points among the sample + environment components. This involved a change
      in IObject and various child classes (MeshObject, CSGObject, MeshObject2D, Container)
      
      b) the code that calls IObject::generatePointInObject and cycles through the
      various parts of the environment\sample has been moved from SampleEnvironment into
      MCInteractionVolume so that the sample can be included. There is a new function
      MCInteractionVolume::generatePoint that randomly generates a scatter point across the
      sample and environment components. Possible the SampleEnvironment class could be retired
      entirely and just replaced by a vector of IObject items attached to the sample.
      
      c) change CSGObject::generatePointInObject to stop calling the fallback method when the
      maxAttempts parameter equals 1. The fallback method always returns a point if the object's
      bounding box is inside the active area which doesn't produce the required sampling across
      the env components. This change has modified the random number sequences used in various
      tests - including the "sample only" tests
      
      d) added some logging to the simulation to show where the scatter points
      occurred. These show that for Pearl around 6% of the scatter points are
      in the sample which is less than the 50% assumption previously in the code
      
      e) Several changes to the unit tests (MCInteractionVolumeTest.h, MonteCarloAbsorptionTest.h,
      DirectILLSelfShieldingTest.py). The updated sampling means that the absorption corrections
      are slightly different than before for cases with a sample + environment.
      
      For DirectILLSelfShieldingTest, an extra parameter has been added to underlying algorithm
      (DirectILLSelfShielding) so that this test can continue to use 300 events per point while
      the ILLDirectGeometryReductionTest can use 5000 events per point
      
      f) some changes to system tests (ILLDirectGeometryReductionTest, complexShapeAbsorptions)
      
      The calculation used in ILLDirectGeometryReductionTest wasn't converged (changing the seed
      gave a ~25% change in the output) so have increased the number of events per point from 300
      to 5000. I didn't increase the number of events further because I didn't want to make the
      runtime of the system test (esp in debug mode) too large
      e2af417f
    • Nick Draper's avatar
      clang format for this pr · 75205f31
      Nick Draper authored
      75205f31
    • Conor Finn's avatar
      RE #26849 Fix issue with non-sequent ranges · 9949f586
      Conor Finn authored
      If the user defined a list of spectra to use that were not sequential,
      the algorithm would take tha max and min values rather than the actual
      list of specta. Eg "10-19, 50-59" would have resulted in the spectra
      10-59 being used, which broke the algorithm.
      9949f586
    • Nick Draper's avatar
      Changed double click to show data if only one bin · d8eb7d2b
      Nick Draper authored
      Also included code suggestion
      I've not removed the ability to plot from the Show data table because:
      1. If they try that hard they deserve an empty graph
      2. I can't work out how.
      d8eb7d2b
    • Gagik Vardanyan's avatar
      Merge pull request #27740 from martyngigg/27736-sliceviewer-mpl-3.1 · 4eb6f50f
      Gagik Vardanyan authored
      Fix sliceviewer for matplotlib 3.1
    • Gagik Vardanyan's avatar
      Merge pull request #27730 from mantidproject/fix_general_settings_test_for_python_3 · ee110df2
      Gagik Vardanyan authored
      Fix settings test for python 3 in windows
    • Gagik Vardanyan's avatar
      Merge pull request #27512 from gemmaguest/25881_ReflectometryISISLoadAndProcess_system_tests · 85e81fa0
      Gagik Vardanyan authored
      Expand ISIS reflectometry system tests
    • Adam J. Jackson's avatar
      Abins: update Gaussian, DMOL3 test data · f7901d19
      Adam J. Jackson authored
      See commit notes for CASTEP data update
      f7901d19
    • Adam J. Jackson's avatar
      Update Abins CRYSTAL test data · fae3e5a0
      Adam J. Jackson authored
      Reference files for data import need updating for new advanced params
      fae3e5a0
    • Adam J. Jackson's avatar
      Update Abins tests, fix CASTEP tests · a718f818
      Adam J. Jackson authored
      Test data needs updating due to changes in the Advanced
      Parameters. Have eyeballed some of the file changes and the changes
      seem fine. (There's also an increase in the written precision of atom
      positions, but that will be related to the new test data writer.)
      
      CASTEP data updated here, other codes to follow.
      a718f818
    • Adam J. Jackson's avatar
      Abins Instrument: use NotImplementedError for method stubs · bd221efd
      Adam J. Jackson authored
      Abins uses a base class for Instruments, which defines a couple of
      methods returning None. None is not the right response if these
      methods were not adapted to a child class; use NotImplementedError to
      mark these more clearly.
      bd221efd
    • Adam J. Jackson's avatar
      8d999994
    • Adam J. Jackson's avatar
      Abins broadening: Release notes · 7a801abe
      Adam J. Jackson authored
      (And a typo in one of the test cases.)
      7a801abe
    • Adam J. Jackson's avatar
      Abins interpolated broadening: tolerate direction changes in sigma · 7c26355b
      Adam J. Jackson authored
      The initial implementation assumed that the input series of sigma
      values would monotonically increase, which is reasonable for TOSCA but
      not for other instruments.
      
      The logic is modified so that instead of
      the input data, the list of sigma values used for convolution is
      required to be sorted. As this list was generated within the same
      function and ranges from (min(sigma), max(sigma)), the condition is
      always satisfied.
      
      The unit tests are not affected, but there may be a small numerical
      difference as another implementation detail has been fixed in the
      process; the interpolation x-values ('sigma factors') should be the
      ratio between sigma and sigma at the lower bound of the current
      window. In the initial implementation this was mistakenly identified
      as sigma_chunk[0], the left-most value in the block _out of the actual
      sigma values_; it should be the exact convolved width from `sigma_samples`.
      7c26355b
    • Adam J. Jackson's avatar
      0b895043
    • Adam J. Jackson's avatar
      Abins refactoring: provide method to generate spowder test data · 97891384
      Adam J. Jackson authored
      A new method is provided in AbinsModules.CalculateS to generate a test
      data file for the AbinsCalculateSPowder test. This format isn't great
      and should be refined to something like standard JSON, but at least we
      now have a standard way of generating it. The input options are a few
      calculation parameters and a precalculated AbinsData object.
      
      To make these objects easier to instantiate, a from_calculation_data()
      classmethod is added.  The logic for identifying and calling a file
      loader has been moved from the main Abins algorithm into AbinsData to
      support this without redundancy. It may make sense to move this again
      to somewhere else, e.g. a new *AbinsModules/Loaders/__init__.py* but
      for now this is close to the point of use.
      
      Equivalence of this method's output to the existing test file has been
      verified manually for the Si2 order-1 test data. The reference file
      does not need to be updated, and tests should continue to pass.
      97891384
    • Adam J. Jackson's avatar
      Abins: replace CalculateSPowder test data for new sampling scheme · d7ed1e8b
      Adam J. Jackson authored
      The sample data for the CalculateSPowder test needs to be updated as
      part of the work on broadening, because Abins is now producing
      different results. Specifically: the instrumental broadening function
      applied to the S data has been replaced and is now smooth; the
      reference frequencies are now defined to be in the middle of the
      histogram bins rather than at the edges. This difference in binning
      conventions has actually changed the size of the results array (by 1!)
      
      The format of the sample data for CalculateSPowder is not very pretty;
      it is some kind of raw text dump. It would be nice to avoid such
      things with a proper JSON serialisation setup, but for now the
      priority is to fix the test in a way that is comparable with previous
      behaviour. The process used to generate the replacement file was to
      obtain the calculation data with
      
        AbinsModules.CalculateS.init(...args...).get_formatted_data()
      
      and dump the text representation to a file with
      
        numpy.set_printoptions(threshold=numpy.nan)
        with open('Si2-sc-CalculateSPowder_S.txt', 'w') as f:
            f.write(str(calculated_data.extract()))
      
      The resulting file appears more neatly formatted than its predecessor
      4b77bac3f8c1dc54f63bd41ca3075c48, but seems acceptable to the test parser.
      d7ed1e8b
Loading