This is the start of a description of how to process all three types of sonar data. emontgomery@usgs.gov 7/1/2009 The latest news is that the interface is now the same as for adcp and adv processing. Use penmeta, fanmeta, or azmmeta_exapmles to see what metadata is needed and how to input it. Running mkrawcdf from the meta_examples has been tested- processing for fan and pencil haven't, but should work OK. Uses read_globalatts to get the tripod's common metadata. Also note that plotrange_cdf.m works to display single azimuth images read from a az*_raw.cdf file. 24 November, 2008 Instructions for processing sonar data: 1) the program to use to process raw data offloaded from the logger is mkrawcdf(metafile, outFileRoot) 2) a separate meta file is required for each sonar type, so there must be one for fan, one for pencil, and one for azimuth (see fanrawmeta_example.txt in sonarlib). 3) the reader for the meta files is very picky about where the ## separating the fields from the comment. If there's an error, try adding spaces before the ##. 4) RootDataDir MUST point to a directory that contains ONLY subdirectories with names like I1006. I1007, where the 1006 stands for 10/06 or Oct. 6. There should be no files that are not of this type in there, or mkrawcdf will fail. If the directory structure looks like this: C:\home\data\sonar_tst\Oct08\rawdata\[I1003, I1004, I1005, I1006...], with S*.p##, S*.f## and S*.r## files (for pencil, fan and azimuth), RootDataDir should be C:\home\data\sonar_tst\Oct08\rawdata. 5) Most of the settings needed are found in the sonar's param.dat file. The list below shows the mappings of the names in param.dat to *rawmeta.txt. **nb- the number of sweeps is not in param.dat. Look at either headangle or head_pos to determine if one or two seeeps was made. ALL: Delta_T == minutes between samples in short loop * 60 (when more than one sampling interval is used, Delta_T is inaccurate). (Must be *60 since delta_t is in seconds) SectorSweep == fan/pencil beam sector to sweep AngleSweepAround == fan/pencil beam sector center StepSize == for fan is 0.15, for pencil is 0.3 (should be ~Sectorwidth/(scans/nsweeps_) (DegPerStep == StepSize) DataPoints == fan/pencil beam data points *10 There are a number of fields in the meta files leftover from when we tried to process the sonar data all in one step. Now, adcp_offset. rot and these aren't used (but are still checked for. dxy == size of output grid. start with .05, and go to .01 when the greatest resolution is needed. Pencil_tilt == adjustment needed to get pencil certer beam straight up and down. Adjust as needed. 6) For Fan, do_fan_rots uses procfanmeta.txt to convert the image to polar and rotate it to match North = up convention. The adcp offset from fan 0 is needed to make this rotation. This angle should be available on the mooring log or for hatteras, the orient###meta has all the measurements and angles incorporated- see the angles in _th variables. A person still has to think about the angels and offsets and look at the adcp compass at the beginning of the deployment to do the rotations. rotation 1 is to figure out how far fan 0 (middle of the blank area) is from adcp beam 3. (ADCP beam3 == +x) rotation 2 is to get to earth coordinates The initial ADCP compass data should provide that. tripod_plot.m can be used to overplot the tripod's features on the images to validate that the rotations made are correct and consistent.