Difference between revisions of "Diagnose"

From LIBISIS
Jump to navigation Jump to search
 
 
(13 intermediate revisions by the same user not shown)
Line 1: Line 1:
[Diagnostic tools for homer]
+
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].
  
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.
+
*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.
  
<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.
 
 
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:
 
<pre>
 
<pre>
>> 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>
  
<?plugin OldStyleTable caption="Keyword arguments for DIAG input" border||=2
+
{| border ="1" cellpadding="2"
|<  *Keyword*  |^ *Parameter Type* |^ *Brief Description*
+
|+ '''Keyword arguments for DIAG input'''
|< 'rfile'  |^ '{file}.nxs' or [IXTrunfile] |< monochromatic sample background integral [IXTrunfile], can be loaded from a nexus file or a matlab object
+
!width="10%"|Keyword
|< '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
+
!width="20%"|Parameter Type  
|< '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
+
!width="70%"|Brief Description
|< '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
+
|-
|< '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
+
|  '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
|< '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'|^ numeric |<
+
| '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
|< 'huge'|^ numeric |<
+
|-
|<  's_zero'|^ logical |< /ZERO_BKGD from VMS DIAG
+
| 'bmin'|| real || /BMIN argument from VMS DIAG
|< 's_out_lo'|^ numeric |< low outlier limit for monochromatic sample background integral
+
|-
|< 's_out_hi'|^ numeric|< high outlier limit for monochromatic sample background integral
+
| 'bmax'|| real || /BMAX argument from VMS DIAG
|< 'sv_lo' |^ numeric |< desc
+
|-
|< 'sv_hi'|^ numeric |< /FACTOR 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
|< 'sv_sig'  |^ numeric |< desc
+
|-
|< 'v_zero'|^ logical |< desc
+
| '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]
|< 'v_out_lo'|^ numeric |< low outlier limit for vanadium integral
+
|-
|< 'v_out_hi'|^ numeric|< high outlier limit for vanadium integral
+
|  '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]
|< 'vv_lo' |^ numeric |< /VLOW argument from VMS DIAG
+
|-
|< 'vv_hi'|^ numeric |< /VHIGH argument from VMS DIAG
+
| 's_out_lo'|| real|| low outlier limit for monochromatic sample background integral
|< 'vv_sig'  |^ numeric |< desc
+
|-
|< 'r'|^ numeric |< /STABILITY argument from VMS DIAG
+
| 's_out_hi'|| real|| high outlier limit for monochromatic sample background integral
|< 'r_sig'  |^ numeric |< desc
+
|-
|< 'rfile_entry'|^ 'string' |< nexus file entry_name for monochromatic sample background ~[default: '']
+
| 'sv_lo' || real|| desc
|< '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: '']
+
| 'sv_hi'|| real|| /FACTOR argument from VMS DIAG
|< 'hmask_entry'|^ 'string |< nexus file entry_name for hard mask ~[default: '']
+
|-
|< 'bank_entry'|^ 'string |< nexus file entry_name for bank specification~[default: '']
+
| '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]
<?plugin OldStyleTable caption="Keyword arguments for DIAG output" border||=2
+
|-
|< 'out_nex'|^ '{file}.nxs |< nexus output mask filename specification ~[default: 'out.nxs']
+
| 'v_out_lo'|| real|| low outlier limit for vanadium integral
|< 'out_nex_entry'|^ 'string' |< out nexus mask file entry_name  ~[default: '']
+
|-
|< 'out_asc'|^ '{file}.msk' |< ascii output mask filename specification ~[default: 'out.msk']
+
| 'v_out_hi'|| real|| high outlier limit for vanadium integral
|< '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]
+
| '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]
 +
|}

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]