SANS GUI Testing¶
Data reduction¶
Time required: about 1 hour
Set up¶
Get the Training data from the downloads page on the Mantid Project website.
Open
Interfaces>SANS>ISIS SANS.Click
Manage Directories. This opens Mantid’s main dialog for managing search paths. Ensure the Training data directory is in the search directories.If you haven’t set one up yet, add a folder to save test data into later.
Set the default save directory in
Manage DirectoriesClick OK on the manage-directories dialog and ensure the
Save Pathon the SANS GUI (below batch file) displays the correct save path.Click
Load User File; from the Training data in theloqdemofolder, chooseMaskFile.toml.Click
Load Batch File; from the Training data in theloqdemofolder, choosebatch_mode_reduction.csv.
Automatic Save Selection¶
Select
FileorBothfrom theSave Optionsat the bottom right of the screen.In the
Reductionsection to the left of theSave Options, switch between the1Dand2Dradio buttons..When 1D is selected,
CanSAS (1D)andNxCanSAS (1D/2D)should be checked.When 2D is selected, only
NxCanSAS (1D/2D)should be checked.
Check
RKH (1D/2D).Change the selected
Reductionradio button.The options should revert to the defaults above (with
RKH (1D/2D)unchecked).Select
Memory. TheCanSAS (1D),NxCanSAS (1D/2D), andRKH (1D/2D)checkboxes should be disabled.Swap between
MemoryandFilewith a2Dreduction mode.CanSAS (1D)should always stay disabled.Set the
Save Optionback toMemoryto continue with the rest of the tests.
Runs table editing¶
In the Runs tab:
Check that the
Insert,Delete,Copy,Paste,CutandEraseicons work as expected on table rows.Tick the
Sample Geometrybutton - some extra columns should appear.Create multiple rows in the table with different data e.g. one row with an output name, one row without.
Try changing a random setting in the settings tab and remember what you set it to.
Make some more edits to the table. The settings will be reverted to the defaults set in the User File.
Click the
Export Tablebutton and save the table as a csv file. Check the file in an editor or Excel and ensure it looks like a sensible representation of the table in the formatkey,value,key,value,.... All columns exceptOptionsandSample Shapeshould be included.Try unticking
Sample Geometryand tickingMulti-periodand resave the CSV. The displayed columns change but the saved file should contain the same set of columns regardless of whether these are ticked.Click
Load Batch fileand select the newly saved table. All columns that were saved should be loaded.Try deleting and/or reordering some of the columns in the saved file and re-load it. All of the values in the file should be populated in the correct columns.
Re-load the original batch file.
User files¶
Change some values on the
Settingstab and make a note of what you changed.Re-load the user file and check the values you changed - they should have reverted to their original values.
Change some values on the
Beam Centretab. Re-load the user file. The inputs in theCentre Positionsection should revert to their original values. The inputs in theOptionssection (such as the radius limits) should not revert.Ensure that you can load the old style
MaskFile.txtuser file from the sample data.Note: In order to see this file, you may need to change the settings in the file browser window to look for
.txtfiles instead of.TOMLfiles.
In the table on the
Runstab, under theUser Filecolumn, enterMaskFile.tomlin one row andMaskFile.txtin the other row. ClickProcess All. After some seconds, the rows should turn green to indicate that they processed successfully.Re-load the original user and batch files as per the set-up instructions.
Display mask¶
In the Settings tab:
Go to
Mask.Click
Display Mask.This should give an instrument view with a circle at the centre.
Close the Instrument View window
Go to
Q, Wavelength, Detector Limitssub-tab.Change the
Phi Limitto read 0 to 45 and uncheckuse mirror sector.Go to
Masksub-tab.Click
Display Mask.This should give an instrument view where only angles 0-45 are unmasked.
Change the settings back to -90 to 90 and reselect
use mirror sector.
Processing¶
1D reduction
Clear all workspaces in your workspaces list if they are not empty.
In
General, Scale, Event Slice, Samplesub-tab, ensure theReduction ModeisAll.In the
Runstab, underSave Options, selectBoth, and tickCanSAS (1D)andNXcanSAS (1D/2D).Select
Save Can.Click
Process All.After some seconds the rows should turn green.
In the workspaces list, there should be a series of new workspaces; five group workspaces and four 1D workspaces.
Check your default save directory. For each reduction two banks (HAB/main) should be saved. In total, there should be 20 workspaces saved. For each row, file type, and bank, there should be a reduced file (with no suffix) and a
samplefile. Thefirst_timeline should also produce acanworkspace for each file type and bank. This is because both workspaces have the samecaninput run numbers and so the reduction only calculates it once.Double-click the 1D workspaces and you should get a single line plot.
Clear the newly created files and workspaces to make the next test easier
Change the contents of the first cell in the first row to
74045and clickProcess Selected.The row should turn blue; hovering over the row should give an error message.
Change the first column of the first row back to
74044.Click on another row, the modified row should have cleared its colour
2D reduction
Clear all workspaces in your workspaces list if they are not empty.
In
General, Scale, Event Slice, Samplesub-tab, ensure theReduction ModeisAll.Switch to the 2D
Reduction Mode.Click
Process All.You should get four 2D workspaces instead of the previous 1D workspaces (they will have 100 spectra instead of 1). Double-click them and check you can do a colourfill plot.
Check your save directory. There should now only be a
.h5file for each output.Clear the newly created files and workspaces to make future tests easier
Change
Reductionback to 1D.Click
Process All.When it completes, Check the
Multi-periodbox - six additional columns should appear in the table.Delete all rows and re-load the batch file.
Merged reduction
In the
Settingstab,General, Scale, Event Slice, Samplesub-tab, setReduction ModetoMerged.Return to the
Runstab.Ensure save outputs
CanSAS (1D)andNXcanSAS (1D/2D)are ticked.Click
Process All.The workspaces list should now contain a group named
LAB_and_HAB_workspaces_from_merged_reductionthat contains themainandHABworkspaces, which were previously ungrouped for a non-merged reduction.Check your save directory. As well as the previous 1D outputs, there should now be an additional
.xmland.h5output file for the merged output for each row.In the
Settingstab,General, Scale, Event Slice, Samplesub-tab, change theReduction Modeback toAll.
Scaled Background Subtracted Reduction
Create a new copy of the User File in your file browser.
Open this new copy in a text editor and find the
[detector.configuration]section.Under this section, make sure setting
selected_detectoris set toMerged.Back in the ISIS SANS interface, change the user file to this new file.
Click over to the
Runstab.Set the
Save OptionstoMemory.Select one of the rows and click
Process SelectedTake note of the name of the reduced workspace with
mergedin the title.Make a copy of the row you just processed using the
CopyandPastebuttons above the runs table.Change the
Output Nameof the new row to something likebgsub_test.Check the
Scaled Background Subtractioncheckbox.In the
BackgroundWorkspacecolumn, enter the name of the merged workspace you took note of before.In the
ScaleFactorcolumn, enter0.9.Set the
Save OptionstoBothand ensure that save outputsCanSAS (1D)andNXcanSAS (1D/2D)are ticked.Select this new row and click
Process Selected.When it completes, two output files should have been created with
bgsub_testin the name. One, which is the normal output data. Another with the scaled subtraction, which should have_bgsubappended to the name.Right click on each of these and select
Show Data. The subtracted workspace’s values should be 10% of the of the unsubtracted workspace’s values.Check that your save location contains files for both the background subtracted workspace and the normal reduction output.
Save Other¶
Single Workspace
Navigate to the
Runstab, making sure there are some reduced workspaces present in the ADS. Follow one of the “Processing” instruction sets above if you need to create some.Click the
Save Otherbutton.Select one of the workspaces from the list.
Provide a path to a new save directory, and provide a file name.
Click
Save.Check the file was saved to the correct location on your system.
Multiple Workspaces
Select multiple workspaces with Shift or Ctrl/Cmd.
Provide a suffix for the files.
Click
Save.Check that the files were saved with their workspace’s names, but with the provided suffix appended.
Beam centre finder¶
In the Beam centre tab:
Make a note of the four values representing the rear/front detector centre positions.
Check that the
Find Rear Centreradio button is selected and click run.A plot should appear - make sure to show it if it is behind another window. It should be updated with four lines, which gradually get closer together. This might take a while to run.
Check the values in the first two text boxes at the top (Centre Position - Rear) have changed when it has finished running.
Select the
Find Front Centreradio button and re-run the test.Four more lines should appear on the same plot. This time, in the values at the top, only the values for the front should have changed.
Sum runs¶
In the Sum Runs tab:
Enter
74044, 74019in the top line.Click
Addat the side.Check that
LOQ74044-addis automatically entered as the Save File at the bottom of the tab.At the top-right of the tab, click the
Select Save Directorybutton and select a directory in your managed paths.Click
Sumat the bottom.Go back to the
Runstab.Remove all rows.
Reload the batch file as before.
Change the first column of both rows to
LOQ74044-add.Click
Process All.This should now process as before.
Diagnostics¶
In the Diagnostic Page tab:
For run choose
Browseand load theLOQ74044.nxsfile.Click each of the
Integralbuttons.They should produce plots.
Check the
Apply Maskboxes and click the buttons again.They should produce new, slightly different plots.
Display¶
In the
Runstab, check that all table, process, and load buttons have clear tooltips by hovering over them.Check that
Zero Error FreeandUse Optimizationshave clear tooltips.In the settings, hover over a random selection of buttons and text boxes to check tooltips are still there. Users rely on the tooltips a lot and really do notice each missing one. Note: The
Wavelengthsection of the settings is missing its tooltips. We and the users are aware of this so an issue should not be made when it is discovered.