Skip to content

Commit 1e5feeb

Browse files
authored
Merge pull request #17 from psavery/pyxrf-utils-skip-dwell
Skip "Dwell" column when making CSV file
2 parents e1b3df8 + 4a2f965 commit 1e5feeb

2 files changed

Lines changed: 9 additions & 5 deletions

File tree

tomviz/PyXRFProcessDialog.cxx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -184,14 +184,15 @@ class PyXRFProcessDialog::Internal : public QObject
184184
// Check if there are any duplicate angles selected
185185
QStringList anglesUsed;
186186
QStringList anglesDuplicated;
187-
for (int i = 0; i < logFileData.size(); ++i) {
188-
auto use = logFileValue(i, "Use");
187+
for (auto sid : filteredSidList) {
188+
auto row = sidToRow[sid];
189+
auto use = logFileValue(row, "Use");
189190
if (use != "x" && use != "1") {
190191
// This angle wasn't used.
191192
continue;
192193
}
193194

194-
auto angle = logFileValue(i, "Theta");
195+
auto angle = logFileValue(row, "Theta");
195196
if (anglesUsed.contains(angle) && !anglesDuplicated.contains(angle)) {
196197
anglesDuplicated.append(angle);
197198
}

tomviz/python/tomviz/pyxrf/pyxrf-utils/pyxrf_utils/create_log_file.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,11 +111,14 @@ def create_log_file(log_file_name: str, working_directory: str,
111111
"Y Start",
112112
"Y Stop",
113113
"Num Y",
114-
"Dwell",
114+
# This had "Dwell" here before, but sometimes it is missing from
115+
# the "param_input". We don't need it for what we are doing, so just
116+
# skip over it.
115117
"UID",
116118
"Status",
117119
"Version",
118120
]
121+
119122
hdf5_mdata_sorted = []
120123
for hdf5_fn in hdf5_names_sorted:
121124
md = hdf5_mdata[hdf5_fn]
@@ -129,7 +132,7 @@ def create_log_file(log_file_name: str, working_directory: str,
129132
np.round(md["param_theta"], 3),
130133
"1",
131134
hdf5_fn,
132-
*[np.round(_, 3) for _ in md["param_input"][0:7]],
135+
*[np.round(_, 3) for _ in md["param_input"][0:6]],
133136
md["scan_uid"],
134137
md["scan_exit_status"],
135138
"t1",

0 commit comments

Comments
 (0)