disp('read_parameters_Stratus');
clear

%This routine reads the parameter file of the cruise.

%fnpar='e:\Wireless_test\AMMA07_process_progs\flux_eval_programs\flux_config_gomecc07.par';
fnpar='C:\Data\CRUISES\Stratus_2007\STRATUS07_flux_eval_progs_LB\flux_config_STRATUS07.par';
fnpar='C:\Data\cwf\matlabstf\cwf\vocals_prgs\flux_config_STRATUS07_cf.par';


flist=fopen(fnpar,'r');

para=[];
if flist>0
    while ~feof(flist)
        para=textscan(flist, '%s', 'commentStyle', '%');
    end;
else
    fprintf('unknown file: %s\n', fname);
end;

%################## Cruise informations  ##################################################################
cruise=para{1}{1};             % Cruise name  
year=para{1}{2};               % Year  
ship=para{1}{3};               % Research vessel  
%##################FLux files
way_raw_data_flux=para{1}{4};                                % Raw data path on ETLDAS 11 
way_proc_data_flux=para{1}{5};                              % Processed data path on ETLDAS 11 
way_spec_data_flux=para{1}{6};
way_images_flux=para{1}{7};
%  ceilo files
way_images_ceilo=para{1}{8};
way_raw_data_ceilo=para{1}{9};  % Raw Data 
way_proc_data_ceilo=para{1}{10}; % Processed Data
%  mwr files
way_images_mwr=para{1}{11};
way_raw_data_mwr=para{1}{12};  % Raw Data 
way_proc_data_mwr=para{1}{13}; % Processed Data

%  balloon files
way_images_balloon=para{1}{14};
way_raw_data_balloon=para{1}{15};  % Raw Data 
way_proc_data_balloon=para{1}{16}; % Processed Data

% backup directories
backup=para{1}{17};
way_backup_rawdata=para{1}{18};  % Raw Data back-up path on external hard disk
way_backup_procdata=para{1}{19}; % Processed Data back-up path on external hard disk


%################## Sonic configuration  ##################################################################
sonicmodel=para{1}{20};        %Sonic model
fsonic=str2double(para{1}{21});            %frequency (Hz)
rotationsonic=str2double(para{1}{22});     %rotated 30 deg = 1
outputsonic=str2double(para{1}{23}); 		%Sonic output. 0=speed of sound, 1=Temperature (degC)

%################## Licor configuration  ##################################################################
flicor=str2double(para{1}{24});            %frequency (Hz)
 
%################## Clear sky model configuration #########################################################
k1=str2double(para{1}{25});                %aerosol optical depth, band 1
k2=str2double(para{1}{26});                %aerosol optical depth, band 2
oz=str2double(para{1}{27});                %column ozone
iv=str2double(para{1}{28});                %column water vapor (cm)

%##################  Other parameters  ####################################################################
p=str2double(para{1}{29});                  %surface pressure (mb)
zus=str2double(para{1}{30});                %wind speed measurement height (m)
zts=str2double(para{1}{31});                %air T measurement height (m)
zqs=str2double(para{1}{32});                %air q measurement height (m)

%  profiler files 33 34 35
way_images_profiler=para{1}{33};
way_raw_data_profiler=para{1}{34};  % Raw Data 
way_proc_data_profiler=para{1}{35}; % Processed Data

%  aerosol files 36 37 38
way_images_aerosol=para{1}{36};
way_raw_data_aerosol=para{1}{37};  % Raw Data 
way_proc_data_aerosol=para{1}{38}; % Processed Data

disp('  ');
disp('%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%');
disp('%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%');
disp([cruise ' ' year ' ' ship]);

disp(['****** FLUX directories ********'])
disp(['Raw data path: ' way_raw_data_flux]);
disp(['Processed data path: ' way_proc_data_flux]); 
disp(['Spec data path: ' way_spec_data_flux]); 
disp(['Saved images path: ' way_images_flux]);
disp(['****** ceilo directories ********'])
disp(['Processed data path: ' way_proc_data_ceilo]); 
disp(['Raw data path: ' way_raw_data_ceilo]); 
disp(['Saved images path: ' way_images_ceilo]);
disp(['****** mwr directories ********'])
disp(['Processed data path: ' way_proc_data_mwr]); 
disp(['Raw data path: ' way_raw_data_mwr]); 
disp(['Saved images path: ' way_images_mwr]);
disp(['****** balloon directories ********'])
disp(['Processed data path: ' way_proc_data_balloon]); 
disp(['Raw data path: ' way_raw_data_balloon]); 
disp(['Saved images path: ' way_images_balloon]);
disp(['****** Profiler directories ********'])
disp(['Processed data path: ' way_proc_data_profiler]); 
disp(['Raw data path: ' way_raw_data_profiler]); 
disp(['Saved images path: ' way_images_profiler]);
disp(['****** aerosol directories ********'])
disp(['Processed data path: ' way_proc_data_aerosol]); 
disp(['Raw data path: ' way_raw_data_aerosol]); 
disp(['Saved images path: ' way_images_aerosol]);

disp(['****** Parameters ********'])
if backup=='1'
    disp('Backup on external disk selected. Current path:');
    disp(way_backup_rawdata);
    disp(way_backup_procdata);
else
    disp('No data backup on external disk selected');
end;

if rotationsonic==1
    t='yes';
else
    t='no';
end;
disp(['Sonic= ', sonicmodel, '  ,frequency= ', para{1}{21}, ' Hz  , 30degrees rotation= ', t]);
disp(['Licor frequency= ', para{1}{32}, ' Hz']);

disp('%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%');
disp('%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%');

