6/26/09 There's now a working method of processing the pencil data. 1) use mkrawcdf to convert the raw *.p## files into a single file containing the raw images 2) follow the instructions in find_pencil_offset.doc to determine the tilt of the pencil xducer 3) put that value in proc*meta file as Pencil_tilt 4) run do_pen_proc.m to create the rotated images The code for finding the best line approximated by the bright returns now resides in linfrmimg.m- there's undoubtedly a better way to do it, but this is a general guide for one method. 6/3/09 working on getting a procpen equivalent to procfan. GOt the pencil section code from procsonar_apr07, then will wrap it to output a _proc.cdf file 1/20/09 The latest and best version of "processing" pencil beam data created by the WHSC logger is pre-20070418/plotpen07.m. plotpen81a.m (in same directory) works on imagenex logged files and works on data collected in Megansett harbor experiments. procsonar_07.m has fan and pencil sections. In the pencil section, readpencil then plotpen07 are called, then additional processing is done, if the value of "range" changes. This is not needed for files logged by the WHSC logger. I haven't verified that the ouptut netcdf is correct for pencil data files. for Jessie Lacy re: what we have for code to process sonar data. 1/20/09 I dug a bit further this morning, and suggest you use pre-20070418/plotpen07.m as a guide. I ran it this morning and it did what I expected. There's a new version with a bit more helpful comments. Don't forget to reset your axes to something like: axis ([0 481 -2 0]) because I put 1e35's in for missing or bad data, but since it's not a netcdf yet isn't known as a missing value indicator. Attached plots are of the image with trig applied to show in x-y plane (pen_out1.jpg), and the second just shows the line extracted from the image (pen_out2.jpg). Some notes: -data in the imagenex header is used to get position in the sweep and various other values - readpencil.m generates the structures needed by plotpen07.m -our profiles encompass two sweeps of the beam. I didn't verify that it still works properly for just one sweep or if it can't determine imgspersweep. -the method commented out starting at line 56 may work well for you. Because of what the dataset I was working on most recently didn't work with it, the other method with eliminating data not within std limits is currently used. I hope this helps. Ellyn