Ticket #3934 (closed: fixed)

Opened 9 years ago

Last modified 5 years ago

ConvertUnits should leave sort order

Reported by: Peter Peterson Owned by: Janik Zikovsky
Priority: major Milestone: Release 2.0
Component: Mantid Keywords:
Cc: Blocked By:
Blocking: Tester: Owen Arnold

Description

Rather than always marking the event list as unsorted once a unit conversion is done, it should leave the sort order alone if possible. There are three cases that need to be accounted for:

  1. Unsorted - convert units and be done
  2. Sorted by tof - convert units and reverse list of events if appropriate
  3. Sorted by pulse - convert units and be done

ConvertUnits has two basic branches to look at which can be improved separately: ConvertQuickly and ConvertViaTOF.

Whether or not this works is easily tested by:

  1. Load an event list
  2. SortEvents by whatever type is appropriate
  3. ConvertUnits
  4. SortEvents by the same type again

If everything went according to plan, the second sort will take no time to run.

Change History

comment:1 Changed 9 years ago by Janik Zikovsky

  • Status changed from new to assigned
  • Owner changed from Anyone to Janik Zikovsky

comment:2 Changed 9 years ago by Janik Zikovsky

  • Status changed from assigned to accepted

comment:3 Changed 9 years ago by Janik Zikovsky

In [15219]:

Refs #3934: Refactored units to use an initialize() method and a singleToTOF() method. This was used in EventList's to directly convert TOF's without having to go through getTofs() setTofs(). This also preserves sort order.

comment:4 Changed 9 years ago by Peter Peterson

In [15223]:

Only reverse if the list is already sorted by TOF. Refs #3934.

comment:5 Changed 9 years ago by Janik Zikovsky

  • Status changed from accepted to verify
  • Resolution set to fixed

comment:6 Changed 9 years ago by Owen Arnold

  • Status changed from verify to verifying
  • Tester set to Owen Arnold

comment:7 Changed 9 years ago by Owen Arnold

  • Status changed from verifying to closed

Works Followed the test procedure outlined. In my test cases the first sort (prior to convert units) always took >0 seconds, after conversion, the same sort was instantaneous.

comment:8 Changed 5 years ago by Stuart Campbell

This ticket has been transferred to github issue 4781

Note: See TracTickets for help on using tickets.