close all;clear all;ecotype='ecofl'; % ECOFL_PROCESS 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. % 28 May 2004 rpm %------------------------------------------------------------------------- % Requires: % readProperties.m % getProperty.m % urlread.m % extract_ecodata.m % avg_ecodata.m % ecofl_calibrate.m % plot_ecofl.m %------------------------------------------------------------------------- % :::::::::::::::::::::::::::::: Begin Processing ::::::::::::::::::::::::::::::::::::::::::: try, % Get properties cdir = ['//tornado/ssdsdata/ecocimt/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_PROCESS: ' 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); % write to output file and plot values plot_ecofl(output_array,dev_num,cdir); % :::::::::::::::::::::::::::::::: 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',['ECOFL device number: ', p.dev, ', serial number ', p.serial]); fprintf(fid,'%s\n',[' **PROCESSING HALTED** Error: ', LASTMSG ]); fprintf(fid,'%s\n',[' Last ID: ', LASTID ]); fprintf(fid,'%s\n',':::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::'); fprintf(fid,'\n'); fclose(fid); end