function c1 = mk_config1(a)

%% c1 is a shipboard ADCP configuration_1 structure represented
%% as a double array.
%% a is a structure from read_os.

c1 = 1e38 * ones(23, 1);
ii = config1_ind;


c1(ii.num_bins)             = a.config.ncells;
c1(ii.bin_length)           = a.config.cell;
c1(ii.pls_length)           = a.config.pulse;
c1(ii.blank_length)         = a.config.blank;
c1(ii.tr_depth)             = a.config.tr_depth;
c1(ii.freq_transmit)        = a.config.sysconfig.frequency * 1000;


c1(ii.hd_offset)            = a.config.head_align;
c1(ii.heading_bias)         = a.config.head_bias;
if (isnan(a.bt.amp(1,1)))
   c1(ii.bot_track)          = 0;
else
   c1(ii.bot_track)          = 1;
end   
   
c1(ii.avg_interval)          = round(86400*median(diff(a.dday)));
%NOTE: probably need to decode this from config
c1(ii.compensation)         = 1;   
%NOTE: number of pings pre-averaged before DAS
c1(ii.pgs_ensemble)         = 1;   
% config1(ii.top_ref_bin) should be decoded from somewhere
% config1(ii.bot_ref_bin) should be decoded from somewhere

