% metaSGExample - an example script for processing Seaguage data % Written by Marinna Martini for the U.S. Geological Survey % Coastal & Marine Program Woods Hole Field Center, Woods Hole, MA % http://woodshole.er.usgs.gov/ Please report bugs to mmartini@usgs.gov % ------------- Step I what are the file names? % processing file for 8183sg.wb and 8183sg.tid wbFile = '8183sg.wb'; % set to [] if there is no wb file (Wave Burst) tidFile = '8183sg.tid'; % set to [] if there is no tid file (Tide) wasFile = '818sgWave.was'; % set to [] if there is no was file (Wave Burst Autospectrum Statistics Data) wtsFile = '818sgWave.wts'; % set to [] if there is no was file (Surface Wave Time Series Statistics Data) outFileRoot = '8183sg'; % the name for the output files % ------------- Step II what is the metadata? % % here is the metadata structure for this deployment % if you use an empty char string denoted by '' metadata.mooring_number = '8183'; %four digit NNNL, NNN mooring + L logger metadata.deployment_start = '09-apr-2006 20:41:00'; % on bottom time metadata.deployment_end = '21-jun-2006 11:50:31'; % the out of water time metadata.lon = -73.6888; % decimal degrees, West = negative metadata.lat = 40.1615; % decimal degrees, South = negative % 14� 58' W changing by 0� 3' E/year from % http://www.ngdc.noaa.gov/seg/geomag/jsp/Declination.jsp metadata.declination = -13.22; % degrees west is negative metadata.water_depth = 64; % m or 109.6 ft (DO NOT OMIT!) metadata.press.serial = '1099'; % serial number of the SeaGuage metadata.press.height = 0.51; % height of pressure port above bottom, m metadata.press.sensor_type = 'Paros'; % can be Paros, Druck | Strain Guage % salinity data will not be written if metadata is not provided metadata.cond.serial = ''; % serial number of the SBE04 cell metadata.cond.height = 0; % height of cond cell above bottom, m % now record the settings used in the wave burst processing data setup metadata.SeasoftWaves.temperature = 7.03; % average water temperature above the pressure sensor, C metadata.SeasoftWaves.salinity = 32.73; % average salinity above the pressure sensor, PSU metadata.SeasoftWaves.estimates = 5; % number of spectral estimates metadata.SeasoftWaves.min_attenuation = 0.0025; % minimum attenuation metadata.SeasoftWaves.min_period = 0; % minimum period in autospectrum, s metadata.SeasoftWaves.max_period = 1E6; % maximum period in autospectrum, s metadata.SeasoftWaves.Hanning_cutoff = 0.1; % Hannin window cutoff % SBE37's record data in real units and do not need applied cals metadata.metafile = mfilename('fullpath'); metadata.metafile_date = datestr(now); metadata.metafile_version = '0.0'; metadata.metafile_author = 'MM'; % if the following fields are missing, UNKOWN will be used metadata.origin = 'USGS/WHFC'; % with collaborator's data, could be USC, etc. metadata.experiment = 'NY Bight'; metadata.project = 'NY Bight'; % might also use OFA funding agency, such as MWRA, EPA, WCMG metadata.comment = ''; metadata.description = 'Site F wave and tide guage'; % these programs take a long time to run, so keep a diary diary(sprintf('run%s',datestr(now,30))) %sg2nc(wbFile, tidFile, wasFile, wtsFile, outFileRoot, metadata) sg2nc(wbFile, tidFile, wasFile, wtsFile, outFileRoot, metadata) diary off