Skip to content

Commit

Permalink
Re #11421 Warn user if tof_spectra are not defined in IDF
Browse files Browse the repository at this point in the history
also touch changed parameter files for them to work on developer mantid
  • Loading branch information
abuts committed Mar 23, 2015
1 parent 2c90038 commit 2c37279
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Code/Mantid/instrument/MAPS_Definition.xml
Expand Up @@ -6,7 +6,7 @@
xsi:schemaLocation="http://www.mantidproject.org/IDF/1.0 http://schema.mantidproject.org/IDF/1.0/IDFSchema.xsd"
name="MAPS" valid-from ="1900-01-31 23:59:59"
valid-to ="2100-01-31 23:59:59"
last-modified="2011-09-30 13:30:00">
last-modified="2015-03-01 13:30:00">

<defaults>
<length unit="meter"/>
Expand Down
2 changes: 1 addition & 1 deletion Code/Mantid/instrument/MAPS_Parameters.xml
Expand Up @@ -391,7 +391,7 @@
</parameter>

<!-- The semicolon separated list of possible log names, containing information on crystl rotation.
First found log will be used togethere with motor_offset to identify crystal rotation
First found log will be used togethere with motor_offset to identify crystal rotation
(psi in Horace) -->
<parameter name="motor_log_names" type="string">
<value val="wccr;Rot"/>
Expand Down
2 changes: 1 addition & 1 deletion Code/Mantid/instrument/MARI_Definition.xml
Expand Up @@ -6,7 +6,7 @@
xsi:schemaLocation="http://www.mantidproject.org/IDF/1.0 http://schema.mantidproject.org/IDF/1.0/IDFSchema.xsd"
name="MARI" valid-from ="1900-01-31 23:59:59"
valid-to ="2100-01-31 23:59:59"
last-modified="2009-09-15 00:00:00">
last-modified="2015-03-01 00:00:00">

<defaults>
<length unit="meter"/>
Expand Down
4 changes: 2 additions & 2 deletions Code/Mantid/instrument/MERLIN_Definition_after2013_4.xml
Expand Up @@ -6,7 +6,7 @@
xsi:schemaLocation="http://www.mantidproject.org/IDF/1.0 http://schema.mantidproject.org/IDF/1.0/IDFSchema.xsd"
name="MERLIN" valid-from ="2014-02-10 00:00:01"
valid-to ="2100-01-31 23:59:59"
last-modified="2012-03-19 12:00:05">
last-modified="2015-03-01 12:00:05">

<defaults>
<length unit="meter"/>
Expand All @@ -27,7 +27,7 @@
The data for Merlin was obtained from Robert Bewley.
2012-05-17 - added names to tubes
2013-11-14 - use locations tag in tube definitions
2013-11-14 - use locations tag in tube definitions
-->

Expand Down
11 changes: 8 additions & 3 deletions Code/Mantid/scripts/Inelastic/Direct/DirectEnergyConversion.py
Expand Up @@ -420,7 +420,9 @@ def convert_to_energy(self,wb_run=None,sample_run=None,ei_guess=None,rebin=None,
num_ei_cuts = len(self.incident_energy)
if self.check_background:
# find the count rate seen in the regions of the histograms defined
# as the background regions, if the user defined such region
# as the background regions, if the user defined such region.
# This has to be done here, as workspace will be cut in chunks and bg regions --
# removed
ws_base = PropertyManager.sample_run.get_workspace()
bkgd_range = self.bkgd_range
bkgr_ws = self._find_or_build_bkgr_ws(ws_base,bkgd_range[0],bkgd_range[1])
Expand Down Expand Up @@ -838,7 +840,10 @@ def find_tof_range_for_multirep(self,workspace):
workspace = PropertyManager.sample_run.get_workspace()

spectra_id = self.prop_man.multirep_tof_specta_list
if not spectra_id:
if not spectra_id or len(spectra_id) == 0:
self.prop_man.log("*** WARNING! no mulitrep spectra found in IDF! using first existing spectra number\n"\
" This is wrong unless sample-detector distances of the instrument are all equal",\
'warning')
spectra_id = [1]

eMin,dE,eMax = PropertyManager.energy_bins.get_abs_range(self.prop_man)
Expand Down Expand Up @@ -875,7 +880,7 @@ def get_TOF_for_energies(workspace,energy_list,specID_list,ei=None,debug_mode=Fa
for given workspace and detectors.
Input:
workspace pointer to workspace with instrument attached.
workspace handler for the workspace with instrument attached.
energy_list the list of input energies to process
detID_list list of detectors to find
ei incident energy. If present, TOF range is calculated in direct mode,
Expand Down

0 comments on commit 2c37279

Please sign in to comment.