Difference between revisions of "Homer and mgenie style functions"

From LIBISIS
Jump to navigation Jump to search
 
(20 intermediate revisions by 2 users not shown)
Line 1: Line 1:
== Preparing the [IXTdata_source] ==
+
== Preparing the [[IXTdata_source]] ==
  
 
All the population routines descirbed here use the [[IXTdata_source]] object.  The [[IXTdata_source]] object is used to define source files for the population of an [[IXTrunfile]] object. Different source files can be added to the [[IXTdata_source]] object with their own special commands:
 
All the population routines descirbed here use the [[IXTdata_source]] object.  The [[IXTdata_source]] object is used to define source files for the population of an [[IXTrunfile]] object. Different source files can be added to the [[IXTdata_source]] object with their own special commands:
  
*rawfiles: [add_rawfile]
+
*rawfiles: [[add_rawfile]] [[add_multrawfile]]
*monitor map files: [add_monmap]
+
*monitor map files: [[add_monmap]]
*monitor mask files: [add_monmask]
+
*monitor mask files: [[add_monmask]]
*detector map files: [add_detmap]
+
*detector map files: [[add_detmap]]
*detector mask files: [add_detmask]
+
*detector mask files: [[add_detmask]]
  
 
It is <b>necessary</b> to define the type of instrument you are using in the [[IXTdata_source]] object, of course only <b>one</b> instrument can be defined for population to work as you would expect. This affects how the IXTrunfile is populated, and the current options are as follows
 
It is <b>necessary</b> to define the type of instrument you are using in the [[IXTdata_source]] object, of course only <b>one</b> instrument can be defined for population to work as you would expect. This affects how the IXTrunfile is populated, and the current options are as follows
  
*chopper instruments: [add_chopinst]
+
*chopper instruments: [[add_chopinst]]
*diffraction instruments: [add_diffinst]
+
*diffraction instruments: [[add_diffinst]]
  
 +
== IXTmap and IXTmask files ==
  
== Alternative [IXTmap], [IXTmask] population ==
+
Different instruments generally have their own map files associated with them, but it is also possible to create [[IXTmap and IXTmask from the matlab command line]]
  
 +
==  Populating [[IXTrunfile]] ==
  
The commands above are for specifying files, it is also possible to populate [IXTmap] and [IXTmask] objects in the matlab environment from the command line.
+
There are three standard ways to populate an [[IXTrunfile]] object, all require an [[IXTdata_source]] object which has had the type of instrument defined in it ie. chopper or diffraction instrument. As well as simply loading data from a raw file the data can generally be optionally masked/mapped/rebinned using an argument to the population function as a keyword with an associated parameter (eg. a map/mask file, rebin parameters etc.)
  
[IXTmask]
+
*'''For any of these functions to run properly the matlab environment must be prepared by calling the [[instrument setup]] scripts.'''
 +
*If a map/mask/raw file is provided as a command line argument, then it will override any specification already defined in the [IXTdata_source] object.
 +
*If no map files are defined, either on the command line or in the [[IXTdata_source]] object then a 1:1 mapping with _all_ spectra will be created by default. If no mask files are defined then all spectra will be included in the workspaces.
  
<pre>
+
The standard construction for these population routines is as follows.
>> mask_array = [1,3,5,6,7,8,9]
 
>> mask = IXTmask(mask_array)
 
</pre>
 
or
 
<pre>
 
>> mask = IXTmask([1,3,5,6,7,8,9])
 
</pre>
 
* this is a special [IXTmask] constructor
 
* mask is an [IXTmask] object
 
* mask_array is an array of spectra to be masked
 
* a mask object can be created by <b>DIAG</b> which is one of the [Diagnostic tools for homer]
 
 
 
[IXTmap]
 
  
 
<pre>
 
<pre>
>> spectrum_arrays = {[1,3,5,6],[7,8,9,10],[11,12,13,14]}
+
>> RF=pop_fun(DSO, run_no, 'keyword_1', parameter_1,..., 'keyword_N',parameter_N)
>> workspace_numbers = [1,22,333]
 
>> map=IXTmap(spectrum_arrays)
 
 
</pre>
 
</pre>
or
 
<pre>
 
>> map=IXTmap([1,22,333],{[1,3,5,6],[7,8,9,10],[11,12,13,14]})
 
