Steps for Processing AON 2012 BS3 ADCP Mooring Data =================================================== 1/15/2015 The data being processed here is from AON 2012 mooring BS3. Microcat was used for ADCP depth since they were deployed at the same depth. read_bs3a.m ============ read_bs3a.m - Each station has a specific read program. Here editting criteria, start times, positions, file names, etc were all set. The following editting criteria were applied to all stations: Input: BS03A000.000 - Raw binary ADCP data. Output: aon12_bs3a_step1_raw.mat - Mat file of semi-processed ADCP data. p.pglim = 30 % - Minimum percent good threshold. p.elim = 0.08 m/s - Maximum error velocity. Magnetic variation correction was applied for each ensemble. Data exceeding the thresholds above were set to NaN. Velocity data were rotated to True North by adding magnetic variation angle to direction and converted to U and V components. The read_gam1.m program sets these parameters and converts raw binary ADCP data and into mat files. The saved mat files have the following format: >> whos Name Size Bytes Class Attributes d 1x1 32677056 struct f 1x1 948 struct p 1x1 3416 struct >> d d = mag: [8813x1 double] % Magnetic variation at each time fl: [18 60 5 2 7.2200 5.0200 51.4000 300 1 1.0900e+10] % fixed leader data vl: [8813x25 double] % variable leader data vel: [8813x18x4 double] % velocity data corr: [8813x18x4 double] % correlation data echo: [8813x18x4 double] % echo amplitude data pg: [8813x18x4 double] % percent good data Fixed Leader data: fl(1): number of depth cells fl(2): pings/ensemble fl(3): depth cell length (m) fl(4): blank after transmit (m) fl(5): bin 1 dist (m) fl(6): transmit pulse length (m) fl(7): firmware version fl(8): ADCP frequency (kHz) fl(9): ADCP start orientation (0=down,1=up) fl(10): ADCP unique cpu ID >> f f = adcp: 'BS03A000.000' cid: 'aon12' mc: 'aon12_2012_35m_mc2137.mat' res: 'bs3a' >> p p = sn: 1393 adcp_station: 'bs3a' freq: 300 name: 'bs3a' time_start: [2012 10 14 20 0 0] time_end: [2013 10 17 0 0 0] timoff: 0 drift: 0 poss: [71 23.6450 -152 -2.9080] magFLAG: 6 drot: 0 pglim: 30 elim: 0.0800 uvlim: 99 use_pg3: 0 firm_vers: 51.4000 cpu_sn: '10900419009' orient_start: 'up' PROCESS_ADCP.M ============== process_adcp.m - Further process ADCP data. Input: aon12_bs3a_step1_raw.mat Output: aon12_bs3a_pro1.mat The following actions were performed with process_adcp.m. % - Read ADCP mat file from loadrdi_sbi.m. % - Calculate speed of sound at transducer and apply velocity correction. % - Create depth array (from ULS). % - Set velocities above surface (or cos of beam angle) to NaN. ADCP clock was checked for clock drift. Microcat s/n 2137 was used to determine ADCP transducer depth. All bin depths were determined relative to transducer depth. Speed of sound was determined from Microcat temperature and salinity. A depth array was calculated using the corrected transducer depth. The array was calculated for all bins. Depth refers to + meters below the surface. Each depth corresponds to the center of each bin. Since each ADCP was set up to collect data beyond the surface, negative values are out of the water and used as a criteria to set the velocity data out of the water = NaN. Also, due to side lobe interference, additional data proportional to the cosine of the beam angle was also editted (set to NaN) using the following formula: cos20=(BS/2)+(tr_depth-(tr_depth.*cos(BA)) where BS = binsize BA = beam angle Approximately 8% of the water column velocity data was lost to side lobe interference. The output mat file structures are slightly different than the previous output from loadrdi_sbi.m. The format for each field is as follows: Fixed leader data ----------------- d.fl(1) - % number of depth cells d.fl(2) - % pings per ensemble d.fl(3) - % depth cell length (m) d.fl(4) - % blank after transmit (m) d.fl(5) - % distance to the middle of the first depth cell (m) d.fl(6) - % transmit pulse length (m) d.fl(7) - % firmware version d.fl(8) - % ADCP frequency (kHz) d.fl(9) - % ADCP start orientation (0=down,1=up) d.fl(10)- % ADCP unique cpu ID Variable leader data -------------------- d.vl(:,1) - % true time (Julian days) d.vl(:,2) - % pitch d.vl(:,3) - % roll d.vl(:,4) - % heading d.vl(:,5) - % ADCP temperature (deg C) d.vl(:,6) - % Microcat calibrated salinity (psu) d.vl(:,7) - % Corrected sound velocity (m/s) d.vl(:,8) - % transmit current d.vl(:,9) - % ADCP pressure (dbar)* d.vl(:,10) - % Year Day (for plotting) d.vl(:,11) - % Date [yr] (Start of sample) d.vl(:,12) - % Date [mo] (Start of sample) d.vl(:,13) - % Date [da] (Start of sample) d.vl(:,14) - % Date [hr] (Start of sample) d.vl(:,15) - % Date [mn] (Start of sample) d.vl(:,16) - % Date [sc] (Start of sample) d.vl(:,17) - % Corrected transducer depth (m) d.vl(:,18) - % ADCP Orientation (0=down,1=up) d.vl(:,19) - % Microcat Temperature (deg C) d.vl(:,20) - % Microcat Conductivity Velocity data ------------- d.vel(:,:,1) - % Corrected U component velocity (m/s) d.vel(:,:,2) - % Corrected V component velocity (m/s) d.vel(:,:,3) - % Corrected W component velocity (m/s) d.vel(:,:,4) - % Error velocity (m/s) Correlation data ---------------- d.corr(:,:,1) - % Beam 1 correlation d.corr(:,:,2) - % Beam 2 correlation d.corr(:,:,3) - % Beam 3 correlation d.corr(:,:,4) - % Beam 4 correlation d.mn_co(:,:) - % Mean correlation of all 4 beams Echo amplitude data ------------------- d.echo(:,:,1) - % Beam 1 echo amplitude d.echo(:,:,2) - % Beam 2 echo amplitude d.echo(:,:,3) - % Beam 3 echo amplitude d.echo(:,:,4) - % Beam 4 echo amplitude d.mn_ea(:,:) - % Mean echo amplitude of all 4 beams Percent good data ----------------- d.pg(:,:,1) - % Percent good 3-beam solutions d.pg(:,:,2) - % Percent transformations rejected d.pg(:,:,3) - % Percent more than one beam bad d.pg(:,:,4) - % Percent good 4-beam solutions Target Strength data -------------------- d.ts(:,:,1) - % Beam 1 Target strength d.ts(:,:,2) - % Beam 2 Target strength d.ts(:,:,3) - % Beam 3 Target strength d.ts(:,:,4) - % Beam 4 Target strength d.mn_ts(:,:) - % Mean target strength of all 4 beams Depth data ---------- d.depth(:,30) - % Absolute Depth of center of each bin. Bottom track data (if present) ----------------- d.bt(:,1:4) - % Beam 1-4 BT range d.bt(:,5) - % East component of bottom velocity d.bt(:,6) - % North component of bottom velocity d.bt(:,7) - % Upward component of bottom velocity d.bt(:,8) - % Error component of bottom velocity d.bt(:,9:12) - % Beam 1-4 BT correlation d.bt(:,13:16) - % Beam 1-4 BT correlation PLOTTING PACKAGE ================ A series of plotting programs are provided. These were initially written years ago for a different format. Therefor you must first run a conversion program to change the format into something the plotting programs could understand. t_polyedit8.m ------------- Program for hand editing ADCP velocity data. Uses code adapted from CODAS editing programs (Bahr). Bins near the surface often have higher error velocities. In order to preserve as much of that data as possible, a relatively high error velocity of 10 cm/s was used as an edit criteria. Therefore, we employed substantial hand editing of bad bins near the surface using this program. add_flag_fb.asc containing which data pixels have been edited. app_manfbedits2 --------------- Apply edits done using t_polyedit8 (file add_flag_fb.asc) to ...pro1.mat file. Repeast if necessary. Original file is preserved (...noedt.mat). convert_adcp_pro.m ------------------ Change the first line to the appropriate mat file and run it. A set of mat files for each data type will be saved which are used by the plotting routines. savepro_adcp.m -------------- Saves processed data into convenient structure for archiving. scmenu.m -------- GUI for plotting profiles and contours of velocity, etc. Outliers (mostly near the surface) were corrected by hand using t_polyedit.m routines (thanks F. Bahr). Set parameters near the top of the file. The offset settings are for the velocity profile plots. You can set to 0 to have all the profiles over a time range plotted over each other. Or you can set a positve number to space out each profile by X cm/sec. Good for seeing the time evolution of the data. Contouring is good for that too. Make sure you set the offsets back to 0 for the contour plots. If you don't, you will see why. run_scplot.m ------------ Matlab script for automating some of the plotting. Allows you to plot entire year time series in 10 day chunks. Save data and plots for archiving --------------------------------- > webmagick # Creates webpages for viewing data in directories. > ls -1 > listdir > ls -1 > listfiles - Add to listfiles index.html .index1.html .indexdir.html .index.pl - Edit each of these to have the files and directories you want to save. - Edit the format file and copy over to data directory. - Create tgz file with data and plots. > tar cvfz aon12_bs3a_ADCP.tgz `cat listdir` `cat listfiles` That's it for now! Daniel