K>> helpApat_list % In this help, the global variables Apat_list_index and Apat_list are explained % % ----------------------------------------------------------------------------- % Apat_list_index is the global variable that provides the link between old % old fixed named PATs and the arbitrarily long list of new PATs; % Apat_list_index is an NSpec x 4 cell array of strings; each row holds names % for one spectrum; the columns are % COL STRING % 1 Name of Current PAT % 2 Name of Temporary PAT (overrides Current in getPATByName) % 3 Name of External PAT % 4 Name of Auxiliary PAT % The names may be empty strings, in which case the corresponding PAT doesn't % exist. % % ----------------------------------------------------------------------------- % Apat_list is the global variable holding all Peak Analysis Tables (PATs) % for all spectra that have currently been loaded into aatami's memory. % It is an NSpec x 1 cell array, where NSpec is the number of spectra loaded. % % Apat_list{sn, 1}, where sn is a spectrum running number, is a list of all % PATs that have been created for the snth spectrum. It is a NPAT x 7 % cell array, where Apat_list{sn, 1}{patnr, :} gives all information % related to PAT number patnr. These are in detail: % % Apat_list{sn, 1}{patnr, 1} PAT Name % Apat_list{sn, 1}{patnr, 2} PAT double data % Apat_list{sn, 1}{patnr, 3} PAT string flag data % Apat_list{sn, 1}{patnr, 4} PAT cell data % Apat_list{sn, 1}{patnr, 5} calibration names % Apat_list{sn, 1}{patnr, 6} Nuclide Reference Peak index % Apat_list{sn, 1}{patnr, 7} Nuclide Analysis Table (NAT) % Apat_list{sn, 1}{patnr, 8} Administrative Information % % 1) PAT NAME % name of the PAT; a string consisting of the data source and a running % number. % Possible data sources are 'Internal', 'IDC', 'Sampo', 'Automated' % % 2) PAT double data % an NPeaks x 45 double array containing numeric data for each peak. % the entry (pn, k) holds the k'th variable for the pnth peak in this pat. % The variables in detail are: % k Description Remark % 1 Centroid (r) % 2 Centroid Uncertainty (n) % 3 Energy (a) % 4 Energy Uncertainty (n) % 5 FWHM_Channels (r) % 6 FWHM_Energy (a) % 7 FWHM_Energy_Uncertainty (n) % 8 Step Ratio (a) % 9 Step Ratio Uncertainty (n) % 10 Tail (a) % 11 Tail Uncertainty (n) % 12 Net Area (r) % 13 Net Area Uncertainty (n) % 14 Meak Background Counts (b) % 15 Peak Search Sensitivity (at finding) (b) % 16 Significance (b) % 17 Significance error (n) % 18 Multiplet flag (a) % 19 Efficiency (a) % 20 Efficiency Error (n) % 21 Breit-Wigner gamma (s) % 22 Breit-Wigner gamma uncertainty (s) % 23 Emission rate (n) % 24 Emission rate uncertainty (n) % 25 Coincidence correction factor (s) % 26 Coincidence correction factor uncertainty(s) % 27 LineEnergy (s) % 28 LineEnergyUncertainty (s) % 29 Yield (s) % 30 Yield Error (s) % 31 Reference ID (s) % 32 obsolete: Reference Pointer (s) % 33 obsolete: Branching Ratio (s) % 34 Currie's LC (b) % 35 Currie's LD (b) % 36 Mean Signed Residual % 37 Mean Unsigned Residual % 38 Flag whether variables 36 and 37 are up to date % 39 Calculated Net Area of Summation peaks (s) % 40 Error of Summation peak area (s) % 41 Total Baseline Area (1+f)*BC (b) % 42 Error of Efficiency Ratio to Reference Peak (a) % 43 Tail Alpha (a) % 44 Upper Tail (a) % 45 Upper Tail Alpha (a) % 46 Neutron Lump Model Beta % 47 Neutron Lump Model Delta % % Remarks: % r) required, must contain reasonable values % a) may be NaN, in which case the "true" value is calculated % b) updated whenever the baseline changes % s) sometimes NaN, if not (yet) applicable % n) not available, always NaN for internal PATs, may change in future % % 3) PAT String flag data % Apat_list{sn, 1}{j, 3} is a NPeaks*30 string array with following entries % (pn, l), where pn is the peak number and l the index listed below % % l name values % 1 Source 'E' External % 'A' Artificial Peaks % 'B' Background Peaks % 'M' Mariscotti Peak Search % 'R' Residual Peak Search % 'I' Manually inserted % 'L' Library inserted % 'N' inserted by natural RN model % 'S' inserted by summation peak model % 'G' neutron-induced lumps in germanium % 2: 5 ? % 6: 7 'ct' % 8 Centroid Method 'Q' Quickfit % 'F' Full Fit % 'U' User Defined % 'E' External % 'T' Tied Multiplet fitting (relative energy) % 'M' Mariscotti Centroid % 'L' Library Energy (converted to centroid) % 'G' Special Library Energy (Neutron Lumps) % 9 Free '0' ct wasn't free in last fitting of this peak % '1' ct was free in last fitting of this peak % 10:11 'na' % 12 NetArea Method 'Q' Quickfit % 'F' Full Fit % 'U' User Defined % 'E' External % 'T' Tied Multiplet fitting % 'C' Calculated from reference lines % 'S' Summation above reliable baseline % 's' summation above quick-and-dirty baseline % 'G' fitting of neutron lump area % 13 NetArea Free '0' na wasn't free in last fitting of this peak % '1' na was free in last fitting of this peak % 14:15 'fw' % 16 FWHM Method 'Q' Quickfit % 'F' Full Fit % 'U' User Defined % 'E' External % 'C' Calibration value (converted to fwhm_ch) % 'G' Calibration value with add-on (lumps) % 17 FWHM Free (0|1) % 18:25 ? % 26 Spurious (S|.) marked spurious % 27 Reviewed (R|.) marked reviewed % 28 TailChanged (T|.) tail changed since last fitting % 29 ResChanged (R|.) resolution changed since last fitting % 29:30 ? % % 4) PAT cell data % Apat_list{sn, 1}{patNr, 4} is a NPeaks x 3 cell array for variable length % peak data; Apat_list{sn, 1}{patNr, 4}{pn, j} is the following: % j Field contents % 1 soft nuclide identification (nuclide contributes) % 2 hard nuclide identification (peak claimed to be explained) % % 5) calibration names % Apat_list{sn, 1}{patNr, 5} is a 5 x 1 cell string with following entries % 1 energy calibration name % 2 resolution calibration name % 3 efficiency calibration name % 4 tot_efficiency calibration name % 5 tail calibration name % 6 step calibration name % % each of these names is the key to the list of corresponding calibrations % for the respective spectrum (see helpAcal_para). If the string is empty, % no calibration is available. % % 6) Nuclide Reference Peak index % Apat_list{sn, 1}{patNr, 6} is a 1 x 1 structure having normalized nuclide % names as fields % Apat_list{sn, 1}{patNr, 6}.Nuc1.ReferenceID tells that peak with ReferenceID % is the reference Peak for this nuclide % Apat_list{sn, 1}{patNr, 6}.Nuc1.BranchingRatio gives the branching ratio % between reference nuclide and this nuclide. % Apat_list{sn, 1}{patNr, 6}.Nuc1.Exists tells whether reference peak exists % Apat_list{sn, 1}{patNr, 6}.Nuc1.IsMayor tells whether the reference comes % from the same nuclide (true) or not (false) % Apat_list{sn, 1}{patNr, 6}.Nuc1.HasOthers tells whether this nuclide is % reference to others in balance (true) or not (false) % % 7) Nuclide Analysis Table (NAT) % The nuclide analysis table contains Nuclide quantification data usually % mirroring PAT data. For external sources, however, PAT and NAT may not % be consistent. % NAT = Apat_list{sn, 1}{patNr, 6}; % NAT{1} - Nuclide Keyline Activities % NAT{2} - Nuclide Weighted Activities % NAT{3} - Isotope Ratios % NAT{4} - MDA/MDCs % NAT{5} - Activity/Concentration Reference Time Points % NAT{6} - Update-Flag % % NAT{1} - Nuclide Keyline activities % 2x1 cell array % NAT{1}{1, 1} % NNuc x 1 cell string % NAT{1}{1}{ln, 1} - Nuclide Name % NAT{1}{2, 1} % NNuc x 25 double array % NAT{1}{2}(ln, 1) - Keyline Energy % NAT{1}{2}(ln, 2) - Net Area % NAT{1}{2}(ln, 3) - Net Area Error (%) % NAT{1}{2}(ln, 4) - Coincidence Correction Factor % NAT{1}{2}(ln, 5) - CCF Error (%) % NAT{1}{2}(ln, 6) - Efficiency % NAT{1}{2}(ln, 7) - Efficiency Error (%) % NAT{1}{2}(ln, 8) - Yield % NAT{1}{2}(ln, 9) - Yield Error (%) % NAT{1}{2}(ln,10) - Effective Half Life (days) % NAT{1}{2}(ln,11) - Error of Effective Half Life (%) NEW % NAT{1}{2}(ln,12) - Decay Correction Factor to acquisition start % NAT{1}{2}(ln,13) - Decay Correction Factor to collection start (IDC) % NAT{1}{2}(ln,14) - Activity at acq-start % NAT{1}{2}(ln,15) - Activity Error (%) % NAT{1}{2}(ln,16) - Exp. activity in air at col-start % NAT{1}{2}(ln,17) - Exp. concentration in air at col-start % NEW % NAT{1}{2}(ln,18) - Raw Activity % NAT{1}{2}(ln,19) - Raw Activity Error (%) % NAT{1}{2}(ln,20) - Aquisition Correction % NAT{1}{2}(ln,21) - Aquisition Correction Error (%) % NAT{1}{2}(ln,22) - Wait(Decay) Correction % NAT{1}{2}(ln,23) - Wait(Decay) Correction Error (%) % NAT{1}{2}(ln,24) - Collection Correction (Model) % NAT{1}{2}(ln,25) - Collection Correction Error (%) % % NAT{2} - Nuclide Weighted Activities % 2x1 cell array % NAT{2}{1, 1} % NNuc x 1 cell string % NAT{2}{1}{ln, 1} - Nuclide Name % NAT{2}{2, 1} % NNuc x 16 double array % NAT{2}{2}(ln, 1) - Activity at acq-start % NAT{2}{2}(ln, 2) - Activity uncertainty (%) % NAT{2}{2}(ln, 3) - Activity in air at col-start % NAT{2}{2}(ln, 4) - concentration in air at col-start % NAT{2}{2}(ln, 5) - Number of lines used % NAT{2}{2}(ln, 6) - Variance of activity % NAT{2}{2}(ln, 7) - Effective Half life in days % NAT{2}{2}(ln, 8) - Error of Effective Halflife (%) %NEW % NAT{2}{2}(ln, 9) - Raw Activity % NAT{2}{2}(ln,10) - Raw Activity Error (%) % NAT{2}{2}(ln,11) - Aquisition Correction % NAT{2}{2}(ln,12) - Aquisition Correction Error (%) % NAT{2}{2}(ln,13) - Wait(Decay) Correction % NAT{2}{2}(ln,14) - Wait(Decay) Correction Error (%) % NAT{2}{2}(ln,15) - Collection Correction (Model) % NAT{2}{2}(ln,16) - Collection Correction Error (%) % % NAT{3} - Isotope Ratios % 2x1 cell array % NAT{3}{1, 1} % NRatios x 2 cell array % NAT{3}{1}{ln, 1} - Nuclide1 Name % NAT{3}{1}{ln, 2} - Nuclide2 Name % NAT{3}{2, 1} % NRatios x 30 double array % NAT{3}{2}(ln, 1) - Required Line Energy 1 (NaN: take key line) % NAT{3}{2}(ln, 2) - Required Line Energy 2 (NaN: take key line) % NAT{3}{2}(ln, 3) - Use NetArea Uncertainties (*) % NAT{3}{2}(ln, 4) - Use Efficiency Uncertainty (**) % NAT{3}{2}(ln, 5) - Use Yield Uncertainties (*) % NAT{3}{2}(ln, 6) - Use CCF Uncertainties (*) % NAT{3}{2}(ln, 7) - Line Energy 1 % NAT{3}{2}(ln, 8) - Line Energy 2 % NAT{3}{2}(ln, 9) - NetArea 1 % NAT{3}{2}(ln,10) - NetArea1 Uncertainty % NAT{3}{2}(ln,11) - NetArea 2 % NAT{3}{2}(ln,12) - NetArea2 Uncertainty % NAT{3}{2}(ln,13) - Efficiency1 % NAT{3}{2}(ln,14) - Efficiency1 Uncertainty % NAT{3}{2}(ln,15) - Efficiency2 % NAT{3}{2}(ln,16) - Efficiency2 Uncertainty % NAT{3}{2}(ln,17) - Yield1 % NAT{3}{2}(ln,18) - Yield1 Error (%) % NAT{3}{2}(ln,19) - Yield2 % NAT{3}{2}(ln,20) - Yield2 Error (%) % NAT{3}{2}(ln,21) - CCF1 % NAT{3}{2}(ln,22) - CCF1 Error (%) % NAT{3}{2}(ln,23) - CCF2 % NAT{3}{2}(ln,24) - CCF2 Error (%) % NAT{3}{2}(ln,25) - K_decay1 % NAT{3}{2}(ln,26) - K_decay2 % NAT{3}{2}(ln,27) - Halflife1 % NAT{3}{2}(ln,28) - Halflife2 % NAT{3}{2}(ln,29) - Activity Ratio (1/2) % NAT{3}{2}(ln,30) - Activity Ratio Uncertainty (%) % % (*) : NaN - never use; 0 - use if available % (**) : NaN - never use; 0 - use if available, >0 - use fixed value (%) % % NAT{4} - MDA/MDC results % NAT{4}{1}{ln, 1} - Nuclide Name % NAT{4}{2}(ln, 1) - Line Energy % NAT{4}{2}(ln, 2) - MDA % NAT{4}{2}(ln, 3) - MDC % % NAT{5} - Reference Time Points % NAT{5}(1, 1) - Sample Activity Reference Time Point for keyline activities % NAT{5}(2, 1) - Air Concentration Reference Time Point for keyline activities % NAT{5}(3, 1) - Sample Activity Reference Time Point for weighted activities % NAT{5}(4, 1) - Air Concentration Reference Time Point for weighted activities % NAT{5}(5, 1) - Sample Activity Reference Time Point for isotope ratios % NAT{5}(6, 1) - Air Concentration Reference Time Point for isotope ratios % NAT{5}(7, 1) - Unused % NAT{5}(8, 1) - Reference Time Point for MDA/MDC % NAT{5}(9, 1) - Requested Reporting Time Point (NaN: report as is) % % NAT{6} - Update-Flag % 0: NAT up to date % 1: update required % % 8) Administrative information % Apat_list{sn, 1}{j, 8}{1} - analysis type (Automated|Reviewed|Unknown) % Apat_list{sn, 1}{j, 8}{2} - organization performing analysis % Apat_list{sn, 1}{j, 8}{3} - analyst carrying out analysis % Apat_list{sn, 1}{j, 8}{4} - software used for analysis % Apat_list{sn, 1}{j, 8}{5} - software version string % Apat_list{sn, 1}{j, 8}{6} - analysis completion date, last change (datenum) -------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------------- function [patEntry] = emptyPAT(sn, flag) %% return empty PAT for spectrum sn %% @param sn spectrum number %% @param flag PAT type flag, 0: external, 1: internal %% @return patEntry empty PAT %% @see defaultPeakData % File: /ctbto/evaprojects/aatami/source/functions/SCCS/s.emptyPAT.m % $Revision: 1.1 $ $Date: 03/02/05 % WORK: get spectrum-specific vars % size of double, char and cell variables NPatVar = 55; NPatStr = 30; NPatCell = 3; nat_update = flag; name = ''; p = zeros(0, NPatVar); f = char(zeros(0, NPatStr)); c = cell(0, NPatCell);; dc = {'', '', '', '', '', '', '', '', ''}; nucidx = []; nat = { { cell(0, 1); zeros(0, 25) } % keyline activities { cell(0, 1); zeros(0, 16) } % weighted activities { cell(0, 2); zeros(0, 30) } % isotope ratios { cell(0, 1); zeros(0, 4) } % mda/mdc repmat(NaN, 9, 1) % reference times nat_update }; % update flag % if flag [analyst, mode] = getatvar('Analyst', 'AnalysisMode'); org = getSetup('Organization'); vers = aaVersionNumber; admin = {mode, org, analyst, 'aatami', vers, 0}; else admin = {'unknown', 'unknown', 'unknown', 'unknown', 'unknown', 0}; end patEntry = {name, p, f, c, dc, nucidx, nat, admin}; ------------------------------------------------------------------------------------------ % NUMERIC: 1 % Centroid directly read from data 2 % CentroidErr directly read from data, currently always NaN for internal PATs 3 % EnergyPAT energy value given in PAT, must be NaN for internal PATs 4 % Energy EnergyPAT for peaks where EnergyPAT is NaN; for other peaks % the value of energy calibration at Centroid is evaluated. 5 % EnergyErr directly read from data, currently always NaN for internal PATs 6 % LineEnergy library line energy of the nuclide with which the peak was % assoziated. 7 % LineEnergyErr Line energy error read from PAT 8 % FWHM_ChPAT PAT value of FWHM value in channels, must not be NaN for % internal PATs 9 % FWHM_Ch FWHM_ChPAT, where this is not NaN; where it is NaN, using % FWHM / dE 10 % FWHMPAT FWHM in energy range read directly from PAT. Always NaN for % internal 11 % FWHM FWHMPAT, where not NaN; where Nan, use dE*FWHM_Ch 12 % FWHMErr FWHM error estimate, read directly from PAT; currently always % NaN for internal PATs 13 % FWHMFitted FWHM, where FWHMIsFitted, NaN else 14 % BWWidthPAT Breit-Wigner width for x-rays, in keV, NaN for normal peaks 15 % BWWidth BWWidthPAT, but 0 where NaN 16 % BWWidthChan BWWidth in channel units 17 % StepRatioPAT Step Ratio (Step/NetArea) in PAT, may be NaN 18 % StepRatioErr Step Ratio error read from PAT, currently always NaN 19 % StepRatio StepRatioPAT, where not NaN, else using calibration 20 % Step NetArea * StepRatio 21 % StepErr NetArea * StepRatioErr 22 % ManualTail Tailing parameter read from PAT, may be NaN 23 % Tail ManualTail, where not NaN; where NaN, tail calibration value % of energy; 24 % TailErr Tail uncertainty read from PAT, currently always NaN for % internal PATs 25 % TailAlpha Calibration Alpha value for lower tail 26 % UpperTail Calibration Tail Parameter for upper tails 27 % UpperTailAlpha Calibration Tail Alpha for upper tails 28 % NetArea Net area value read from PAT 29 % NetAreaFree flag if net area should be free (has not been calculated) 30 % AreaErrorPAT net area error read from PAT, currently always NaN for internal % PATs 31 % AreaError AreaErrorPAT, where not NaN; where NaN, calculated from % NetArea and Baseline area 32 % AreaErrorP 100*AreaError/NetArea 33 % NetAreaCalculated net area calculated from reference peaks (counts) 34 % NetAreaCalcError error of calculated net area (%) 35 % NACalcMin Calculated Net area, but reference net area substituted by % LC for too small peaks (or 1 if LC < 1) 36 % NetAreaCalcUTest u-test for calculated versus current net area (only % reasonable for peaks fitted independently of reference peak). 37 % SumPeakArea calculated area of summation peak (counts) 38 % SumPeakAreaErr error of summation peak area (counts) 39 % PeakShare (SumPeakArea or NetAreaCal) / NetArea 40 % Activity Nuclide activity, decay corrected to acquisition start (assuming % no feeding in 41 % EmissionRatePAT emission rate, read from PATcurrently always NaN 42 % EmissionRate currently EmissionRatePAT 43 % EmissionRateErr emission rate error, read from PAT 44 % CCFPAT coincidence correction factor read from PAT, % currently always NaN 45 % CCF CCFPAT, if that is not NaN, 1 otherwise 46 % CCFErr Error of CCF in % of CCF, if NaN in PAT, then 10*abs(1-CCF) 47 % MeanBackCount mean background count read from PAT; for internal PATs updated % whenever baseline changes 48 % Sensitivity Peak Search sensitivity at finding, read from PAT; may be NaN 49 % Significance Significance value read from PAT; for internal PATs updated % whenever baseline changes 50 % SignificanceErr significance uncertainty read from PAT, currently NaN for % internal PATs 51 % LC Currie's minimum NetArea for accepting peak 52 % LD Currie's NetArea that should lead to reliable detection 53 % SignedResidual Mean signed residual (patBaseVar) 54 % UnsignedResidual Mean unsigned residual (patBaseVar) 55 % MultipletPAT multiplet flag (0|1) read from PAT, must be NaN for internal PATs 56 % Multiplet MultipletPAT, where not NaN; where NaN, calculated from % Centroid, NetArea and FWHM_Ch 57 % dE Energy Slope calculated from Centroid using Energy Calibration; % if no energy calibration for that PAT, use current calibration; % if no current calibration, return NaN 58 % EfficiencyPAT efficiency value read from PAT; always NaN for internal PATs 59 % Efficiency EfficiencyPAT, where not NaN; where NaN, calculated from % efficiency calibration of Energy 60 % EfficiencyErr efficiency uncertainty read from PAT; currently always NaN for % internal PATs 61 % RefEfficiencyErr uncertainty of the efficiency ratio between the peak % and it's reference peak. If the value in PAT is NaN, the % uncertainties of the efficiencies will be propagated. 62 % LineDeviation LineEnergy - Energy 63 % Res Resolution calibration value at Energy 64 % Res_Ch Res/dE 65 % FWHMIsFitted boolean whether FWHM comes from aatami fitting, calculated from % FitFlags 66 % Index peak numbers 67 % CountsPerSecond NetArea/LiveTime 68 % appERate apparent Emmision Rate CountsPerSecond/Efficiency 69 % Yield Library Line Yield (1 for 100%) 70 % YieldErr Library Line Yield Uncertainty 71 % HalfLife Nuclide half life (days) 72 % EffectiveHalflife effective nuclide half life (days). For nuclides that are % in an equilibrium-decay-chain, this is the halflife of the % mother feeding the chain 73 % ReferenceID Unique ID numbers for reference peaks, NaN otherwise (in PAT) 74 % RefPointer Pointer to reference peak ID of nuclide assoziated with the % peak, calculated from NuclideIntenal and nuclide Structure 75 % ReferencePN Peak Number of reference peak, if peak has reference peak, % NaN otherwise 76 % PeakIdentified currently flag whether peak bears valid hard identification 77 % BranchingRatio Branching Ratio between peak and its reference (equilibrium) % % Fixed length strings; character array NPeak * l % Name l description 1 % Source 1 source flag read from PAT 2 % FitFlags 12 fitting flags in format 'ct**na**wt**' read from PAT 3 % Spurious 1 Spurious flag read from PAT 4 % Reviewed 1 Reviewed flag read from PAT 5 % TailChanged 1 Tail changed flag, read from PAT 6 % ResChanged 1 Resolution calibration changed flag, read from PAT 7 % TailFlag 1 Flag if ManualTail is NaN or finite 8 % MultipletStr 1 Flag if Multiplet is 0 or 1 ('.' or 'M') 9 % SignificanceFlag 1 flag according to Significance 10 % NetAreaFlag 1 where net area comes from % % Variable lengths strings (cell vector) 1 % NuclideSoft Soft identification from PAT 2 % NuclideHard Hard identification from PAT 3 % NuclideInternal normalized name of nuclide 4 % Nuclide NuclideHard, probably followed by NuclideSoft 5 % HalfLifeStr Nuclide half life as string, with time unit 6 % EffectiveHalflifeStr Effective nuclide half life as string, including unit