Difference between revisions of "Scripting Homer Functions"

From LIBISIS
Jump to navigation Jump to search
 
(18 intermediate revisions by the same user not shown)
Line 1: Line 1:
 +
== The basics ==
 +
 
It is possible to treat your data by making calls to the [[Homer and mgenie style functions#homer|homer]] function only, but it can be quite involved, requiring specific keyword arguments to be specified for different parts of the process. These three functions can be called in conjunction with [[diagnose]] to fully homer your data. They all call the [[Homer and mgenie style functions#homer|homer]] function underneath, but they set up particular default values particular to the process. All these default values can be overridden if they are defined as arguments to the function.
 
It is possible to treat your data by making calls to the [[Homer and mgenie style functions#homer|homer]] function only, but it can be quite involved, requiring specific keyword arguments to be specified for different parts of the process. These three functions can be called in conjunction with [[diagnose]] to fully homer your data. They all call the [[Homer and mgenie style functions#homer|homer]] function underneath, but they set up particular default values particular to the process. All these default values can be overridden if they are defined as arguments to the function.
  
 +
* '''Before any of the following commands can be called the appropriate [[Instrument setup]] functions '''must''' be called.'''
 
* All three functions have required keywords and accept all the optional keywords from [[Homer and mgenie style functions#homer|homer]]  
 
* All three functions have required keywords and accept all the optional keywords from [[Homer and mgenie style functions#homer|homer]]  
* Before any of the following commands can be called the appropriate [[Instrument Setup]] functions '''must''' be called.
 
 
* run_no is a keyword common to all these functions, it is a string defining the run number to be homered
 
* run_no is a keyword common to all these functions, it is a string defining the run number to be homered
 
* if multiple runs are to be added together then they can be provided in a cell array of strings
 
* if multiple runs are to be added together then they can be provided in a cell array of strings
 
<pre>
 
<pre>
>> run_no={'11045' '23456' '12345'}
+
>> run_no='12345'
 +
>> run_no={'11045' '23456' '12345'} % a cell array of srings
 
</pre>
 
</pre>
  
 
* no extra functions need to be called on the dso [[IXTdata_source]] object.
 
* no extra functions need to be called on the dso [[IXTdata_source]] object.
 +
* normalisation by an integral of monitor 1 between 1000 and 2000 <math>\mu</math>s is set by default and common to all functions
  
 
== non-default keyword arguments ==
 
== non-default keyword arguments ==
Line 17: Line 21:
  
 
There are also special functions to create an [[IXTmap and IXTmask from the matlab command line]].
 
There are also special functions to create an [[IXTmap and IXTmask from the matlab command line]].
 
  
 
== white_beam ==
 
== white_beam ==
Line 23: Line 26:
 
>> whitebeam_runfile=white_beam(dso,  run_no, 'keyword_1', parameter_1,..., 'keyword_N',parameter_N)
 
>> whitebeam_runfile=white_beam(dso,  run_no, 'keyword_1', parameter_1,..., 'keyword_N',parameter_N)
 
</pre>
 
</pre>
 
+
* creates an [[IXTrunfile]] output
 +
* 'ei' is set to be 'white' by default
 +
* obvious values to override might be the 'd_int' values, or the normalisation details
  
 
== mono_van ==
 
== mono_van ==
Line 30: Line 35:
 
</pre>
 
</pre>
  
 +
* creates an [[IXTrunfile]] output
 
* chopper type is a string argument denoting the type of chopper used in the experiment eg. ''''sloppy''''
 
* chopper type is a string argument denoting the type of chopper used in the experiment eg. ''''sloppy''''
 
* 'ei' or 'fixei' '''must''' also be a keyword
 
* 'ei' or 'fixei' '''must''' also be a keyword
* 'solid' keyword '''must''' be defined, but generally would be <tt>whitebeam_runfile</tt>
+
 
= monovan_abs=
+
=== monovan_abs ===
The absolute scaling factor from a monochromatic vanadium can be determined by making a call to mono_van_abs
+
The absolute units scaling factor from a monochromatic vanadium can be determined by making a call to monovan_abs, it is generally run on the [[IXTrunfile]] output from <tt>mono_van</tt>. This value can then be used as an argument to <tt>mono_sample</tt> below
 
<pre>
 
<pre>
 
>> scaling_factor=monovan_abs(monovan_runfile)
 
>> scaling_factor=monovan_abs(monovan_runfile)
 +
</pre>
  
 
== mono_sample ==
 
== mono_sample ==
Line 43: Line 50:
 
</pre>
 
</pre>
  
 
+
* creates an [[IXTrunfile]] output
 
* chopper type is a string argument denoting the type of chopper used in the experiment eg. ''''sloppy''''
 
* chopper type is a string argument denoting the type of chopper used in the experiment eg. ''''sloppy''''
 
* 'ei' or 'fixei' '''must''' also be a keyword
 
* 'ei' or 'fixei' '''must''' also be a keyword
* 'solid' keyword '''must''' be defined, but generally would be <tt>whitebeam_runfile</tt>
+
 
 +
== Examples ==
 +
 
 +
[[Example Scripts |Examples of homer scripting files]] can be downloaded

Latest revision as of 10:19, 31 January 2008

The basics

It is possible to treat your data by making calls to the homer function only, but it can be quite involved, requiring specific keyword arguments to be specified for different parts of the process. These three functions can be called in conjunction with diagnose to fully homer your data. They all call the homer function underneath, but they set up particular default values particular to the process. All these default values can be overridden if they are defined as arguments to the function.

  • Before any of the following commands can be called the appropriate Instrument setup functions must be called.
  • All three functions have required keywords and accept all the optional keywords from homer
  • run_no is a keyword common to all these functions, it is a string defining the run number to be homered
  • if multiple runs are to be added together then they can be provided in a cell array of strings
>> run_no='12345'
>> run_no={'11045' '23456' '12345'} % a cell array of srings
  • no extra functions need to be called on the dso IXTdata_source object.
  • normalisation by an integral of monitor 1 between 1000 and 2000 <math>\mu</math>s is set by default and common to all functions

non-default keyword arguments

There are two sets of keywords which are not default values.

  1. 'mon_map' and 'det_map', if they are not supplied then a 1:1 mapping will be made and there will be a message on screen that this is the case. They can either be defined as a text file, a nexus file or as an IXTmap object.
  2. 'mon_mask' and 'det_mask' can be created by the diagnose function which creates an IXTmask object. They can also be defined as a text file or a nexus file.

There are also special functions to create an IXTmap and IXTmask from the matlab command line.

white_beam

>> whitebeam_runfile=white_beam(dso,  run_no, 'keyword_1', parameter_1,..., 'keyword_N',parameter_N)
  • creates an IXTrunfile output
  • 'ei' is set to be 'white' by default
  • obvious values to override might be the 'd_int' values, or the normalisation details

mono_van

>> monovan_runfile=mono_van(dso,  run_no, chopper_type,'keyword_1', parameter_1,..., 'keyword_N',parameter_N)
  • creates an IXTrunfile output
  • chopper type is a string argument denoting the type of chopper used in the experiment eg. 'sloppy'
  • 'ei' or 'fixei' must also be a keyword

monovan_abs

The absolute units scaling factor from a monochromatic vanadium can be determined by making a call to monovan_abs, it is generally run on the IXTrunfile output from mono_van. This value can then be used as an argument to mono_sample below

>> scaling_factor=monovan_abs(monovan_runfile)

mono_sample

>> monosample_runfile=mono_sample(dso,  run_no, chopper_type,'keyword_1', parameter_1,..., 'keyword_N',parameter_N)
  • creates an IXTrunfile output
  • chopper type is a string argument denoting the type of chopper used in the experiment eg. 'sloppy'
  • 'ei' or 'fixei' must also be a keyword

Examples

Examples of homer scripting files can be downloaded