AnalysisSystemForRadionucli.../msgparse.txt
2024-06-04 15:25:02 +08:00

88 lines
2.7 KiB
Plaintext

msgparse.m
% parse Pulse Height Data message
%% Values are returned according to descriptors; valid descriptors and the
%% returned values are:
%% Descriptor Value
%% 'Status' 1x1 double
%% Status of success
%% 'DataType' string
%% Message Data Type
%% 'Header' 1x4 cell array of strings
%% StationCode
%% DetectorCode
%% Geometry
%% Qualifier
%% SystemType
%% SRID
%% MID
%% 'Comment' string array
%% Comment
%% 'Collection' 1x3 double array
%% CollectionStartTimeNumber
%% CollectionStopTimeNumber
%% AirVolume
%% 'Sample' 1x2 double array
%% sample diameter
%% sample height or thickness
%% 'Acquisition'1x3 double array
%% acquisition start time (datenum)
%% acquisition real time
%% acquisition live time
%% 'Calibration' double
%% time of last calibration (datenum)
%% 'Energy' Mx3 double array
%% energy
%% channel centroid
%% error (channels)
%% 'Resolution' Kx3 double array
%% energy
%% calibration fwhm
%% error fwhm
%% 'Efficiency' Lx3 double array
%% energy
%% calibration efficiency (c/p)
%% error (c/p)
%% 'TotalEfficiency' Jx3 double array
%% energy
%% calibration total efficiency (c/p)
%% error (c/p)
%% 'Spectrum' spectrum, channels 1 to N
%% 'SpectrumOffset' 0: Spectrum started with channel 1
%% 1: Channel 0 was ignored
%% 'SpectrumLength' number of channels
%% 'Certificate' 1x2 cell
%% 1:assay date
%% 2:Nx9 cell matrix
%% 1: Nuclide
%% 2: HalfLife (days)
%% 3: Assay Activity
%% 4: Uncertainty
%% 5: gamma energy
%% 6: gamma intensity
%% 7: decay mode
%% 8: beta energy
%% 9: beta intensity
%% 'idMeas' Linssi:idMeas if found in Comment
-----------------------------------------------------------------------------------------------
% default values
Values = { ...
'NONE' % data type
{'NONE-','NONE','-','NONE','?', ''} % header
'' % comment
[0,0,0] % collection
[0,0] % sample
[0,0,0] % acquisition
0 % calibration
zeros([0,3]) % energy
zeros([0,3]) % resolution
zeros([0,3]) % efficiency
zeros([0,3]) % total eff
[] % spec
0 % spec length
1 % status
0 % spec offset (1 if channel 0 exists)
{NaN,cell(0, 9)} % certificate
0 }; % idMeas