Skip to content

Commit b146ee9

Browse files
author
David Turner
committed
Added a check for the 'range' of noticed channels being null in the XSPEC template script.
1 parent 0279912 commit b146ee9

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

xga/xspec_scripts/general_xspec_fit.xcm

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,14 @@ set sp_id 1
141141
foreach sp $spec_paths {{
142142
# Sets a variable containing the lower and upper limits of the noticed channels
143143
set range [split [tcloutr noticed $sp_id] -]
144+
145+
# If there are no noticed channels, then it is possible for the just-set 'range'
146+
# variable to be null. We check, and if range is null, we move to the next
147+
# iteration of the loop (i.e. the next spectrum).
148+
if {{[string trim $range] == ""}} {{
149+
continue
150+
}}
151+
144152
# Calculates the number of channels in the range
145153
set num_chan [expr [lindex $range 1] - [lindex $range 0]]
146154
# Performs a check to see if the number of channels is greater than the minimum requirement, and

0 commit comments

Comments
 (0)