Ticket #7570 (closed: fixed)

Opened 7 years ago

Last modified 5 years ago

SplineSmoothing infinite loops when error is zero

Reported by: Samuel Jackson Owned by: Dan Nixon
Priority: major Milestone: Release 3.3
Component: Indirect Inelastic Keywords:
Cc: Blocked By: #7714
Blocking: #7842 Tester: Martyn Gigg

Description

SplineSmoothing algorithm gets trapped in an infinite loop when the error is set to zero. Ideally it should use all the points available and make an exact copy of the curve.

This appears to be working on Ubuntu 12.04, but fails on Mac. This could well be down to a mismatch in GSL library versions.

Attachments

ZnCl2_Stheta.nxs (128.7 KB) - added by Samuel Jackson 6 years ago.

Change History

comment:1 Changed 7 years ago by Samuel Jackson

  • Component changed from Framework to Indirect Inelastic

comment:2 Changed 7 years ago by Samuel Jackson

  • Milestone changed from Backlog to Release 3.0

comment:3 Changed 7 years ago by Samuel Jackson

  • Blocked By 7714 added

Update

After discussing the problem with Roman this ticket would probably best be solved by swapping out the CubicSpline function for BSpline due to efficiency issues. Therefore we should wait until either me or Roman write a unit test to verify BSpline works properly before changing SplineSmoothing.

comment:4 Changed 7 years ago by Samuel Jackson

  • Milestone changed from Release 3.0 to Backlog

comment:5 Changed 7 years ago by Samuel Jackson

  • Blocking 7842 added

comment:6 Changed 7 years ago by Nick Draper

  • Status changed from new to assigned

Bulk move to assigned at the introduction of the triage step

comment:7 Changed 6 years ago by Samuel Jackson

  • Milestone changed from Backlog to Release 3.3

comment:8 Changed 6 years ago by Samuel Jackson

  • Status changed from assigned to inprogress

Refs #7570 Swapped CubicSpline for BSpline.

Changeset: ac8329ecaf589c5134c00252a51599d34a389ace

comment:9 Changed 6 years ago by Samuel Jackson

Refs #7570 Fix issue with the BSpline swap.

Changeset: 5b5b0a24814ce6ec863c6a2eaaffbdc8fa26869b

comment:10 Changed 6 years ago by Samuel Jackson

Refs #7570 Swap to using ConvertToPointData algorithm.

Changeset: 3d7b4862b94d63093c32333e37c0159f021dea21

comment:11 Changed 6 years ago by Samuel Jackson

Refs #7570 Refactor smoothing algorithm code.

Changeset: 15a102151b23fd4b842ec7dc84442ce18e299d75

comment:12 Changed 6 years ago by Samuel Jackson

Refs #7570 Refactor unit test code.

Changeset: 1057287a38a33afffc8532d83d21078c84c9a9e1

comment:13 Changed 6 years ago by Samuel Jackson

Refs #7570 Add missing doxygen comments for new methods.

Changeset: a1e7fa669e78b8b53c1fa25b3965c4f8999ffb42

comment:14 Changed 6 years ago by Samuel Jackson

Refs #7570 Fix usage example.

Changeset: 09c239592dadc9032b5e0315b55f05d21a9fe6a2

comment:15 Changed 6 years ago by Samuel Jackson

Refs #7570 Remove variable.

Changeset: d4f57128bea5b6fc7527dd275c7bc36ddad4fb1b

comment:16 Changed 6 years ago by Samuel Jackson

Refs #7570 Limit the max number of executions further.

Changeset: bfb529606a031fe2a435a13dfc48e1e64262371e

comment:17 Changed 6 years ago by Samuel Jackson

I believe the zero error issue is caused by the fact that the spline takes a large number of parameters and minimizing all of them to be so close to the original data naturally causes it to be slow.

The changes here have refactored the code and limited the max iterations so that even if you specify zero error, the algorithm should finish more quickly (albeit slowly).

To Test

I've supplied a file to check the algorithm with. You can use the following python script to check it works (but may take a sec):

theta = Load(Filename='ZnCl2_Stheta.nxs')
ws = SplineSmoothing(theta, Error=0)

Unit tests and a code review should cover the rest.

Last edited 6 years ago by Samuel Jackson (previous) (diff)

Changed 6 years ago by Samuel Jackson

comment:18 Changed 6 years ago by Samuel Jackson

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

comment:19 Changed 6 years ago by Nick Draper

  • Owner changed from Samuel Jackson to Dan Nixon

comment:20 Changed 6 years ago by Martyn Gigg

  • Status changed from verify to verifying
  • Tester set to Martyn Gigg

comment:21 Changed 6 years ago by Martyn Gigg

  • Status changed from verifying to closed

Merge remote-tracking branch 'origin/bugfix/7570_spline_smooting_error'

Full changeset: 34de655e1584f0ab1cf0b1f0e7a78b4fce316c36

comment:22 Changed 5 years ago by Stuart Campbell

This ticket has been transferred to github issue 8415

Note: See TracTickets for help on using tickets.