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
b2168263
Commit
b2168263
authored
5 years ago
by
Sam Jenkins
Browse files
Options
Downloads
Patches
Plain Diff
Re #25502 changed filename for .his file
parent
cbed8b39
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/EnginX.py
+27
-14
27 additions, 14 deletions
scripts/Engineering/EnginX.py
with
27 additions
and
14 deletions
scripts/Engineering/EnginX.py
+
27
−
14
View file @
b2168263
...
...
@@ -509,7 +509,7 @@ def focus_whole(run_number, van_curves, van_int, focus_directory, focus_general,
simple
.
EnggFocus
(
InputWorkspace
=
ws_to_focus
,
OutputWorkspace
=
output_ws
,
VanIntegrationWorkspace
=
van_integrated_ws
,
VanCurvesWorkspace
=
van_curves_ws
,
Bank
=
str
(
i
))
_save_out
(
run_number
,
focus_directory
,
focus_general
,
output_ws
,
"
ENGINX_{}_{}
"
,
str
(
i
))
_save_out
(
run_number
,
focus_directory
,
focus_general
,
output_ws
,
"
ENGINX_{}_{}
{}
"
,
str
(
i
))
def
focus_cropped
(
run_number
,
van_curves
,
van_int
,
focus_directory
,
focus_general
,
do_pre_process
,
params
,
time_period
,
...
...
@@ -542,14 +542,14 @@ def focus_cropped(run_number, van_curves, van_int, focus_directory, focus_genera
simple
.
EnggFocus
(
InputWorkspace
=
ws_to_focus
,
OutputWorkspace
=
output_ws
,
VanIntegrationWorkspace
=
van_integrated_ws
,
VanCurvesWorkspace
=
van_curves_ws
,
Bank
=
bank
.
get
(
crop_on
))
_save_out
(
run_number
,
focus_directory
,
focus_general
,
output_ws
,
"
ENGINX_{}_{}
"
,
crop_on
)
_save_out
(
run_number
,
focus_directory
,
focus_general
,
output_ws
,
"
ENGINX_{}_{}
{}
"
,
crop_on
)
else
:
# crop on the spectra passed in, focus and save it out
output_ws
=
output_ws
.
format
(
""
,
""
)
simple
.
EnggFocus
(
InputWorkspace
=
ws_to_focus
,
OutputWorkspace
=
output_ws
,
VanIntegrationWorkspace
=
van_integrated_ws
,
VanCurvesWorkspace
=
van_curves_ws
,
SpectrumNumbers
=
crop_on
)
_save_out
(
run_number
,
focus_directory
,
focus_general
,
output_ws
,
"
ENGINX_{}_bank_{}
"
,
"
cropped
"
)
_save_out
(
run_number
,
focus_directory
,
focus_general
,
output_ws
,
"
ENGINX_{}_bank_{}
{}
"
,
"
cropped
"
)
def
focus_texture_mode
(
run_number
,
van_curves
,
van_int
,
focus_directory
,
focus_general
,
do_pre_process
,
params
,
...
...
@@ -586,7 +586,7 @@ def focus_texture_mode(run_number, van_curves, van_int, focus_directory, focus_g
simple
.
EnggFocus
(
InputWorkspace
=
ws_to_focus
,
OutputWorkspace
=
output_ws
,
VanIntegrationWorkspace
=
van_integrated_ws
,
VanCurvesWorkspace
=
van_curves_ws
,
SpectrumNumbers
=
banks
.
get
(
bank
))
_save_out
(
run_number
,
focus_directory
,
focus_general
,
output_ws
,
"
ENGINX_{}_texture_{}
"
,
bank
)
_save_out
(
run_number
,
focus_directory
,
focus_general
,
output_ws
,
"
ENGINX_{}_texture_{}
{}
"
,
bank
)
def
_prepare_focus
(
run_number
,
van_curves
,
van_int
,
do_pre_process
,
params
,
time_period
):
...
...
@@ -622,28 +622,41 @@ def _save_out(run_number, focus_directory, focus_general, output, join_string, b
"""
# work out where to save the files
filename
=
os
.
path
.
join
(
focus_directory
,
join_string
.
format
(
run_number
,
bank_id
))
hdf5_name
=
os
.
path
.
join
(
focus_directory
,
run_number
+
"
.hdf5
"
)
dat_name
,
genie_filename
,
gss_name
,
hdf5_name
,
nxs_name
=
_find_focus_file_location
(
bank_id
,
focus_directory
,
join_string
,
run_number
)
if
not
u
(
bank_id
).
isnumeric
():
bank_id
=
0
# save the files out to the user directory
simple
.
SaveFocusedXYE
(
InputWorkspace
=
output
,
Filename
=
filename
+
"
.dat
"
,
SplitFiles
=
False
,
simple
.
SaveFocusedXYE
(
InputWorkspace
=
output
,
Filename
=
dat_name
,
SplitFiles
=
False
,
StartAtBankNumber
=
bank_id
)
simple
.
SaveGSS
(
InputWorkspace
=
output
,
Filename
=
filename
+
"
.gss
"
,
SplitFiles
=
False
,
Bank
=
bank_id
)
simple
.
SaveOpenGenieAscii
(
InputWorkspace
=
output
,
Filename
=
filename
+
"
.his
"
,
OpenGenieFormat
=
"
ENGIN-X Format
"
)
simple
.
SaveNexus
(
InputWorkspace
=
output
,
Filename
=
filename
+
"
.nxs
"
)
simple
.
SaveGSS
(
InputWorkspace
=
output
,
Filename
=
gss_name
,
SplitFiles
=
False
,
Bank
=
bank_id
)
simple
.
SaveOpenGenieAscii
(
InputWorkspace
=
output
,
Filename
=
genie_
filename
,
OpenGenieFormat
=
"
ENGIN-X Format
"
)
simple
.
SaveNexus
(
InputWorkspace
=
output
,
Filename
=
nxs_name
)
simple
.
ExportSampleLogsToHDF5
(
InputWorkspace
=
output
,
Filename
=
hdf5_name
,
Blacklist
=
"
bankid
"
)
if
not
focus_general
==
focus_directory
:
if
not
os
.
path
.
exists
(
focus_general
):
os
.
makedirs
(
focus_general
)
# copy the files to the general directory
copy2
(
filename
+
"
.dat
"
,
focus_general
)
copy2
(
filename
+
"
.gss
"
,
focus_general
)
copy2
(
filename
+
"
.his
"
,
focus_general
)
copy2
(
filename
+
"
.nxs
"
,
focus_general
)
copy2
(
dat_name
,
focus_general
)
copy2
(
gss_name
,
focus_general
)
copy2
(
genie_
filename
,
focus_general
)
copy2
(
nxs_name
,
focus_general
)
copy2
(
hdf5_name
,
focus_general
)
def
_find_focus_file_location
(
bank_id
,
focus_directory
,
join_string
,
run_number
):
run_and_bank
=
join_string
.
format
(
run_number
,
bank_id
,
"
{}
"
)
filename
=
os
.
path
.
join
(
focus_directory
,
run_and_bank
)
genie_filename
=
os
.
path
.
join
(
focus_directory
,
run_and_bank
.
replace
(
"
_
"
,
""
,
1
).
format
(
"
.his
"
))
dat_name
=
filename
.
format
(
"
.dat
"
)
gss_name
=
filename
.
format
(
"
.gss
"
)
nxs_name
=
filename
.
format
(
"
.nxs
"
)
hdf5_name
=
os
.
path
.
join
(
focus_directory
,
run_number
+
"
.hdf5
"
)
return
dat_name
,
genie_filename
,
gss_name
,
hdf5_name
,
nxs_name
def
_decomment_csv
(
csvfile
):
"""
remove commented rows from the csv file
...
...
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