</pre>
 
* this is a special [IXTmap] constructor
 
* spectrum_arrays is a <b>cell array</b> containing numerical lists of spectra to be grouped together into workspaces
 
* the array workspace_numbers is optional, and if not provided workspace numbers will be given values 1->N where N = size(spectrum_arrays,2)
 
 
 
==  Populating [IXTrunfile] ==
 
 
There are three standard ways to populate an [IXTrunfile] object, all require an [IXTdata_source] object which has had the type of instrument defined in it ie. chopper or diffraction instrument. As well as simply loading data from a raw file the data can generally be optionally masked/mapped/rebinned using an argument to the population function as a keyword with an associated parameter (eg. a map/mask file, rebin parameters etc.)
 
 
If a map/mask/raw file is provided as a command line argument, then it will override any specification already defined in the [IXTdata_source] object.
 
  
If no map files are defined, either on the command line or in the [IXTdata_source] object then a 1:1 mapping with _all_ spectra will be created by default. If no mask files are defined then all spectra will be included in the workspaces.
+
For any of these functions to run properly the matlab environment must be prepared by calling the [[instrument setup]] scripts.
  
The standard construction for these population routines is as follows.
 
  
<pre>
 
>> RF=pop_fun(DSO,  run_no, 'keyword_1', parameter_1,..., 'keyword_N',parameter_N)
 
</pre>
 
 
* Before any of these functions can be called the instrument specific setup file must be called with arguments defining the directories containing the instrument map files, the instrument mask files and the instrument parameter files
 
<pre>
 
>> mapdir='../mari_files';maskdir='../mari_files';datadir='../mari_files';
 
>> nexdir='../mari_files';
 
>> setup_mari_inst(datadir,mapdir,nexdir,maskdir);
 
</pre>
 
* It can be useful to define default instrument values for the instrument for input to homer
 
<pre>
 
>> setup_mari_homer_defaults;
 
</pre>
 
*  Instrument specific entries '''must''' be added to the [[IXTdata_source]] object (these define the sample position and other parameters)
 
<pre>
 
>> dso=setup_mari_data_source;
 
</pre>
 
 
* RF is an [[IXTrunfile]] object
 
* RF is an [[IXTrunfile]] object
 
* DSO is an [[IXTdata_source]] object which contains an instrument type definition
 
* DSO is an [[IXTdata_source]] object which contains an instrument type definition
 
* pop_fun  can be either _mon,spec,pop_full,homer_
 
* pop_fun  can be either _mon,spec,pop_full,homer_
* raw file specification does not use a keyword, it is built up from the standard instrument abbreviation (eg. HRP, MAR, SRF etc.) and the run number
+
* raw file specification does not use a keyword, it is built up from the standard instrument abbreviation (eg. HRP, MAR, SRF etc.) and the run number automatically according to which setup file has been run. If this has not been run then the script will fail and tell you
* keywords are _always_ character strings and each keyword must be followed by a parameter
+
* keywords are ''always'' character strings and each keyword '''must''' be followed by a parameter
 
* values can take any appropriate type
 
* values can take any appropriate type
* map files have a designated [Map File Format]
+
* map files have a designated [[Map File Format]]
* mask files have a designated [Mask File Format]
+
* mask files have a designated [[Mask File Format]]
  
  
 
=== mon ===
 
=== mon ===
  
This function populates an [IXTrunfile] object with the raw time-of-flight data for the monitors in the runfile.mon_data [IXTdata] object only. It will optionally accept the keywords in the following table:
+
This function populates an [[IXTrunfile]] object with the raw time-of-flight data for the monitors in the runfile.mon_data [IXTdata] object only. It will optionally accept the keywords in the following table:
  
 
{| border ="1" cellpadding="2"
 
{| border ="1" cellpadding="2"
Line 101: Line 57:
 
| 'period'  || numeric || specifies period default:1, if = 0 then spectra can be defined from more than one period
 
| 'period'  || numeric || specifies period default:1, if = 0 then spectra can be defined from more than one period
 
|-
 
|-
|  'mon_map'|| 'string' || specifies a map file, supplied parameter is defines the location of the monitor map file
+
|  'mon_map'|| 'string' or [[IXTmap]] || specifies a map file, supplied parameter is defines the location of the monitor map file
 
|-
 
|-
 
|  'mon_mask'|| 'string' || specifies a mask file, supplied parameter is defines the location of the monitor mask file
 
|  'mon_mask'|| 'string' || specifies a mask file, supplied parameter is defines the location of the monitor mask file
 
|-
 
|-
|  'm_rebin'|| [xlo,dx,xhi] or [x_1,dx_1,x_2,dx_2,...,x_n,dx_n,x_n+1] || rebin parameters are defined according to the '''numerical''' array inputs of [rebin_x],[rebin] for single datasets
+
|  'm_rebin'|| [xlo,dx,xhi] or [x_1,dx_1,x_2,dx_2,...,x_n,dx_n,x_n+1] || rebin parameters are defined according to the '''numerical''' array inputs of [[rebin_x]],[[rebin]] for single datasets
 
|}
 
|}
  
