Diagnose

From LIBISIS
Jump to: navigation, search

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]