Ticket #6759 (closed: fixed)

Opened 8 years ago

Last modified 5 years ago

SANS: SaveRKH does not save correct the SpectrumNumber

Reported by: Gesner Passos Owned by: Gesner Passos
Priority: major Milestone: Release 2.5
Component: Mantid Keywords:
Cc: anders.markvardsen@… Blocked By:
Blocking: Tester: Russell Taylor

Description

Execute the following script and although you would expect that the resulting file would have the spectrum index as 100, 101, the end result is 1,2

datax = [1,2,3,4,5]
datay = [2,3,4,5]
datae=[0.4,0.5,0,0]
ws = CreateWorkspace(datax,datay,datae,NSpec=1)
ws = Transpose(ws)
offset = 100
for i in range(ws.getNumberHistograms()):
	ws.getSpectrum(i).setSpectrumNo(i+offset)
print ws.getSpectrum(0).getSpectrumNo()
SaveRKH(ws,'/tmp/test.dat', Append=False)

Correct this.

Change History

comment:1 Changed 8 years ago by Gesner Passos

  • Status changed from new to accepted

comment:2 Changed 8 years ago by Gesner Passos

This one currently is correct, and should continue to work

#for loq
ws = LoadRaw('99631')
ws = Integration(ws)
ws = CropWorkspace(ws,StartWorkspaceIndex=100,EndWorkspaceIndex=200)
SaveRKH(ws,'/tmp/test.dat', Append=False)

comment:3 Changed 8 years ago by Gesner Passos

Correct the SpectrumNumbering from SaveRKH

re #6759

Changeset: 6f7ba7823d997aab4a51b3960417f33e4c065d50

comment:4 Changed 8 years ago by Gesner Passos

Tester:

run both scripts and make sure that the output file ('tmp/test.dat') has the spectrum index starting around 100. (Just open the file in a normal editor, and check that the first column starts with 100 or 101)

comment:5 Changed 8 years ago by Gesner Passos

  • Status changed from accepted to verify
  • Cc anders.markvardsen@… added
  • Resolution set to fixed

comment:6 Changed 8 years ago by Russell Taylor

  • Status changed from verify to verifying
  • Tester set to Russell Taylor

comment:7 Changed 8 years ago by Gesner Passos

Correct the SpectrumNumbering from SaveRKH

re #6759

Changeset: 6f7ba7823d997aab4a51b3960417f33e4c065d50

comment:8 Changed 8 years ago by Russell Taylor

  • Status changed from verifying to closed

The non-working example given here is in a sense invalid as in that case you don't end up with a SpectraAxis up the side of the workspace, whereas with an actual SANS reduction I think you would. Possibly SaveRKH should check for that when it tests the dimensions of the workspace.

Still, in the case where you definitely want a spectrum number, I do encourage going via ISpectrum::getSpectrum rather than via the axis.

comment:9 Changed 8 years ago by Gesner Passos

Correct the SpectrumNumbering from SaveRKH

re #6759

Changeset: 6f7ba7823d997aab4a51b3960417f33e4c065d50

comment:10 Changed 8 years ago by Gesner Passos

Correct the SpectrumNumbering from SaveRKH

re #6759

Changeset: 6f7ba7823d997aab4a51b3960417f33e4c065d50

comment:11 Changed 7 years ago by Gesner Passos

Correct the SpectrumNumbering from SaveRKH

re #6759

Changeset: 6f7ba7823d997aab4a51b3960417f33e4c065d50

comment:12 Changed 7 years ago by Gesner Passos

Correct the SpectrumNumbering from SaveRKH

re #6759

Changeset: 6f7ba7823d997aab4a51b3960417f33e4c065d50

comment:13 Changed 5 years ago by Stuart Campbell

This ticket has been transferred to github issue 7605

Note: See TracTickets for help on using tickets.