Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
mantid
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mantidproject
mantid
Commits
6d59ef63
Commit
6d59ef63
authored
5 years ago
by
Conor Finn
Browse files
Options
Downloads
Patches
Plain Diff
RE #27004 Make calibration create parameter table workspace
parent
94af5147
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
scripts/Engineering/gui/engineering_diffraction/tabs/calibration/model.py
+26
-1
26 additions, 1 deletion
...ing/gui/engineering_diffraction/tabs/calibration/model.py
with
26 additions
and
1 deletion
scripts/Engineering/gui/engineering_diffraction/tabs/calibration/model.py
+
26
−
1
View file @
6d59ef63
...
...
@@ -12,7 +12,7 @@ from os import path, makedirs
from
mantid.api
import
AnalysisDataService
as
Ads
from
mantid.kernel
import
logger
from
mantid.simpleapi
import
Load
,
EnggVanadiumCorrections
,
EnggCalibrate
,
DeleteWorkspace
,
CloneWorkspace
,
\
CreateWorkspace
,
AppendSpectra
CreateWorkspace
,
AppendSpectra
,
CreateEmptyTableWorkspace
from
mantidqt.plotting.functions
import
plot
from
Engineering.EnggUtils
import
write_ENGINX_GSAS_iparam_file
...
...
@@ -20,6 +20,7 @@ from Engineering.EnggUtils import write_ENGINX_GSAS_iparam_file
VANADIUM_INPUT_WORKSPACE_NAME
=
"
engggui_vanadium_ws
"
CURVES_WORKSPACE_NAME
=
"
engggui_vanadium_curves
"
INTEGRATED_WORKSPACE_NAME
=
"
engggui_vanadium_integration
"
CALIB_PARAMS_WORKSPACE_NAME
=
"
engggui_calibration_banks_parameters
"
OUT_FILES_ROOT_DIR
=
path
.
join
(
path
.
expanduser
(
"
~
"
),
"
Engineering_Mantid
"
)
CALIBRATION_DIR
=
path
.
join
(
OUT_FILES_ROOT_DIR
,
"
Calibration
"
,
""
)
...
...
@@ -57,6 +58,11 @@ class CalibrationModel(object):
difc
=
[
output
[
0
].
DIFC
,
output
[
1
].
DIFC
]
tzero
=
[
output
[
0
].
TZERO
,
output
[
1
].
TZERO
]
params_table
=
[]
for
i
in
range
(
2
):
params_table
.
append
([
i
,
difc
[
i
],
0.0
,
tzero
[
i
]])
self
.
update_calibration_params_table
(
params_table
)
self
.
create_output_files
(
CALIBRATION_DIR
,
difc
,
tzero
,
ceria_path
,
vanadium_path
,
instrument
)
if
rb_num
:
...
...
@@ -64,6 +70,25 @@ class CalibrationModel(object):
self
.
create_output_files
(
user_calib_dir
,
difc
,
tzero
,
ceria_path
,
vanadium_path
,
instrument
)
@staticmethod
def
update_calibration_params_table
(
params_table
):
if
len
(
params_table
)
==
0
:
return
# Create blank or clear existing params table.
if
Ads
.
doesExist
(
CALIB_PARAMS_WORKSPACE_NAME
):
workspace
=
Ads
.
retrieve
(
CALIB_PARAMS_WORKSPACE_NAME
)
workspace
.
setRowCount
(
0
)
else
:
workspace
=
CreateEmptyTableWorkspace
(
OutputWorkspace
=
CALIB_PARAMS_WORKSPACE_NAME
)
workspace
.
addColumn
(
"
int
"
,
"
bankid
"
)
workspace
.
addColumn
(
"
double
"
,
"
difc
"
)
workspace
.
addColumn
(
"
double
"
,
"
difa
"
)
workspace
.
addColumn
(
"
double
"
,
"
tzero
"
)
for
row
in
params_table
:
workspace
.
addRow
(
row
)
@staticmethod
def
_plot_vanadium_curves
():
van_curve_twin_ws
=
"
__engggui_vanadium_curves_twin_ws
"
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment