Difference between revisions of "Diagnose"

From LIBISIS
Jump to navigation Jump to search
 
(10 intermediate revisions by the same user not shown)
Line 1: Line 1:
The main diagnostic tool for homer is the DIAG function. <b>DIAG</b> creates an [IXTmask] object with optional file output (nexus or ascii) for a given monochromatic [IXTrunfile], using the data in one (optionally two) white beam vanadium integral [IXTrunfile], and the integrals of the background for the monochromatic run, this background integration needs to be carried out in a separate process using <b>spec</b> or <b>homer</b>. It also outputs a matlab structure 'cause' detailing information on which files contributed to the exclusion of which spectra and the reason for their exclusion, and if appropriate the value which failed the test applied.
+
The main diagnostic tool for homer is the diagnose function (analogous to the VMS DIAG function). It creates an [IXTmask] object with optional file output (nexus or ascii) for a given monochromatic run, using the data from a white beam vanadium integral [IXTrunfile].  
  
<b>DIAG</b> will optionally load a hard mask file, an [IXTmask] object or file (nexus or ascii), that is a list of spectra that are to be masked regardless of any diagnostic operations. Sometimes it is desirable to consider banks of spectra separately such as those connected to psd and non-psd detectors. If this is the case then an [IXTmap] object or file (nexus or ascii) may be supplied as an argument to the <b>DIAG</b> routine, defining these groups of spectra.
+
*It also outputs a matlab structure 'cause' detailing information on which files contributed to the exclusion of which spectra and the reason for their exclusion, and if appropriate the value which failed the test applied.
 +
*'''For this function to run properly the matlab environment must be prepared by calling the [[instrument setup]] scripts.'''
 +
*diagnose will optionally load a hard mask file, an [IXTmask] object or file (nexus or ascii), that is a list of spectra that are to be masked regardless of any diagnostic operations.  
 +
*Sometimes it is desirable to consider banks of spectra separately such as those connected to psd and non-psd detectors. If this is the case then an [IXTmap] object or file (nexus or ascii) may be supplied as an argument to the diagnose routine, defining these groups of spectra.
 +
*There are also arguments to which set certain limits and tolerances in the diagnostic process, all of which have default values. Some of these values bear relation to VMS DIAG input, in each case this has been defined below.
  
There are also arguments to <b>DIAG</b> which set certain limits and tolerances in the diagnostic process of <b>DIAG</b>, all of which have default values. Some of these values bear relation to VMS DIAG input, in each case this has been defined below.
 
  
 
An simple example function call to <b>DIAG</b> might be as follows:
 
An simple example function call to <b>DIAG</b> might be as follows:
Line 9: Line 12:
 
>> maps_bank=IXTmap({[1:17280],[17281:18432],[18433:32256],[32257:41472]});
 
>> maps_bank=IXTmap({[1:17280],[17281:18432],[18433:32256],[32257:41472]});
 
>> monosam=read_nxs('monosam.nxs',IXTrunfile,'mono_sam');
 
>> monosam=read_nxs('monosam.nxs',IXTrunfile,'mono_sam');
>> ~[mask,cause]=diagnose(monosam,'rf_v1','wbrf.nxs','rf_v1_entry','whitebeam','bank',maps_bank,'hmask','4to1_022.msk','nomess');
+
>> [mask,cause]=diagnose(dso, run_no,run_no,'wbrf.nxs','rf_v1_entry','whitebeam','bank',maps_bank,'hardmask','4to1_022.msk','nomess');
 
</pre>
 
</pre>
  
Line 17: Line 20:
 
!width="20%"|Parameter Type  
 
!width="20%"|Parameter Type  
 
!width="70%"|Brief Description
 
!width="70%"|Brief Description
|-
 
| 'rfile'  || '{file}.nxs' or [[IXTrunfile]] || monochromatic sample background integral [[IXTrunfile]], can be loaded from a nexus file or a matlab object
 
 
|-
 
|-
 
|  'rf_v1'|| '{file}.nxs' or [[IXTrunfile]] || white beam vanadium integral [[IXTrunfile]], can be loaded from a nexus file or a matlab object, /V1 argument from VMS DIAG
 
|  'rf_v1'|| '{file}.nxs' or [[IXTrunfile]] || white beam vanadium integral [[IXTrunfile]], can be loaded from a nexus file or a matlab object, /V1 argument from VMS DIAG
Line 24: Line 25:
 
|  'rf_v2'|| '{file}.nxs' or [[IXTrunfile]] || second white beam vanadium integral [[IXTrunfile]], can be loaded from a nexus file or a matlab object [default: empty object with false validity], /V2 argument from VMS DIAG
 
|  'rf_v2'|| '{file}.nxs' or [[IXTrunfile]] || second white beam vanadium integral [[IXTrunfile]], can be loaded from a nexus file or a matlab object [default: empty object with false validity], /V2 argument from VMS DIAG
 
|-
 
|-
| 'rf_ZC' || '{file}.nxs' or [[IXTrunfile]] || zero count integral [IXTrunfile], can be loaded from a nexus file or a matlab object. a runfile in which there has been an integral over the whole time range to spot zero counts
+
| 'bmin'|| real || /BMIN argument from VMS DIAG
 
|-
 
|-
|  'hardmask'|| '{file}.msk', '{mask}.nxs' or [[IXTmask]] || file (nexus or ascii) or [[IXTmask]] object defining the hard mask [default: empty object with false validity], /HARD argument from VMS DIAG
+
| 'bmax'|| real || /BMAX argument from VMS DIAG
 +
|-
 +
|  'hardmask'|| '{file}.msk', '{mask}.nxs' or [[IXTmask]] || file (nexus or ascii) or [[IXTmask]] object defining the hard mask [default:empty object with false validity], /HARD argument from VMS DIAG
 
|-
 
|-
 
| 'bank'  || '{file}.map', '{map}.nxs' or [[IXTmap]] || file (nexus or ascii) or [[IXTmap]] object defining the spectra banks of the instrument [default: empty object with false validity]
 
| 'bank'  || '{file}.map', '{map}.nxs' or [[IXTmap]] || file (nexus or ascii) or [[IXTmap]] object defining the spectra banks of the instrument [default: empty object with false validity]
 
|-
 
|-
|  'tiny'|| real||
+
|  's_zero'|| real|| /ZERO_BKGD from VMS DIAG - will remove spectra with zero integrated signal in the range between bmin and bmax of the '''sample''' run[default: false]
|-
 
|  'huge'|| real||
 
|-
 
|  's_zero'|| real|| /ZERO_BKGD from VMS DIAG
 
 
|-
 
|-
 
| 's_out_lo'|| real|| low outlier limit for monochromatic sample background integral
 
| 's_out_lo'|| real|| low outlier limit for monochromatic sample background integral
Line 46: Line 45:
 
| 'sv_sig'  || real|| desc
 
| 'sv_sig'  || real|| desc
 
|-
 
|-
|  'v_zero'|| real|| desc
+
|  'v_zero'|| real|| - will remove spectra with zero integrated signal in the range between bmin and bmax of the '''vanadium''' runs[default: true]
 
|-
 
|-
 
| 'v_out_lo'|| real|| low outlier limit for vanadium integral
 
| 'v_out_lo'|| real|| low outlier limit for vanadium integral
Line 58: Line 57:
 
| 'vv_sig'  || real|| desc
 
| 'vv_sig'  || real|| desc
 
|-
 
|-
|  'r'|^ real|| /STABILITY argument from VMS DIAG
+
|  'r'||real|| /STABILITY argument from VMS DIAG
 
|-
 
|-
 
| 'r_sig'  || real|| desc
 
| 'r_sig'  || real|| desc
 
|-
 
|-
|  'rfile_entry'|| 'string' || nexus file entry_name for monochromatic sample background [default: '']
+
|  'tiny'|| real|| extreme low outliers [default: 1e-10]
 +
|-
 +
|  'huge'|| real|| extreme high outliers [default: 1e10]
 +
|-
 +
|  'rfile_entry'|| 'string' || nexus file entry_name for monochromatic sample background [default: ' ']
 
|-
 
|-
|  'rf_v1_entry'|| 'string' || nexus file entry_name for first whitebeam vanadium integral [default: '']
+
|  'rf_v1_entry'|| 'string' || nexus file entry_name for first whitebeam vanadium integral [default: ' ']
 
|-
 
|-
|  'rf_v2_entry'|| 'string || nexus file entry_name for second whitebeam vanadium integral [default: '']
+
|  'rf_v2_entry'|| 'string || nexus file entry_name for second whitebeam vanadium integral [default: ' ']
 
|-
 
|-
|  'hmask_entry'|| 'string || nexus file entry_name for hard mask [default: '']
+
|  'hmask_entry'|| 'string || nexus file entry_name for hard mask [default: ' ']
 
|-
 
|-
|  'bank_entry'|| 'string || nexus file entry_name for bank specification [default: '']
+
|  'bank_entry'|| 'string || nexus file entry_name for bank specification [default: ' ']
 
|-
 
|-
 
|  ||  ||  '''Keyword arguments for DIAG output'''
 
|  ||  ||  '''Keyword arguments for DIAG output'''
 
|-
 
|-
|  'out_nex'|| '{file}.nxs || nexus output mask filename specification ~[default: 'out.nxs']
+
|  'out_nex'|| '{file}.nxs || nexus output mask filename specification [default: 'out.nxs']
 
|-
 
|-
|  'out_nex_entry'|| 'string' || out nexus mask file entry_name  ~[default: '']
+
|  'out_nex_entry'|| 'string' || out nexus mask file entry_name  [default: ' ']
 
|-
 
|-
|  'out_asc'|| '{file}.msk' || ascii output mask filename specification ~[default: 'out.msk']
+
|  'out_asc'|| '{file}.msk' || ascii output mask filename specification [default: 'out.msk']
 
|-
 
|-
|  'summary'|| logical || flag stipulating text output summary of reasons for spectrum exclusion ~[default: true]
+
|  'summary'|| logical || flag stipulating text output summary of reasons for spectrum exclusion [default: true]
 
|-
 
|-
|  'messages'|| logical || flag stipulating text output of numerical values calculated for spectrum exclusion ~[default: false]
+
|  'messages'|| logical || flag stipulating text output of numerical values calculated for spectrum exclusion [default: false]
 
|}
 
|}

Latest revision as of 16:07, 30 January 2008

The main diagnostic tool for homer is the diagnose function (analogous to the VMS DIAG function). It creates an [IXTmask] object with optional file output (nexus or ascii) for a given monochromatic run, using the data from a white beam vanadium integral [IXTrunfile].

  • It also outputs a matlab structure 'cause' detailing information on which files contributed to the exclusion of which spectra and the reason for their exclusion, and if appropriate the value which failed the test applied.
  • For this function to run properly the matlab environment must be prepared by calling the instrument setup scripts.
  • diagnose will optionally load a hard mask file, an [IXTmask] object or file (nexus or ascii), that is a list of spectra that are to be masked regardless of any diagnostic operations.
  • Sometimes it is desirable to consider banks of spectra separately such as those connected to psd and non-psd detectors. If this is the case then an [IXTmap] object or file (nexus or ascii) may be supplied as an argument to the diagnose routine, defining these groups of spectra.
  • There are also arguments to which set certain limits and tolerances in the diagnostic process, all of which have default values. Some of these values bear relation to VMS DIAG input, in each case this has been defined below.


An simple example function call to DIAG might be as follows:

>> maps_bank=IXTmap({[1:17280],[17281:18432],[18433:32256],[32257:41472]});
>> monosam=read_nxs('monosam.nxs',IXTrunfile,'mono_sam');
>> [mask,cause]=diagnose(dso, run_no,run_no,'wbrf.nxs','rf_v1_entry','whitebeam','bank',maps_bank,'hardmask','4to1_022.msk','nomess');
Keyword arguments for DIAG input
Keyword Parameter Type Brief Description
'rf_v1' '{file}.nxs' or IXTrunfile white beam vanadium integral IXTrunfile, can be loaded from a nexus file or a matlab object, /V1 argument from VMS DIAG
'rf_v2' '{file}.nxs' or IXTrunfile second white beam vanadium integral IXTrunfile, can be loaded from a nexus file or a matlab object [default: empty object with false validity], /V2 argument from VMS DIAG
'bmin' real /BMIN argument from VMS DIAG
'bmax' real /BMAX argument from VMS DIAG
'hardmask' '{file}.msk', '{mask}.nxs' or IXTmask file (nexus or ascii) or IXTmask object defining the hard mask [default:empty object with false validity], /HARD argument from VMS DIAG
'bank' '{file}.map', '{map}.nxs' or IXTmap file (nexus or ascii) or IXTmap object defining the spectra banks of the instrument [default: empty object with false validity]
's_zero' real /ZERO_BKGD from VMS DIAG - will remove spectra with zero integrated signal in the range between bmin and bmax of the sample run[default: false]
's_out_lo' real low outlier limit for monochromatic sample background integral
's_out_hi' real high outlier limit for monochromatic sample background integral
'sv_lo' real desc
'sv_hi' real /FACTOR argument from VMS DIAG
'sv_sig' real desc
'v_zero' real - will remove spectra with zero integrated signal in the range between bmin and bmax of the vanadium runs[default: true]
'v_out_lo' real low outlier limit for vanadium integral
'v_out_hi' real high outlier limit for vanadium integral
'vv_lo' real /VLOW argument from VMS DIAG
'vv_hi' real /VHIGH argument from VMS DIAG
'vv_sig' real desc
'r' real /STABILITY argument from VMS DIAG
'r_sig' real desc
'tiny' real extreme low outliers [default: 1e-10]
'huge' real extreme high outliers [default: 1e10]
'rfile_entry' 'string' nexus file entry_name for monochromatic sample background [default: ' ']
'rf_v1_entry' 'string' nexus file entry_name for first whitebeam vanadium integral [default: ' ']
'rf_v2_entry' 'string nexus file entry_name for second whitebeam vanadium integral [default: ' ']
'hmask_entry' 'string nexus file entry_name for hard mask [default: ' ']
'bank_entry' 'string nexus file entry_name for bank specification [default: ' ']
Keyword arguments for DIAG output
'out_nex' '{file}.nxs nexus output mask filename specification [default: 'out.nxs']
'out_nex_entry' 'string' out nexus mask file entry_name [default: ' ']
'out_asc' '{file}.msk' ascii output mask filename specification [default: 'out.msk']
'summary' logical flag stipulating text output summary of reasons for spectrum exclusion [default: true]
'messages' logical flag stipulating text output of numerical values calculated for spectrum exclusion [default: false]