Diagnose

From LIBISIS
Revision as of 15:36, 30 January 2008 by Dickon Champion (talk | contribs)
Jump to navigation Jump to search

The main diagnostic tool for homer is the DIAG function. DIAG 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 spec or homer. 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.

DIAG 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 DIAG routine, defining these groups of spectra.

There are also arguments to DIAG which set certain limits and tolerances in the diagnostic process of DIAG, 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(monosam,'rf_v1','wbrf.nxs','rf_v1_entry','whitebeam','bank',maps_bank,'hmask','4to1_022.msk','nomess');
Keyword arguments for DIAG input
Keyword Parameter Type 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_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]
'tiny' real desc
'huge' real desc
's_zero' real /ZERO_BKGD from VMS DIAG
'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 desc
'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
'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]