Steps for Processing AON 2011-2012 BS3a ADCP Mooring Data ========================================================= 4/11/2018 The data being processed here is from AON 2011-2012 mooring BS3a. Microcat was used for ADCP depth since they were deployed at the same depth. These data were initially processed using standard methods. But compass was found to be fixed at a single heading so all current direction data was bad. Speed was okay. So a method was applied where we used current direction from an overlapping Long Ranger deployment. A range of data from 15 - 25m comprised an overlap with an upward facing Long Ranger deployed at ~135m depth. The current direction of the LR data in the overlap region was applied to the WH current direction. Current speed was not modified. The compass correction was also applied to the ice velocity data for the Workhorse (bs3a). 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 = 00 % - Minimum percent good threshold. Due to 1 bad beam, 100% 3 beam solutions were used p.elim = 99 m/s - Maximum error velocity. Due to 1 bad beam, error velocity was not used as an editting criteria 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_bs3a.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 23256224 struct f 1x1 792 struct p 1x1 3420 struct >> d d = mag: [8782x1 double] % Magnetic variation at each time fl: [18 60 5 2 7.2400 5.0600 16.3100 300 1 87271606] % fixed leader data vl: [8782x26 double] % variable leader data vel: [8782x18x4 double] % velocity data corr: [8782x18x4 double] % correlation data echo: [8782x18x4 double] % echo amplitude data pg: [8782x18x4 double] % percent good data >> f f = adcp: 'BS03A000.000' cid: 'aon12' mc: 'bs3_201112_2133_cal.mat' res: 'bs3a' >> p p = struct with fields: sn: 2226 adcp_station: 'bs3a' freq: 300 name: 'bs3a' time_start: [2011 10 13 1 0 0] time_end: [2012 10 12 22 30 0] timoff: 0 drift: 0 poss: [71 23.6460 -152 -2.9100] magFLAG: 5 drot: 0 uvlim: 99 pglim: 0 elim: 99 use_pg3: 0 firm_vers: 16.3100 cpu_sn: '87271606' 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 regular output file has been replaced with aon12_bs3a_pro2.mat This new file has the editted current and ice directions 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 Microcat). % - Set velocities above surface (or cos of beam angle) to NaN. % - Also have applied heading correction to current and ice direction. 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 percent good 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. > la -1 > listdir > la -1 > listfiles - Edit each of these to have the files and directories you want to save. - Edit the format file and copy over to data directory. - Edit this processing 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