% scriptexample - example file for running the ABSS toolbox in automated mode %%% START USGS BOILERPLATE -------------% % Use of this program is described in: % % Acoustic Doppler Current Profiler Data Processing System Manual % Jessica M. Côté, Frances A. Hotchkiss, Marinna Martini, Charles R. Denham % Revisions by: Andrée L. Ramsey, Stephen Ruane % U.S. Geological Survey Open File Report 00-458 % Check for later versions of this Open-File, it is a living document. % % Program written in Matlab v7.1.0 SP3 % Program updated in Matlab 7.2.0.232 (R2006a) % Program ran on PC with Windows XP Professional OS. % % "Although this program has been used by the USGS, no warranty, % expressed or implied, is made by the USGS or the United States % Government as to the accuracy and functioning of the program % and related program material nor shall the fact of distribution % constitute any such warranty, and no responsibility is assumed % by the USGS in connection therewith." % %%% END USGS BOILERPLATE -------------- clear % a good idea % --------- set up the information needed by the programs % %% there are two ways to input metadata for the experiment and site. % capitalized items are required by EPIC conventions % using read_globalatts from the USGS meta_tools toolbox % filename must contain a list of Global attributes gatt=read_globalatts('..\global_atts.txt'); % provides values to insert below % syntax and capitalization counts! % the following are required! settings.MOORING = gatt.MOORING; %four digit NNNL, NNN mooring + L logger settings.Deployment_date = gatt.Deployment_date; % the in water time settings.Recovery_date = gatt.Recovery_date; % the out of water time settings.longitude = gatt.longitude; % decimal degrees, West = negative settings.latitude = gatt.latitude; % decimal degrees, South = negative settings.magnetic_variation = gatt.magnetic_variation; % degrees west is negative settings.WATER_DEPTH = gatt.WATER_DEPTH; % m (DO NOT OMIT!) settings.WATER_DEPTH_NOTE = gatt.WATER_DEPTH_NOTE; % if the following fields are missing, UNKOWN will be used settings.DATA_ORIGIN = gatt.DATA_ORIGIN; % with collaborator's data, could be USC, etc. settings.EXPERIMENT = gatt.EXPERIMENT; settings.DESCRIPTION = gatt.DESCRIPTION; settings.PROJECT = gatt.PROJECT; % might also use OFA funding agency, such as MWRA, EPA, WCMG settings.Data_Cmnt = gatt.Data_Cmnt; settings.SciPi = gatt.SciPi; settings.DATA_ORIGIN = gatt.DATA_ORIGIN; % or - input it all by hand % settings.MOORING = 9991; %four digit NNNL, NNN mooring + L logger % settings.Deployment_date = '09-feb-05 17:00:00'; % the in water time % settings.Recovery_date = '18-may-2005 13:02 '; % the out of water time % settings.longitude = -70.7809; % decimal degrees, West = negative % settings.latitude = 42.3786; % decimal degrees, South = negative % settings.magnetic_variation = -15.5; % degrees west is negative % settings.WATER_DEPTH = 32; % m (DO NOT OMIT!) % settings.WATER_DEPTH_NOTE = 'taken from ship depth sounder on deployment'; % % if the following fields are missing, UNKOWN will be used % settings.DATA_ORIGIN = 'USGS'; % with collaborator's data, could be USC, etc. % settings.EXPERIMENT = '2007-2008 PV BBL Experiment'; % settings.DESCRIPTION = 'Currents, temp profiles, bottom stress, SSC, sed. traps, and PCB samplers'; % settings.PROJECT = 'USGS/EPA Palos Verdes'; % might also use OFA funding agency, such as MWRA, EPA, WCMG % settings.Data_Cmnt = 'geoprobe tripod at site B3'; % settings.SciPi = 'C. Sherwood, M. Noble, J. Xu, K. Rosenberger'; % settings.DATA_ORIGIN = 'USGS WHSC and PSC Sed. Trans. Groups'; %% ABSS information settings.ABSSmodel = 'Aquascat1000'; % it is recommended that a test run be done on a small subset of .aqa files % in a separate directory, then run both operations on the entire data set settings.input_directory = 'D:\PalosVerdes\8445ABSS\testfiles'; % where the .aqa files are %settings.input_directory = 'D:\PalosVerdes\8445ABSS\datafiles'; % where the .aqa files are settings.output_directory = 'D:\PalosVerdes\8445ABSS'; % where the .cdf file will go settings.outFileRoot = '8427abss'; settings.metaFileName = [settings.outFileRoot 'Meta.mat']; settings.sensor_height = [0.99 0.99 0.99]; % height of each probe %% --------------------- run the programs % % turn each step "on" and "off" by setting "if 0" to "if 1" % steps must be run in sequence diary(sprintf('run%s',datestr(now, 30))) if 0, % translate to .mat using the Aquatec toolbox and get % metadata directly from the raw binary files settings = aqa2mat(settings, 1); end if 0, settings = aqamat2cdfbychan(settings); end if 0, % trimming average *and* burst bins2keep = {[9 156]; [4 156]; [2 163]}; for ixducer = 1:3, oldDataFile = sprintf('%s%ds.cdf',settings.outFileRoot,ixducer); trimFile = sprintf('%s%dsT.cdf',settings.outFileRoot,ixducer); trimprofile(oldDataFile, bins2keep{ixducer}, trimFile); d = dir(sprintf('%s%d_*b.cdf',settings.outFileRoot,ixducer)); for ifile = 1:length(d), [thePath theName theExt] = fileparts(d(ifile).name); trimFile = fullfile(thePath, [theName 'T' theExt]); trimprofile(d(ifile).name, bins2keep{ixducer}, trimFile); end end end diary off