Ticket #9772 (closed: fixed)

Opened 6 years ago

Last modified 5 years ago

Saving ISIS SANS Reduced Workspaces Out to CanSAS Format Produces Non-Conform Files

Reported by: Peter Parker Owned by: Peter Parker
Priority: major Milestone: Release 3.2
Component: SANS Keywords:
Cc: stephen.king@… Blocked By:
Blocking: Tester: Anders Markvardsen

Description

In #9710/#9721 I changed the YUnitLabel of the workspaces produced by the ISIS SANS reduction, but this has meant that the SaveCanSAS algorithm now produces files that do not conform to the format.

We are currently writing out:

<Idata>
  <Q unit="1/A">0.00824</Q>
  <I unit="I(q) (cm-1)">275.489</I>
  <Idev unit="I(q) (cm-1)">1.79077</Idev>
  <Qdev unit="1/A">0</Qdev>
</Idata>

We should be writing out:

<Idata>
  <Q unit="1/A">0.00824</Q>
  <I unit="1/cm">275.489</I>
  <Idev unit="1/cm">1.79077</Idev>
  <Qdev unit="1/A">0</Qdev>
</Idata>

For trans as well as data.

Change History

comment:1 Changed 6 years ago by Nick Draper

  • Status changed from new to assigned

comment:2 Changed 6 years ago by Peter Parker

  • Status changed from assigned to inprogress

Refs #9772 - "Band-aid" fix for writing out units in CanSAS format.

Changeset: 09c9676cebb3796e45d29b8d0e327fe8deaad780

comment:3 Changed 6 years ago by Peter Parker

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

To test, add systemtests/Data/SANS2D/ to Mantid's managed directories and run the following script:

import os
from ISISCommandInterface import *

# Carry out a standard ISIS SANS reduction.
SANS2D()
MaskFile("MaskSANS2DReductionGUI.txt")
AssignSample('22048')
result = WavRangeReduction()

# Write out to file.
file_path = os.path.join(config["defaultsave.directory"], "cansas_test.xml")
SaveCanSAS1D(mtd[result], file_path)

# Make sure I and Idev have been written out with units of "1/cm".
with open(file_path, "r") as f:
    single_line = f.readlines()[11]
assert "<I unit=\"1/cm\">" in single_line
assert "<Idev unit=\"1/cm\">" in single_line

os.remove(file_path) 

This shows that for reduced workspaces the correct units are now being written out to file.

comment:4 Changed 6 years ago by Anders Markvardsen

  • Status changed from verify to verifying
  • Tester set to Anders Markvardsen

comment:5 Changed 6 years ago by Anders Markvardsen

  • Status changed from verifying to closed

Merge remote-tracking branch 'origin/bugfix/9772_fix_cansas_units'

Full changeset: f81af0bc98fede421bdd9e0f6e678a1345c9d109

comment:6 Changed 6 years ago by Anders Markvardsen

correct units now outputted

comment:7 Changed 5 years ago by Stuart Campbell

This ticket has been transferred to github issue 10614

Note: See TracTickets for help on using tickets.