function eco_process7(days) % ECO_PROCESS7 uses IAG's GetOriginalDataServlet to extract the raw data via the web. % The data are then averaged and calibrations are applied. % Quick look QC plots are created. % A log file of the results is written to the CIMT directory. % Process both ECO devices and creates a two panel figure of fluorescence % and backscatter % 01 June 2004 rpm %------------------------------------------------------------------------- % Requires: % readProperties.m % getProperty.m % urlread.m % extract_ecodata.m % avg_ecodata.m % ecofl_calibrate.m % plot_ecofl.m %------------------------------------------------------------------------- % :::::::::::::::::::::::::::::: Begin Processing ::::::::::::::::::::::::::::::::::::::::::: close all; try, % **Process the ECOFL Fluorometer newpath=MBARI_path('/hosts/tornado/vol/vol0/ssdsdata/ecocimt/src'); cd(newpath); cdir = ['../configuration/ecofl2.properties']; prop = readProperties(cdir); otype='plot'; p=getprops(prop,otype); %days=7; % Write to log file fid=fopen([p.ldir,'/',p.log],'at+'); fprintf(fid,'%s\n',['ECO ',p.ecotype,' device number: ', p.dev, ', serial number ', p.serial]); fprintf(fid,'%s\n',[' 1. ECO_PROCESS7: ' datestr(now), ' days=',num2str(days)]); fclose(fid); % **Process the ECOFL Fluorometer % Get data from IAG's API [ecofl_out_array2,dev_num]=extract_ecodata(p,days); % average the records ecofl_out_array=avg_ecodata(ecofl_out_array2,p); % calibrate the fluorometer data ecofl_output_array=calibrate_ecofl(ecofl_out_array,p,prop); devfl=dev_num; %catch, %try, % **Process the ECOBB Scattering Meter cdir=['../configuration/ecobb.properties']; prop = readProperties(cdir); otype='plot'; p=getprops(prop,otype); % Write to log file fid=fopen([p.ldir,'/',p.log],'at+'); fprintf(fid,'%s\n',['ECO ', p.ecotype,' device number: ', p.dev, ', serial number ', p.serial]); fprintf(fid,'%s\n',[' 1. ECO_PROCESS: ' datestr(now), ' days=',num2str(days)]); fclose(fid); % Get data from IAG's API [ecobb_out_array2,dev_num]=extract_ecodata(p,days); % dev_num is device number of ECOBB assigned by SSDS % average the records ecobb_out_array=avg_ecodata(ecobb_out_array2,p); % calibrate the backscatterometer data ecobb_output_array=ecobb_calibrate(ecobb_out_array,p,prop); % write to output file and plot values plot_eco(ecofl_output_array,ecobb_output_array,dev_num,devfl,p,days); %exit; % :::::::::::::::::::::::::::::::: End Processing ::::::::::::::::::::::::::::::::::::::::: catch, % Something went wrong, capture error message and write to log file [LASTMSG, LASTID] = lasterr; disp(['** PROCESSING HALTED** Error: ',LASTMSG]); disp([' Last ID: ', LASTID]); fid=fopen([p.ldir,'/',p.log],'at+'); fprintf(fid,'%s\n',['ECO PROCESS7']); fprintf(fid,'%s\n',[' **PROCESSING HALTED** Error: ', LASTMSG ]); fprintf(fid,'%s\n',[' Last ID: ', LASTID ]); fprintf(fid,'%s\n',':::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::'); fprintf(fid,'\n'); fclose(fid); %exit; end end