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
c1378586
Commit
c1378586
authored
7 years ago
by
Joseph Ramsay
Browse files
Options
Downloads
Patches
Plain Diff
Re #20603 Made POLARIS cropping values mode-specific
parent
6c47401d
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
scripts/Diffraction/isis_powder/polaris.py
+8
-1
8 additions, 1 deletion
scripts/Diffraction/isis_powder/polaris.py
scripts/Diffraction/isis_powder/polaris_routines/polaris_advanced_config.py
+27
-7
27 additions, 7 deletions
...n/isis_powder/polaris_routines/polaris_advanced_config.py
with
35 additions
and
8 deletions
scripts/Diffraction/isis_powder/polaris.py
+
8
−
1
View file @
c1378586
...
@@ -10,7 +10,7 @@ from isis_powder.polaris_routines import polaris_advanced_config, polaris_algs,
...
@@ -10,7 +10,7 @@ from isis_powder.polaris_routines import polaris_advanced_config, polaris_algs,
class
Polaris
(
AbstractInst
):
class
Polaris
(
AbstractInst
):
def
__init__
(
self
,
**
kwargs
):
def
__init__
(
self
,
**
kwargs
):
self
.
_inst_settings
=
instrument_settings
.
InstrumentSettings
(
self
.
_inst_settings
=
instrument_settings
.
InstrumentSettings
(
param_map
=
polaris_param_mapping
.
attr_mapping
,
adv_conf_dict
=
polaris_advanced_config
.
variables
,
param_map
=
polaris_param_mapping
.
attr_mapping
,
adv_conf_dict
=
polaris_advanced_config
.
get_all_adv_
variables
()
,
kwargs
=
kwargs
)
kwargs
=
kwargs
)
super
(
Polaris
,
self
).
__init__
(
user_name
=
self
.
_inst_settings
.
user_name
,
super
(
Polaris
,
self
).
__init__
(
user_name
=
self
.
_inst_settings
.
user_name
,
...
@@ -24,17 +24,20 @@ class Polaris(AbstractInst):
...
@@ -24,17 +24,20 @@ class Polaris(AbstractInst):
# Public API
# Public API
def
focus
(
self
,
**
kwargs
):
def
focus
(
self
,
**
kwargs
):
self
.
_switch_mode_specific_inst_settings
(
kwargs
.
get
(
"
mode
"
))
self
.
_inst_settings
.
update_attributes
(
kwargs
=
kwargs
)
self
.
_inst_settings
.
update_attributes
(
kwargs
=
kwargs
)
return
self
.
_focus
(
run_number_string
=
self
.
_inst_settings
.
run_number
,
return
self
.
_focus
(
run_number_string
=
self
.
_inst_settings
.
run_number
,
do_van_normalisation
=
self
.
_inst_settings
.
do_van_normalisation
,
do_van_normalisation
=
self
.
_inst_settings
.
do_van_normalisation
,
do_absorb_corrections
=
self
.
_inst_settings
.
do_absorb_corrections
)
do_absorb_corrections
=
self
.
_inst_settings
.
do_absorb_corrections
)
def
create_vanadium
(
self
,
**
kwargs
):
def
create_vanadium
(
self
,
**
kwargs
):
self
.
_switch_mode_specific_inst_settings
(
kwargs
.
get
(
"
mode
"
))
self
.
_inst_settings
.
update_attributes
(
kwargs
=
kwargs
)
self
.
_inst_settings
.
update_attributes
(
kwargs
=
kwargs
)
return
self
.
_create_vanadium
(
run_number_string
=
self
.
_inst_settings
.
run_in_range
,
return
self
.
_create_vanadium
(
run_number_string
=
self
.
_inst_settings
.
run_in_range
,
do_absorb_corrections
=
self
.
_inst_settings
.
do_absorb_corrections
)
do_absorb_corrections
=
self
.
_inst_settings
.
do_absorb_corrections
)
def
set_sample_details
(
self
,
**
kwargs
):
def
set_sample_details
(
self
,
**
kwargs
):
self
.
_switch_mode_specific_inst_settings
(
kwargs
.
get
(
"
mode
"
))
kwarg_name
=
"
sample
"
kwarg_name
=
"
sample
"
sample_details_obj
=
common
.
dictionary_key_helper
(
sample_details_obj
=
common
.
dictionary_key_helper
(
dictionary
=
kwargs
,
key
=
kwarg_name
,
dictionary
=
kwargs
,
key
=
kwarg_name
,
...
@@ -122,3 +125,7 @@ class Polaris(AbstractInst):
...
@@ -122,3 +125,7 @@ class Polaris(AbstractInst):
spline_number
=
spline_coeff
,
spline_number
=
spline_coeff
,
mask_path
=
masking_file_path
)
mask_path
=
masking_file_path
)
return
output
return
output
def
_switch_mode_specific_inst_settings
(
self
,
mode
):
self
.
_inst_settings
.
update_attributes
(
advanced_config
=
polaris_advanced_config
.
get_mode_specific_dict
(
mode
),
suppress_warnings
=
True
)
This diff is collapsed.
Click to expand it.
scripts/Diffraction/isis_powder/polaris_routines/polaris_advanced_config.py
+
27
−
7
View file @
c1378586
...
@@ -22,7 +22,7 @@ script_params = {
...
@@ -22,7 +22,7 @@ script_params = {
"
spline_coefficient
"
:
100
,
"
spline_coefficient
"
:
100
,
}
}
focused_cropping_values
=
[
pdf_
focused_cropping_values
=
[
(
1500
,
19900
),
# Bank 1
(
1500
,
19900
),
# Bank 1
(
1500
,
19900
),
# Bank 2
(
1500
,
19900
),
# Bank 2
(
1500
,
19900
),
# Bank 3
(
1500
,
19900
),
# Bank 3
...
@@ -30,6 +30,14 @@ focused_cropping_values = [
...
@@ -30,6 +30,14 @@ focused_cropping_values = [
(
1500
,
19900
),
# Bank 5
(
1500
,
19900
),
# Bank 5
]
]
rietveld_focused_cropping_values
=
[
(
700
,
30000
),
# Bank 1
(
1200
,
24900
),
# Bank 2
(
1100
,
19950
),
# Bank 3
(
1100
,
19950
),
# Bank 4
(
1100
,
19950
),
# Bank 5
]
focused_bin_widths
=
[
focused_bin_widths
=
[
# Note you want these to be negative for logarithmic (dt / t) binning
# Note you want these to be negative for logarithmic (dt / t) binning
# else the output file will be larger than 1GB
# else the output file will be larger than 1GB
...
@@ -41,11 +49,11 @@ focused_bin_widths = [
...
@@ -41,11 +49,11 @@ focused_bin_widths = [
]
]
vanadium_cropping_values
=
[
vanadium_cropping_values
=
[
(
8
00
,
19995
),
# Bank 1
(
6
00
,
31000
),
# Bank 1
(
8
00
,
199
95
),
# Bank 2
(
10
00
,
24
95
0
),
# Bank 2
(
8
00
,
199
9
5
),
# Bank 3
(
10
00
,
199
7
5
),
# Bank 3
(
8
00
,
199
9
5
),
# Bank 4
(
9
00
,
199
7
5
),
# Bank 4
(
800
,
199
9
5
),
# Bank 5
(
800
,
199
7
5
),
# Bank 5
]
]
sample_empty_scale
=
1.0
sample_empty_scale
=
1.0
...
@@ -78,8 +86,20 @@ variables = {
...
@@ -78,8 +86,20 @@ variables = {
# Used by the script to find the dictionaries in advanced config.
# Used by the script to find the dictionaries in advanced config.
"
file_names_dict
"
:
file_names
,
"
file_names_dict
"
:
file_names
,
"
script_params
"
:
script_params
,
"
script_params
"
:
script_params
,
"
focused_cropping_values
"
:
focused_cropping_values
,
"
vanadium_cropping_values
"
:
vanadium_cropping_values
,
"
vanadium_cropping_values
"
:
vanadium_cropping_values
,
"
focused_bin_widths
"
:
focused_bin_widths
,
"
focused_bin_widths
"
:
focused_bin_widths
,
"
sample_empty_scale
"
:
sample_empty_scale
"
sample_empty_scale
"
:
sample_empty_scale
}
}
def
get_mode_specific_dict
(
mode
):
return
{
"
focused_cropping_values
"
:
pdf_focused_cropping_values
if
mode
==
"
PDF
"
else
rietveld_focused_cropping_values
}
def
get_all_adv_variables
(
mode
=
"
PDF
"
):
advanced_config_dict
=
{}
advanced_config_dict
.
update
(
variables
)
advanced_config_dict
.
update
(
get_mode_specific_dict
(
mode
))
return
advanced_config_dict
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