Ticket #5268 (closed: fixed)
SANS: bug in SaveCanSAS1D
Reported by: | Anders Markvardsen | Owned by: | Anders Markvardsen |
---|---|---|---|
Priority: | critical | Milestone: | Release 2.2 |
Component: | MantidPlot | Keywords: | PATCHCANDIDATE,Released |
Cc: | stephen.king@… | Blocked By: | |
Blocking: | Tester: | Martyn Gigg |
Description
Steve writes (note the below was the result of analysing sans2d00011585.nxs):
My colleague at ILL has just found what appears to be a bug in SaveCanSAS1D.
So if you process the attached SANS2D file and write the 1D as CanSAS output the file reports SASdetector_SDD 11.827
But if you examine the file the rear detector was at 3.024m (and the front was at 1.419m).
Change History
comment:3 Changed 8 years ago by Anders Markvardsen
Removed hardcoding of SASdetector element in savecansas1d. re #5268
Changeset: c927b81edd0204e002af039dc04c1872dbbf5806
comment:5 Changed 8 years ago by Anders Markvardsen
Removed hardcoding of SASdetector element in savecansas1d. re #5268
Changeset: 06f53c519fba8295f6b2d777b7430547c49963e9
comment:6 Changed 8 years ago by Anders Markvardsen
- Status changed from accepted to verify
- Resolution set to fixed
To test:
- Do any isis sans 1d reduction
- Go to Geometry tab and take a note of the 'rear-detector' and 'front-detector' positions
- Go back to the 'Run Numbers' tab and tick 'CanSAS' and click 'Save Results'
- open the xml you saved and find the section:
<SASdetector>
<name>front-detector</name> <SDD unit="m">1.87565</SDD>
</SASdetector> <SASdetector>
<name>rear-detector</name> <SDD unit="m">6.00861</SDD>
</SASdetector>
The distances here to should equal those in the Geometry tab as 0.001*sqrt(X2+Z2)
comment:7 Changed 8 years ago by Martyn Gigg
- Status changed from verify to verifying
- Tester set to Martyn Gigg
comment:8 Changed 8 years ago by Martyn Gigg
Trying with Mask file: systemtests/Data/SANS2D/MASKSANS2D.091A and run 992 (in systemtests Data) I can't get the numbers to agree in the geometry tab vs the file.
On the geometry tab I have:
rear-detector: X 100.1 Z 3999.1 front-detector: X -1050.0 Z 2501.1
Is it just a precision thing?
comment:9 Changed 8 years ago by Anders Markvardsen
Not I am just putting in a comment for now this before I loose this information (and my mind).
From debug I get from the SaveCanSas1D.cpp sample position at
sample z = 19.280999999999999
Front det z = 21.755391989560000 y = 0.17649999999999999 x = 0.98915719301400007
Rear det z = 23.338072000000000 y = 0.19650000000000001 x = -0.084199999999999997
which gives e.g. the sample to detector distances using the cpp line in SaveCanSAS1D.cpp:
double distance = comp->getDistance(*m_workspace->getInstrument()->getSample());
(which looks perfectly OK)
Front Det - Sample = sqrt((21.755391989560000-19.280999999999999)2+0.176499999999999992+0.989157193014000072) = 2.6706
Note the Beam Centre is (84.2, -196.5).
For now this comment is just for info
comment:10 Changed 8 years ago by Anders Markvardsen
Further tests shows for LOQ the match is OK. For example LOQ run 54432 in Test/systemtests/Data/LOQ.
SANS2D does not appear to match. One explanations for this may be: 1) that X and Z coordinates are shown (which at same level appear to be based on log values), but in fact there may also be a none zero Y value...
A follow up ticket to investigate this has been created #5698
comment:11 Changed 8 years ago by Martyn Gigg
- Status changed from verifying to closed
True. The file is showing the correct values though, which is most important.
comment:12 Changed 7 years ago by Nick Draper
- Keywords PATCHCANDIDATE,Released added; PATCHCANDIDATE removed
comment:13 Changed 5 years ago by Stuart Campbell
This ticket has been transferred to github issue 6114
Observed so far:
Looking at the code it is hardcoded to output information about the first detector in the workspace only, which for both LOQ and SANS2D is a monitor – so 11.827 below refers to a monitor to sample distance.
Note this is somewhat indirectly reflected in the SaveCanSAS1D output, which for the SANS2D run 8672 is:
emailed steve