ILC - International Linear Collider

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

9ma:daq_page_v2 [2009/12/04 17:06]
9ma
9ma:daq_page_v2 [2009/12/04 17:18] (current)
9ma
Line 127: Line 127:
 Each entry in the data5 array is for an individual pulse. The time of each pulse is recorded in the 'time' channel appended to the channel list (see 'time' below). Each entry in the data5 array is for an individual pulse. The time of each pulse is recorded in the 'time' channel appended to the channel list (see 'time' below).
 A complete matlab routine that displays the fault words with the time stamps can be found here: {{9ma:sept_data:test_bis_channels.m.txt|test_bis_channels.m}}. A complete matlab routine that displays the fault words with the time stamps can be found here: {{9ma:sept_data:test_bis_channels.m.txt|test_bis_channels.m}}.
 +
 +==== Testing for Scalar vs Spectra ====
 +
 +It may be necessary to determine programmatically whether a channel is a scalar type or a spectra type. This can be done by examining the dimensions of the cell returned by daq_fetch_v2.  A spectra will have three dimensions (pulse #, sample #s, data dimensions). The following example code loops through all the channel data, finds channels that are scalars, and extracts the data from the scalar structure and stores it in the original array:
 +
 +  for i=1:numel(DAQ_labels)-1       % for each channel except the last (time)
 +    if numel(size(DAQ_data{i})) < 3 % if # of dimensions less than 3, then scalar 
 +      result1 = cell2mat(DAQ_data{i});  % extract structure
 +      DAQ_data{i} = [result1.data];     % replace original cell with data array
 +    end
 +  end
 +
  
 ==== 'time' ==== ==== 'time' ====
 
9ma/daq_page_v2.txt · Last modified: 2009/12/04 17:18 by 9ma
 
Recent changes RSS feed