Ticket #3493 (closed: fixed)

Opened 9 years ago

Last modified 5 years ago

Make SAVEASCII work with Ragged Workspace

Reported by: Wenduo Zhou Owned by: Lottie Greenwood
Priority: major Milestone: Release 3.3
Component: Framework Keywords: NewStarter
Cc: Blocked By: #7732
Blocking: Tester: Raquel Alvarez Banos

Description

For a Workspace with multiple spectral, SaveASCII will only record the X-axis values of the first spectral (dataX(0)) to the saved file. Therefore, in the case of spectrum with different range or steps on x-axis, the algorithm breaks.

Attachments

GEM38370_Focussed_Legacy.nxs (753.3 KB) - added by Lottie Greenwood 6 years ago.

Change History

comment:1 Changed 9 years ago by Nick Draper

  • Status changed from new to assigned
  • Owner set to Anyone

comment:2 Changed 9 years ago by Nick Draper

  • Milestone changed from Iteration 30 to Iteration 31

Bulk move of tickets to iteration 31 at the iteration 30 code freeze

comment:3 Changed 9 years ago by Nick Draper

  • Milestone changed from Iteration 32 to Iteration 33

Moved to iteration 33 at iteration 32 code freeze

comment:4 Changed 8 years ago by Nick Draper

  • Milestone changed from Release 2.1 to Release 2.2

Moved at end of release 2.1

comment:5 Changed 8 years ago by Nick Draper

  • Milestone changed from Release 2.2 to Release 2.3

Moved at the end of release 2.2

comment:6 Changed 8 years ago by Nick Draper

  • Milestone changed from Release 2.3 to Release 2.4

Moved to milestone 2.4

comment:7 Changed 8 years ago by Karl Palmen

  • Owner changed from Anyone to Karl Palmen
  • type changed from defect to enhancement
  • Summary changed from SAVEASCII won't work for multiple spectral to Make SAVEASCII work with Ragged Workspace

This is a documented feature of the algorithm.

See http://www.mantidproject.org/SaveAscii#Limitations

Removing this limitation would be an enhancement.

comment:8 Changed 8 years ago by Karl Palmen

This could be done by having an X column for each spectrum.

The difficult part would be getting loadAscii to read it. Presently LoadAscii recognises three formats:

(1) Single spectrum without errors
(2) Any number of spectra with errors in Y
(3) Single spectrum with errors in both X and Y (not documented in wiki)

LoadAscii determines which one of the three it is merely by counting the columns. If there are two columns it's (1), if there are an odd number of columns at least 3, then it's (2) and if there are four columns, then it's (3).

Adding the above ragged format would render the above method unusable, because for example, seven columns could be either three spectra of (2) or two spectra in a ragged workspace. It would be necessary to read the column header or get the user to indicate the format.

comment:9 Changed 8 years ago by Karl Palmen

If one always includes errors in X in a ragged workspace, the resulting ASCII file would have a number of columns divisible by four and hence LoadAscii could continue to determine the format type by number of columns. Note that case (2) about is the same as this for a single spectrum.

comment:10 Changed 8 years ago by Karl Palmen

I've found that SaveAscii will save a multi-spectrum workspace with X-errors, but LoadAscii won't load it. For this option, I'm tempted to put the X values in for every spectrum as if the workspace were raggy.

comment:11 Changed 8 years ago by Karl Palmen

Another issue. LoadAscii puts a common binning on all spectra. Should this be the case for a ragged workspace?

comment:12 Changed 8 years ago by Karl Palmen

  • Milestone changed from Release 2.4 to Release 2.5

comment:13 Changed 7 years ago by Karl Palmen

  • Milestone changed from Release 2.5 to Release 2.6

comment:14 Changed 7 years ago by Nick Draper

  • Status changed from assigned to new

comment:15 Changed 7 years ago by Nick Draper

  • Component changed from Mantid to Framework

comment:16 Changed 7 years ago by Nick Draper

  • Milestone changed from Release 2.6 to Backlog

Moved to backlog at the code freeze for R2.6

comment:17 Changed 7 years ago by Karl Palmen

  • Blocked By 7732 added

This ticket only applies to mult-spectra ASCII files. The current format for multi-spectra files is not considered to be good and will be revised in ticket #7732. Then it may be easier to support ragged workspaces. It does not makes sense to support ragged workspaces while the multi-spectra format is not good, hence this ticket is blocked by #7732.

comment:18 Changed 7 years ago by Nick Draper

  • Status changed from new to assigned

Bulk move to assigned at the introduction of the triage step

