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
eec0f371
Commit
eec0f371
authored
5 years ago
by
Conor Finn
Browse files
Options
Downloads
Patches
Plain Diff
RE #26849 Simplify GSAS file generation
parent
2712dad8
No related branches found
Branches containing commit
No related tags found
Tags containing commit
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
+25
-33
25 additions, 33 deletions
...ing/gui/engineering_diffraction/tabs/calibration/model.py
with
25 additions
and
33 deletions
scripts/Engineering/gui/engineering_diffraction/tabs/calibration/model.py
+
25
−
33
View file @
eec0f371
...
@@ -284,46 +284,38 @@ class CalibrationModel(object):
...
@@ -284,46 +284,38 @@ class CalibrationModel(object):
:param bank: Optional parameter to crop by bank
:param bank: Optional parameter to crop by bank
:param spectrum_numbers: Optional parameter to crop using spectrum numbers.
:param spectrum_numbers: Optional parameter to crop using spectrum numbers.
"""
"""
def
generate_both_banks_file
(
difc_list
,
tzero_list
):
kwargs
=
{
"
ceria_run
"
:
sample_path
,
"
vanadium_run
"
:
vanadium_path
}
file_path
=
calibration_dir
+
self
.
_generate_output_file_name
(
vanadium_path
,
sample_path
,
instrument
,
bank
=
"
all
"
)
def
south_kwargs
():
write_ENGINX_GSAS_iparam_file
(
file_path
,
kwargs
[
"
template_file
"
]
=
SOUTH_BANK_TEMPLATE_FILE
difc_list
,
kwargs
[
"
bank_names
"
]
=
[
"
South
"
]
tzero_list
,
ceria_run
=
sample_path
,
def
north_kwargs
():
vanadium_run
=
vanadium_path
)
kwargs
[
"
template_file
"
]
=
NORTH_BANK_TEMPLATE_FILE
kwargs
[
"
bank_names
"
]
=
[
"
North
"
]
def
generate_north_or_custom_bank_file
(
difc_north
,
tzero_north
,
bank_name
=
"
north
"
):
file_path
=
calibration_dir
+
self
.
_generate_output_file_name
(
def
generate_output_file
(
difc_list
,
tzero_list
,
bank_name
,
kwargs_to_pass
):
vanadium_path
,
sample_path
,
instrument
,
bank
=
bank_name
)
file_path
=
calibration_dir
+
self
.
_generate_output_file_name
(
vanadium_path
,
sample_path
,
instrument
,
bank
=
bank_name
)
write_ENGINX_GSAS_iparam_file
(
file_path
,
[
difc_north
],
[
tzero_north
],
write_ENGINX_GSAS_iparam_file
(
file_path
,
difc_list
,
tzero_list
,
**
kwargs_to_pass
)
ceria_run
=
sample_path
,
vanadium_run
=
vanadium_path
,
template_file
=
NORTH_BANK_TEMPLATE_FILE
,
bank_names
=
[
"
North
"
])
def
generate_south_bank_file
(
difc_south
,
tzero_south
):
file_path
=
calibration_dir
+
self
.
_generate_output_file_name
(
vanadium_path
,
sample_path
,
instrument
,
bank
=
"
south
"
)
write_ENGINX_GSAS_iparam_file
(
file_path
,
[
difc_south
],
[
tzero_south
],
ceria_run
=
sample_path
,
vanadium_run
=
vanadium_path
,
template_file
=
SOUTH_BANK_TEMPLATE_FILE
,
bank_names
=
[
"
South
"
])
if
not
path
.
exists
(
calibration_dir
):
if
not
path
.
exists
(
calibration_dir
):
makedirs
(
calibration_dir
)
makedirs
(
calibration_dir
)
if
bank
is
None
and
spectrum_numbers
is
None
:
if
bank
is
None
and
spectrum_numbers
is
None
:
generate_both_banks_file
(
difc
,
tzero
)
generate_output_file
(
difc
,
tzero
,
"
all
"
,
kwargs
)
generate_north_or_custom_bank_file
(
difc
[
0
],
tzero
[
0
])
north_kwargs
()
generate_south_bank_file
(
difc
[
1
],
tzero
[
1
])
generate_output_file
([
difc
[
0
]],
[
tzero
[
0
]],
"
north
"
,
kwargs
)
south_kwargs
()
generate_output_file
([
difc
[
1
]],
[
tzero
[
1
]],
"
south
"
,
kwargs
)
elif
bank
==
"
1
"
:
elif
bank
==
"
1
"
:
generate_north_or_custom_bank_file
(
difc
[
0
],
tzero
[
0
])
north_kwargs
()
generate_output_file
([
difc
[
0
]],
[
tzero
[
0
]],
"
north
"
,
kwargs
)
elif
bank
==
"
2
"
:
elif
bank
==
"
2
"
:
generate_south_bank_file
(
difc
[
0
],
tzero
[
0
])
south_kwargs
()
elif
bank
is
None
:
generate_output_file
([
difc
[
0
]],
[
tzero
[
0
]],
"
south
"
,
kwargs
)
generate_north_or_custom_bank_file
(
difc
[
0
],
tzero
[
0
],
"
cropped
"
)
elif
bank
is
None
:
# Custom cropped files use the north bank template.
north_kwargs
()
generate_output_file
([
difc
[
0
]],
[
tzero
[
0
]],
"
cropped
"
,
kwargs
)
@staticmethod
@staticmethod
def
get_info_from_file
(
file_path
):
def
get_info_from_file
(
file_path
):
...
...
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