Line 117: Line 73:
 
>> runfile = mon(dso,run_no,'mon_map',monitor_map_file,'mon_mask',monitor_mask_file,'m_rebin',rebin_parameters)
 
>> runfile = mon(dso,run_no,'mon_map',monitor_map_file,'mon_mask',monitor_mask_file,'m_rebin',rebin_parameters)
 
</pre>
 
</pre>
 
  
 
=== spec ===
 
=== spec ===
  
This function populates an [IXTrunfile] object with the raw time-of-flight data for the detectors in the runfile.det_data [IXTdata] object only. It will optionally accept the keywords in the following table:
+
This function populates an [[IXTrunfile]] object with the raw time-of-flight data for the detectors in the runfile.det_data [IXTdata] object only. It will optionally accept the keywords in the following table:
  
 
{| border ="1" cellpadding="2"
 
{| border ="1" cellpadding="2"
Line 131: Line 86:
 
| 'period'  ||numeric ||specifies period default:1, if = 0 then spectra can be defined from more than one period
 
| 'period'  ||numeric ||specifies period default:1, if = 0 then spectra can be defined from more than one period
 
|-
 
|-
|  'det_map'||'string' ||specifies a map file, supplied parameter is defines the location of the detector map file
+
|  'det_map' or ||'string' or [[IXTmap]] ||specifies a map file, supplied parameter is defines the location of the detector map file
 
|-
 
|-
 
| 'det_mask'||'string' ||specifies a mask file, supplied parameter is defines the location of the detector mask file
 
| 'det_mask'||'string' ||specifies a mask file, supplied parameter is defines the location of the detector mask file
Line 156: Line 111:
  
  
This function populates an [IXTrunfile] object with the raw time-of-flight data for the detectors in the runfile.det_data [IXTdata] object only. It will optionally accept the keywords in the following table:
+
This function populates an [[IXTrunfile]] object with the raw time-of-flight data for the detectors in the runfile.det_data [IXTdata] object only. It will optionally accept the keywords in the following table:
  
 
{| border ="1" cellpadding="2"
 
{| border ="1" cellpadding="2"
Line 166: Line 121:
 
|'period'  || numeric || specifies period default:1, if = 0 then spectra can be defined from more than one period
 
|'period'  || numeric || specifies period default:1, if = 0 then spectra can be defined from more than one period
 
|-
 
|-
|'mon_map'|| 'string' || specifies a monitor map file, supplied parameter is defines the location of the monitor map file
+
| 'mon_map' or ||'string' or [[IXTmap]] ||specifies a monitor map file, supplied parameter is defines the location of the monitor map file
 
|-
 
|-
 
|'mon_mask'|| 'string' ||specifies a monitor mask file, supplied parameter is defines the location of the monitor mask file
 
|'mon_mask'|| 'string' ||specifies a monitor mask file, supplied parameter is defines the location of the monitor mask file
Line 172: Line 127:
 
|'m_rebin'|| [xlo,dx,xhi] or [x_1,dx_1,x_2,dx_2,...,x_n,dx_n,x_n+1] || specifies rebinning of monitor data, rebin parameters are defined according to the *numerical* array inputs of [rebin_x],[rebin] for single datasets
 
|'m_rebin'|| [xlo,dx,xhi] or [x_1,dx_1,x_2,dx_2,...,x_n,dx_n,x_n+1] || specifies rebinning of monitor data, rebin parameters are defined according to the *numerical* array inputs of [rebin_x],[rebin] for single datasets
 
|-
 
|-
|'det_map'|| 'string' || specifies a detector map file, supplied parameter is defines the location of the detector map file
+
| 'det_map' or ||'string' or [[IXTmap]] ||specifies a detector map file, supplied parameter is defines the location of the detector map file
 
|-
 
|-
 
|'det_mask'|| 'string' || specifies a detector mask file, supplied parameter is defines the location of the detector mask file
 
|'det_mask'|| 'string' || specifies a detector mask file, supplied parameter is defines the location of the detector mask file
Line 211: Line 166:
 
| 'period'  || numeric || specifies period default:1, if = 0 then spectra can be defined from more than one period
 
| 'period'  || numeric || specifies period default:1, if = 0 then spectra can be defined from more than one period
 
|-
 
|-
|'mon_map'|| 'string' || specifies a monitor map file, supplied parameter is defines the location of the monitor map file
+
|'ei'  || real || defines estimate of incident energy (meV)
 +
|-
 +
| ||'white'  || specifies treatment as a white beam
 +
|-
 +
|'fixei' || real  || specifies a known incident energy, so that ei determination is not necessary
 +
|-
 +
'mon_map' or ||'string' or [[IXTmap]] || specifies a monitor map file, supplied parameter is defines the location of the monitor map file
 
|-
 
|-
 
|'mon_mask'|| 'string' || specifies a monitor mask file, supplied parameter is defines the location of the monitor mask file
 
|'mon_mask'|| 'string' || specifies a monitor mask file, supplied parameter is defines the location of the monitor mask file
 +
|-
 +
|  'mon_units'  || [units code]    || specifies output units of monitor data
 
|-
 
|-
 
|'m_rebin'|| [xlo,dx,xhi] or [x_1,dx_1,x_2,dx_2,...,x_n,dx_n,x_n+1] || specifies rebinning of monitor data, rebin parameters are defined according to the *numerical* array inputs of [rebin_x],[rebin] for single datasets
 
|'m_rebin'|| [xlo,dx,xhi] or [x_1,dx_1,x_2,dx_2,...,x_n,dx_n,x_n+1] || specifies rebinning of monitor data, rebin parameters are defined according to the *numerical* array inputs of [rebin_x],[rebin] for single datasets
 
|-
 
|-
|'det_map'|| 'string' || specifies a detector map file, supplied parameter is defines the location of the detector map file
+
| 'det_map' or ||'string' or [[IXTmap]] ||specifies a detector map file, supplied parameter is defines the location of the detector map file
 
|-
 
|-
 
|'det_mask'|| 'string' || specifies a detector mask file, supplied parameter is defines the location of the detector mask file
 
|'det_mask'|| 'string' || specifies a detector mask file, supplied parameter is defines the location of the detector mask file
 +
|-
 +
|'det_units'  || [units code]    || specifies output units of detector data
 
|-
 
|-
 
|'d_rebin'|| [xlo,dx,xhi] or [x_1,dx_1,x_2,dx_2,...,x_n,dx_n,x_n+1] || specifies rebinning of detector data, rebin parameters are defined according to the '''numerical''' array inputs of [rebin_x],[rebin] for single datasets. 'd_rebin' '''cannot''' be supplied with 'd_int'
 
|'d_rebin'|| [xlo,dx,xhi] or [x_1,dx_1,x_2,dx_2,...,x_n,dx_n,x_n+1] || specifies rebinning of detector data, rebin parameters are defined according to the '''numerical''' array inputs of [rebin_x],[rebin] for single datasets. 'd_rebin' '''cannot''' be supplied with 'd_int'
 +
|-
 +
|'d_int'|| [xlo,xhi] || specifies limits for integration of the dataset between two limits, if 'det_units' has been supplied then integration will take place after units conversion, 'd_int' '''cannot''' be supplied with 'd_rebin'. limits are specified in the units of the data, therefore if your output units are 'w' then your integration limits are specified in meV. if no units are specified then the limits are in time (microseconds)
 
|-
 
|-
 
|'background'|| [xlo,xhi] || specifies a background subtraction, the supplied parameter is a numerical array defining the background integration range in time-of-flight
 
|'background'|| [xlo,xhi] || specifies a background subtraction, the supplied parameter is a numerical array defining the background integration range in time-of-flight
|-
 
|'ei'  || real || defines estimate of incident energy (meV)
 
|-
 
| ||'white'  || specifies treatment as a white beam
 
|-
 
|'fixei' || real  || specifies a known incident energy, so that ei determination is not necessary
 
 
|-
 
|-
 
|'normalisation'  || integer || value specifies workspace number of monitor used in normalisation [default 1]
 
|'normalisation'  || integer || value specifies workspace number of monitor used in normalisation [default 1]
Line 239: Line 200:
 
|  || 'peak'    || specifies to use the area determined by peak search in the monitor defined by 'normalisation' close to the value of either 'ei' or 'fixei', only valid if 'ei' numeric, not if 'white'
 
|  || 'peak'    || specifies to use the area determined by peak search in the monitor defined by 'normalisation' close to the value of either 'ei' or 'fixei', only valid if 'ei' numeric, not if 'white'
 
|-
 
|-
| 'mon_units'  || [units code]    || specifies output units of monitor data
+
|'scale'  || real || specifies units of normalisation ie per 1e6 counts or per 1000uAhrs [default 1]
 
|-
 
|-
|'det_units'  || [units code]    || specifies output units of detector data
+
|'solid'  || [IXTrunfile]    || Specifies a solid angle correction, the supplied parameter '''must''' be a white beam [IXTrunfile] object which has been integrated for every spectrum (i suppose one could also just provide a run number....)
 
|-
 
|-
|'d_int'|| [xlo,xhi] || specifies limits for integration of the dataset between two limits, if 'det_units' has been supplied then integration will take place after units conversion, 'd_int' '''cannot''' be supplied with 'd_rebin'
+
|'corr' || logical  || Specifies detector efficiency correction and kf/ki correction will be applied [default false]
 
|-
 
|-
|'scale'  || real || specifies units of normalisation ie per 1e6 counts or per 1000uAhrs [default 1]
+
|'abs'  || real   || absolute units scaling factor
 
|-
 
|-
|'solid'  || [IXTrunfile]    || Specifies a solid angle correction, the supplied parameter *must* be a white beam [IXTrunfile] object which has been integrated for every spectrum (i suppose one could also just provide a run number....)
+
|'mass'  || real  || mass of sample
 
|-
 
|-
|'corr'  || logical  || Specifies detector efficiency correction and kf/ki correction will be applied [default false]
+
|'RMM'  || real  || relative molecular mass of sample
 
|}
 
|}
 
 
see also: [Creating Datasets],  [Arrays of Datasets],  [Mathematical Functions and Operators],  [Other Matlab Utilities],    [Input and Output Functions], [Dataset Manipulation and Conversion Functions]
 
 
------
 

Latest revision as of 14:12, 12 August 2008

Preparing the IXTdata_source

All the population routines descirbed here use the IXTdata_source object. The IXTdata_source object is used to define source files for the population of an IXTrunfile object. Different source files can be added to the IXTdata_source object with their own special commands:

It is necessary to define the type of instrument you are using in the IXTdata_source object, of course only one instrument can be defined for population to work as you would expect. This affects how the IXTrunfile is populated, and the current options are as follows

IXTmap and IXTmask files

Different instruments generally have their own map files associated with them, but it is also possible to create IXTmap and IXTmask from the matlab command line

Populating IXTrunfile

There are three standard ways to populate an IXTrunfile object, all require an IXTdata_source object which has had the type of instrument defined in it ie. chopper or diffraction instrument. As well as simply loading data from a raw file the data can generally be optionally masked/mapped/rebinned using an argument to the population function as a keyword with an associated parameter (eg. a map/mask file, rebin parameters etc.)

  • For any of these functions to run properly the matlab environment must be prepared by calling the instrument setup scripts.
  • If a map/mask/raw file is provided as a command line argument, then it will override any specification already defined in the [IXTdata_source] object.
  • If no map files are defined, either on the command line or in the IXTdata_source object then a 1:1 mapping with _all_ spectra will be created by default. If no mask files are defined then all spectra will be included in the workspaces.

The standard construction for these population routines is as follows.

>> RF=pop_fun(DSO,  run_no, 'keyword_1', parameter_1,..., 'keyword_N',parameter_N)

For any of these functions to run properly the matlab environment must be prepared by calling the instrument setup scripts.


  • RF is an IXTrunfile object
  • DSO is an IXTdata_source object which contains an instrument type definition
  • pop_fun can be either _mon,spec,pop_full,homer_
  • raw file specification does not use a keyword, it is built up from the standard instrument abbreviation (eg. HRP, MAR, SRF etc.) and the run number automatically according to which setup file has been run. If this has not been run then the script will fail and tell you
  • keywords are always character strings and each keyword must be followed by a parameter
  • values can take any appropriate type
  • map files have a designated Map File Format
  • mask files have a designated Mask File Format


mon

This function populates an IXTrunfile object with the raw time-of-flight data for the monitors in the runfile.mon_data [IXTdata] object only. It will optionally accept the keywords in the following table:

Keyword arguments for mon function
Keyword Parameter Type Brief Description
'period' numeric specifies period default:1, if = 0 then spectra can be defined from more than one period
'mon_map' 'string' or IXTmap specifies a map file, supplied parameter is defines the location of the monitor map file
'mon_mask' 'string' specifies a mask file, supplied parameter is defines the location of the monitor mask file
'm_rebin' [xlo,dx,xhi] or [x_1,dx_1,x_2,dx_2,...,x_n,dx_n,x_n+1] rebin parameters are defined according to the numerical array inputs of rebin_x,rebin for single datasets

An example sequence of commands is shown below.

>> run_no= '12345' % run number
>> monitor_mask_file = 'X:\MASKFILES\MON.MASK'
>> monitor_map_file = 'X:\MAPFILES\MON.MAP'
>> rebin_parameters = [1000,100,20000]
>> runfile = mon(dso,run_no,'mon_map',monitor_map_file,'mon_mask',monitor_mask_file,'m_rebin',rebin_parameters)

spec

This function populates an IXTrunfile object with the raw time-of-flight data for the detectors in the runfile.det_data [IXTdata] object only. It will optionally accept the keywords in the following table:

Keyword arguments for spec function
Keyword Parameter Type Brief Description
'period' numeric specifies period default:1, if = 0 then spectra can be defined from more than one period
'det_map' or 'string' or IXTmap specifies a map file, supplied parameter is defines the location of the detector map file
'det_mask' 'string' specifies a mask file, supplied parameter is defines the location of the detector mask file
'd_rebin' [xlo,dx,xhi] or [x_1,dx_1,x_2,dx_2,...,x_n,dx_n,x_n+1] specifies rebinning of data, rebin parameters are defined according to the *numerical* array inputs of [rebin_x],[rebin] for single datasets
'd_int' [xlo,xhi] specifies limits for integration of the dataset between two limits, 'd_int' *cannot* be supplied with 'd_rebin'
'background' [xlo,xhi] specifies a background subtraction, the supplied parameter is a numerical array defining the background integration range in time-of-flight

An example sequence of commands is shown below.

>> run_no= '54321' % run number
>> detector_mask_file = 'X:\MASKFILES\DET.MASK'
>> detector_map_file = 'X:\MAPFILES\DET.MAP'
>> rebin_parameters = [1000,100,20000]
>> bgrd =[12000,18000]
>> runfile = spec(dso,run_no,'det_map',detector_map_file,'det_mask',detector_mask_file,'d_rebin',rebin_parameters)

pop_full

This function populates an IXTrunfile object with the raw time-of-flight data for the detectors in the runfile.det_data [IXTdata] object only. It will optionally accept the keywords in the following table:

Keyword arguments for pop_full function
Keyword Parameter Type Brief Description
'period' numeric specifies period default:1, if = 0 then spectra can be defined from more than one period
'mon_map' or 'string' or IXTmap specifies a monitor map file, supplied parameter is defines the location of the monitor map file
'mon_mask' 'string' specifies a monitor mask file, supplied parameter is defines the location of the monitor mask file
'm_rebin' [xlo,dx,xhi] or [x_1,dx_1,x_2,dx_2,...,x_n,dx_n,x_n+1] specifies rebinning of monitor data, rebin parameters are defined according to the *numerical* array inputs of [rebin_x],[rebin] for single datasets
'det_map' or 'string' or IXTmap specifies a detector map file, supplied parameter is defines the location of the detector map file
'det_mask' 'string' specifies a detector mask file, supplied parameter is defines the location of the detector mask file
'd_rebin' [xlo,dx,xhi] or [x_1,dx_1,x_2,dx_2,...,x_n,dx_n,x_n+1] specifies rebinning of detector data, rebin parameters are defined according to the *numerical* array inputs of [rebin_x],[rebin] for single datasets
'd_int' [xlo,xhi] specifies limits for integration of the dataset between two limits, 'd_int' *cannot* be supplied with 'd_rebin'
'background' [xlo,xhi] specifies a background subtraction, the supplied parameter is a numerical array defining the background integration range in time-of-flight

An example sequence of commands is shown below.

>> run_no= '54321' % run number
>> monitor_mask_file = 'X:\MASKFILES\MON.MASK'
>> monitor_map_file = 'X:\MAPFILES\MON.MAP'
>> mon_rebin_parameters = [1000,100,20000]
>> detector_mask_file = 'X:\MASKFILES\DET.MASK'
>> detector_map_file = 'X:\MAPFILES\DET.MAP'
>> det_rebin_parameters = [1000,100,20000]
>> bgrd = [12000,18000]
>> runfile = pop_full(dso,run_no,'mon_map',monitor_map_file,'mon_mask',monitor_mask_file,'m_rebin',mon_rebin_parameters, ...
                                      'det_map',detector_map_file,'det_mask',detector_mask_file,'d_rebin',det_rebin_parameters)


homer

The homer command is a special version of the populate command in which extra normalisation keywords can be supplied with a fixed set of associated parameters.

Keyword arguments for homer function
Keyword Parameter Type Brief Description
'period' numeric specifies period default:1, if = 0 then spectra can be defined from more than one period
'ei' real defines estimate of incident energy (meV)
'white' specifies treatment as a white beam
'fixei' real specifies a known incident energy, so that ei determination is not necessary
'mon_map' or 'string' or IXTmap specifies a monitor map file, supplied parameter is defines the location of the monitor map file
'mon_mask' 'string' specifies a monitor mask file, supplied parameter is defines the location of the monitor mask file
'mon_units' [units code] specifies output units of monitor data
'm_rebin' [xlo,dx,xhi] or [x_1,dx_1,x_2,dx_2,...,x_n,dx_n,x_n+1] specifies rebinning of monitor data, rebin parameters are defined according to the *numerical* array inputs of [rebin_x],[rebin] for single datasets
'det_map' or 'string' or IXTmap specifies a detector map file, supplied parameter is defines the location of the detector map file
'det_mask' 'string' specifies a detector mask file, supplied parameter is defines the location of the detector mask file
'det_units' [units code] specifies output units of detector data
'd_rebin' [xlo,dx,xhi] or [x_1,dx_1,x_2,dx_2,...,x_n,dx_n,x_n+1] specifies rebinning of detector data, rebin parameters are defined according to the numerical array inputs of [rebin_x],[rebin] for single datasets. 'd_rebin' cannot be supplied with 'd_int'
'd_int' [xlo,xhi] specifies limits for integration of the dataset between two limits, if 'det_units' has been supplied then integration will take place after units conversion, 'd_int' cannot be supplied with 'd_rebin'. limits are specified in the units of the data, therefore if your output units are 'w' then your integration limits are specified in meV. if no units are specified then the limits are in time (microseconds)
'background' [xlo,xhi] specifies a background subtraction, the supplied parameter is a numerical array defining the background integration range in time-of-flight
'normalisation' integer value specifies workspace number of monitor used in normalisation [default 1]
'uahr' specifies normalisation by microamp hours, 'range' keyword cannot be specified if this parameter is defined
'range' [xlo,xhi] specifies range of integration for normalisation, using monitor workspace defined by 'normalisation' and declared in the units defined in 'mon_units'
'peak' specifies to use the area determined by peak search in the monitor defined by 'normalisation' close to the value of either 'ei' or 'fixei', only valid if 'ei' numeric, not if 'white'
'scale' real specifies units of normalisation ie per 1e6 counts or per 1000uAhrs [default 1]
'solid' [IXTrunfile] Specifies a solid angle correction, the supplied parameter must be a white beam [IXTrunfile] object which has been integrated for every spectrum (i suppose one could also just provide a run number....)
'corr' logical Specifies detector efficiency correction and kf/ki correction will be applied [default false]
'abs' real absolute units scaling factor
'mass' real mass of sample
'RMM' real relative molecular mass of sample