[PIPE2D-98] Add test to confirm that a FiberTraceSet reconstructed from pfsFiberTrace is identical to the original one Created: 11/Oct/16  Updated: 28/Dec/16  Resolved: 28/Dec/16

Status: Done
Project: DRP 2-D Pipeline
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Story Priority: Major
Reporter: aritter Assignee: aritter
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Blocks
is blocked by DAMD-13 Change pfsFiberTrace description to p... Won't Fix
Relates
relates to DAMD-13 Change pfsFiberTrace description to p... Won't Fix
relates to PIPE2D-90 Create Calib Task to create and write... Done
Story Points: 1
Epic Link: persistable-fibertrace
Sprint: 2014-16
Reviewers: price

 Description   

PIPE2D-90 was merged into master without confirmation that the code is correct. Please add a test case that a FiberTraceSet reconstructed from a pfsFiberTrace file is identical to the original FiberTraceSet that was used to write the pfsFiberTrace file.



 Comments   
Comment by swinbank [ 05/Nov/16 ]

Currently, the round trip ends up with something which is nearly, but not quite, identical. This may be due to lack of precision due to only persisting floats. Still under investigation.

Comment by aritter [ 17/Nov/16 ]

I have confirmed that the lack of precision in the trace-function coefficients due to only persisting floats is responsible for the difference between the stored FiberTraces and the reconstructed ones. This means that we will have to change the datamodel to persist the trace-function coefficients as double values.
When I set the trace coefficients in the reconstructed FiberTrace manually to the ones from the original FiberTrace, recalculate the xCenters, and re-create the FiberTrace using the new xCenters, both FiberTraces are identical.

Comment by aritter [ 17/Nov/16 ]

Filed ticket DAMD-13 to change the description of pfsFiberTrace to use doubles instead of floats for the trace-function coefficients

Comment by aritter [ 19/Dec/16 ]

I can confirm now that the FiberTraces read in from disk is now identical to the FiberTraces which were persisted to disk.
Previously the FiberTraceFunction coefficients were internally saved as doubles. When persisting the coefficients as floats and reading them back in, the difference in precision caused a 1 pixel offset in 1 row in 1 FiberTrace out of 12. Changing the internal coefficients to float removed the observed pixel offset.

Comment by price [ 21/Dec/16 ]

I made review comments on the GitHub pull requests that I hope will simplify the code.

Please check that the test you've added used to fail when you were using double in drp_stella. In particular, I'm concerned that the imprecise comparisons (assertAlmostEqual) might hide problems.

Comment by aritter [ 28/Dec/16 ]

Merged into master

Generated at Sat Feb 10 15:48:26 JST 2024 using Jira 8.3.4#803005-sha1:1f96e09b3c60279a408a2ae47be3c745f571388b.