Ticket #11657 (closed: fixed)

Opened 5 years ago

Last modified 5 years ago

SaveAscii issue

Reported by: Owen Arnold Owned by: Harry Jeffery
Priority: critical Milestone: Release 3.5
Component: Reflectometry Keywords:
Cc: Blocked By:
Blocking: Tester: Mathieu Doucet

Description (last modified by Owen Arnold) (diff)

This is a bug report issued to us during the beta test period, that I think we ought to fix from Nina.

Hi,

I  have some trouble with the SaveAscii algorithm, basically I cannot switch off the SpectrumID in my saved file. We have workspaces with multiple spectra but I am only writing out one spectrum at a time. Setting WriteSpectrumID = False used to suppress the spectrumID to be written to the file in this case but it does not anymore.  The problem is that our data fitting programs fall over this single number line and refuse to work with the data until we strip it externally. As we have tens to hundreds of files this is quite a nuisance even with the stripping script we are using to clean up the saved data. Could you please look into this?

The code I am using is, spectrum is an integer: 
SaveAscii(inputwksp, filename, SpectrumList = [spectrum], WriteSpectrumID = False, CommentIndicator = "#", Separator = "Tab", ColumnHeader = False)

In the following function:
def saveslices(inputwksp, dir = None):
    if dir:
        userdirectory = dir
    else:
        userdirectory = "U:/vanWell/April_2015/savetest/"
    spectrum = 0
    print spectrum
    while True:
        try:
            filename = userdirectory + inputwksp + "_" + str(spectrum) + ".dat"
            SaveAscii(inputwksp, filename, SpectrumList = [spectrum], WriteSpectrumID = False, CommentIndicator = "#", Separator = "Tab", ColumnHeader = False)
            spectrum += 1
            print spectrum
        except: 
            print "Break out of loop: " + str(spectrum)
            break

Where spectrum is an integer. This used to work, but hasn’t for the last few releases.

Thanks,

Nina

I think the fix would be as simple as removing these two lines https://github.com/mantidproject/mantid/blob/master/Code/Mantid/Framework/DataHandling/src/SaveAscii2.cpp#L120:L121 but lets see what Mathieu has to say about this first.

  • Add a failing test case to show this doesn't work
  • Fix the issue. Update documentation for the property too.
  • Ensure that unit tests and system tests etc pass

Change History

comment:1 Changed 5 years ago by Owen Arnold

  • Description modified (diff)

comment:2 Changed 5 years ago by Owen Arnold

  • Priority changed from major to critical

comment:3 Changed 5 years ago by Harry Jeffery

  • Status changed from new to inprogress
  • Milestone changed from Release 3.4 to Release 3.5

comment:4 Changed 5 years ago by Harry Jeffery

Refs #11657 Don't override WriteSpectrumID

Changeset: aaba57949216123c603187e47f1d64c412b392f3

comment:5 Changed 5 years ago by Mathieu Doucet

  • Status changed from inprogress to verifying
  • Tester set to Mathieu Doucet

comment:6 Changed 5 years ago by Harry Jeffery

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

This is being verified as pull request #689.

comment:7 Changed 5 years ago by Harry Jeffery

Refs #11657 Update SaveAscii2 documentation

Changeset: a32aa71d90ea4278cc8e7c6093f4817f0d463412

comment:8 Changed 5 years ago by Mathieu Doucet

  • Status changed from verify to closed

Merge pull request #689 from mantidproject/11657_saveascii2_issue

Don't override WriteSpectrumID in SaveAscii-v2

Full changeset: 98d789ec511d4f3664a9b03d5a4d2bd2e26119ab

comment:9 Changed 5 years ago by Stuart Campbell

This ticket has been transferred to github issue 12495

Note: See TracTickets for help on using tickets.