comment:19 Changed 6 years ago by Anders Markvardsen

  • Keywords NewStarter added
  • Owner changed from Karl Palmen to Lottie Greenwood
  • Milestone changed from Backlog to Release 3.3

To reproduce do e.g.:

  1. Load Test/GEM38370_Focussed_Legacy.nxs which is a ragged workspace
  1. Run SaveAscii saving e.g. spectra with workspace indices 0-1
  1. Inspect the save file and as reported have the same x-values

comment:20 Changed 6 years ago by Lottie Greenwood

  • Status changed from assigned to inprogress

comment:21 Changed 6 years ago by Lottie Greenwood

comment:22 Changed 6 years ago by Lottie Greenwood

comment:23 Changed 6 years ago by Lottie Greenwood

comment:24 Changed 6 years ago by Lottie Greenwood

comment:25 Changed 6 years ago by Lottie Greenwood

Commit 05 Refs #3493 fixed minor error

Changeset: 9e77959841486b1e727915c712293632cd4d4309

comment:26 Changed 6 years ago by Lottie Greenwood

Commit 06 Refs #3493 edited to work w builds

Changeset: e6a77648a60f38498a0b423f2696a9932b4afaa7

comment:27 Changed 6 years ago by Lottie Greenwood

Commit 06 Refs #3493 fixed difference in SF num

Changeset: 9a0f24769024c9cc1e3614f519d2d96db6b37616

comment:28 Changed 6 years ago by Lottie Greenwood

Commit 07 Refs #3493 fixed typo

Changeset: 0c5432e892dcd519f8425f5cec484cdb2428597c

comment:29 Changed 6 years ago by Lottie Greenwood

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

To test do

  • Load Test/GEM38370_Focussed_Legacy.nxs which is a ragged workspace
  • Run SaveAscii saving e.g. spectra with workspace indices 0-1
  • Inspect the save file and check that each spectra has different X values
Last edited 6 years ago by Lottie Greenwood (previous) (diff)

comment:30 Changed 6 years ago by Raquel Alvarez Banos

  • Status changed from verify to verifying
  • Tester set to Raquel Alvarez Banos

comment:31 Changed 6 years ago by Raquel Alvarez Banos

  • Status changed from verifying to reopened
  • Resolution fixed deleted

Got a merge conflict:

$ git test start 3493 git fetch -p From github.com:mantidproject/mantid

x [deleted] (none) -> origin/feature/8091_control_spawning_of_plot_windows

remote: Counting objects: 42, done. remote: Compressing objects: 100% (42/42), done. Uremote: Total 42 (delta 18), reused 0 (delta 0) Unpacking objects: 100% (42/42), done.

965778d..4b0e772 master -> origin/master b8438d4..6657eff develop -> origin/develop 4af1040..5b53a77 feature/10441_refactor_spectrum_viewer -> origin/feature/10441_refactor_spectrum_viewer

git rebase --preserve-merges origin/master Successfully rebased and updated refs/heads/master. git merge --no-ff origin/bugfix/3493_SAVEASCII_work_with_ragged Auto-merging Test/AutoTestData/UsageData/GEM_Definition.vtp CONFLICT (add/add): Merge conflict in Test/AutoTestData/UsageData/GEM_Definition.vtp Automatic merge failed; fix conflicts and then commit the result.

WARNING: There were conflicts during the merge. If they are trivial please fix them, resolve the merge with 'git add' & 'git commit' and rerun this command. If you are unsure fail the ticket, run 'git merge --abort' and talk to the develop about solving the issues.

comment:32 Changed 6 years ago by Lottie Greenwood

  • Status changed from reopened to inprogress

Commit 07 Refs #3493 removed vtp file

Changeset: 70674bebb81ca01b770e36ce3db850bf6465bc83

Changed 6 years ago by Lottie Greenwood

comment:33 Changed 6 years ago by Lottie Greenwood

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

comment:34 Changed 6 years ago by Raquel Alvarez Banos

  • Status changed from verify to verifying

comment:35 Changed 6 years ago by Lottie Greenwood

  • Status changed from verifying to closed

Merge branch 'master' into bugfix/3493_SAVEASCII_work_with_ragged

Full changeset: 5dbb7032f8e0d2558bbc3c6e4926ebfc160bc731

comment:36 Changed 6 years ago by Raquel Alvarez Banos

Merge remote-tracking branch 'origin/bugfix/3493_SAVEASCII_work_with_ragged'

Full changeset: 84e8220da0f1fab2841bf185b228f373ba1d9f76

comment:37 Changed 5 years ago by Stuart Campbell

This ticket has been transferred to github issue 4340

Note: See TracTickets for help on using tickets.